:root {
    --primary-dark: #0a2342;
    --primary-blue: #0066cc;
    --accent-cyan: #00b4d8;
    --bg-light: #f4f7f9;
    --white: #ffffff;
    --weak: #ff4757; --medium: #ffa502; --strong: #2ed573; --excellent: #1e90ff;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; 
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-light);
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto; 
}

/* ==========================================================================
   NOWE MENU (STICKY TOP-BAR) - Klasyczne i eleganckie
   ========================================================================== */
.sticky-nav {
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1000;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.sticky-nav a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 4px;
    transition: 0.2s;
    background: var(--bg-light);
}

.sticky-nav a:hover {
    background: var(--primary-blue);
    color: var(--white);
}

/* ==========================================================================
   LAYOUT GŁÓWNY
   ========================================================================== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 10px 20px;
}

.module-title {
    text-align: center;
    color: var(--primary-dark);
    text-transform: uppercase;
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 15px 0;
    letter-spacing: 1px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dce4ec;
}

.module-section {
    min-height: calc(100vh - 180px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 5px;
}

.hash-module-compact {
    min-height: auto; 
    padding-bottom: 10px;
}

.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 15px;
    flex: 1;
    min-height: 0;
}

.panel {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    padding: 15px;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   ELEMENTY WSPÓLNE
   ========================================================================== */
.top-bar { display: flex; justify-content: space-between; align-items: center; height: 30px; font-size: 0.85rem; flex-shrink: 0; margin-bottom: 10px; }
.ip-badge { background: #e1ecf4; padding: 2px 10px; border-radius: 12px; color: var(--primary-blue); font-weight: bold; }

/* Wersja tekstowa flag - bez emoji */
.lang-flags a { 
    text-decoration: none; 
    font-size: 0.9rem; 
    font-weight: bold;
    color: var(--primary-dark);
    background: #eef1f5;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 6px; 
    transition: 0.2s; 
    display: inline-block; 
}
.lang-flags a:hover { background: var(--primary-blue); color: var(--white); }

h3 { margin: 0 0 10px 0; font-size: 0.9rem; color: var(--primary-dark); text-transform: uppercase; border-bottom: 2px solid #f0f0f0; padding-bottom: 5px; font-weight: 700; }
.separator { border: 0; border-top: 1px solid #eee; margin: 10px 0; }

.input-row { display: flex; gap: 20px; margin-bottom: 12px; }
.flex-label { display: flex; align-items: center; font-weight: 600; font-size: 0.85rem; }
.input-tiny { width: 55px; padding: 5px; border: 1px solid #ccc; border-radius: 4px; margin-left: 8px; text-align: center; }

.checkbox-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.checkbox-list label { cursor: pointer; display: flex; align-items: center; font-size: 0.85rem; line-height: 1.3; }
input[type="checkbox"] { margin-right: 10px; transform: scale(1.1); }

.input-group { margin-bottom: 8px; }
.input-group label { display: block; font-weight: 600; font-size: 0.8rem; margin-bottom: 3px; }
.input-full { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85rem; }

.btn-primary { background: var(--primary-blue); color: white; border: none; padding: 12px; border-radius: 6px; font-weight: bold; cursor: pointer; width: 100%; font-size: 1rem; margin-top: 15px; transition: 0.2s; }
.btn-primary:hover { background: #0056b3; }
.btn-primary:active { transform: scale(0.98); }

.strength-meter-container { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 0.8rem; font-weight: bold; }
.strength-bar-bg { flex: 1; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.strength-bar-fill { height: 100%; width: 0%; transition: 0.4s ease; background: var(--weak); }

.output-container { display: flex; flex-direction: column; justify-content: space-between; }
.output-box { flex: 1; background: #2c3e50; color: #2ecc71; padding: 15px; border-radius: 6px; font-family: 'Courier New', monospace; font-size: 1rem; border: none; resize: none; line-height: 1.4; min-height: 150px; }

.hash-textarea { flex: 1; resize: none; font-family: monospace; font-size: 0.95rem; padding: 10px; min-height: 80px; }
.hash-output-group { margin-bottom: 8px; display: flex; flex-direction: column; }
.hash-label { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.75rem; margin-bottom: 2px; color: var(--primary-dark); }
.hash-readonly { background: #eef1f5; color: var(--primary-dark); font-family: 'Courier New', monospace; font-weight: bold; border: 1px solid #dce4ec; padding: 6px; min-height: 35px; }
.btn-copy-small { background: var(--primary-blue); color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 0.7rem; font-weight: bold; padding: 4px 10px; transition: 0.2s; }
.btn-copy-small:hover { background: #0056b3; }

.code-textarea { flex: 1; resize: none; font-family: monospace; font-size: 0.95rem; padding: 12px; min-height: 120px; }

/* ==========================================================================
   UKŁAD KODÓW (W POZIOMIE Z ODSTĘPAMI)
   ========================================================================== */
.multi-canvas-container {
    flex: 1;
    display: flex;
    flex-direction: row;        /* Układa kody obok siebie (poziom) */
    flex-wrap: wrap;            /* Zawija do nowej linii jak zabraknie miejsca */
    justify-content: center;    /* Środkuje je na ekranie */
    align-items: center;
    align-content: flex-start;  
    background: #f8f9fa;
    border: 2px dashed #dce4ec;
    border-radius: 6px;
    padding: 20px;
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
    gap: 30px;                  /* Wyraźne odstępy pomiędzy kodami */
}

.multi-canvas-container canvas {
    max-width: 100%; 
    height: auto;
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.action-buttons { display: flex; gap: 10px; margin-top: 10px; }
.btn-action { flex: 1; padding: 12px; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; font-size: 0.8rem; color: white; transition: 0.2s; }
.btn-copy { background: #34495e; } .btn-copy:hover { background: #2c3e50; }
.btn-download { background: var(--accent-cyan); } .btn-download:hover { filter: brightness(0.9); }

.ad-strip { height: 50px; background: #eef1f5; border: 1px solid #dce4ec; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: #999; margin: 15px 0; border-radius: 6px; flex-shrink: 0; }

.footer-mini { display: flex; justify-content: space-between; border-top: 1px solid #eee; padding-top: 10px; margin-top: 10px; color: #999; font-size: 0.7rem; padding-bottom: 10px;}
.footer-mini a { color: var(--primary-blue); text-decoration: none; font-weight: 600; margin-left: 10px; }

.modal { display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); }
.modal-content { background: white; margin: 5% auto; padding: 25px; width: 600px; max-width: 90%; border-radius: 10px; position: relative; max-height: 80vh; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.close-btn { float: right; font-size: 28px; cursor: pointer; color: #666; }

/* ==========================================================================
   RWD
   ========================================================================== */
@media (max-width: 900px) {
    .app-container { padding: 10px; }
    .sticky-nav { flex-wrap: wrap; gap: 5px; padding: 8px; }
    .sticky-nav a { font-size: 0.75rem; padding: 6px 10px; flex: 1; text-align: center; }
    .module-section, .hash-module-compact { min-height: auto; display: block; margin-bottom: 20px; padding-top: 10px; }
    .main-content { display: block; }
    .panel { margin-bottom: 20px; overflow: visible; }
    .top-bar { margin-bottom: 10px; flex-wrap: wrap; height: auto; gap: 10px; }
    .input-row { justify-content: space-between; }
    .output-box { min-height: 180px; }
    .modal-content { width: 95%; margin: 10% auto; }
}