/* ============================================================
   Głos ZSŁ — Modern Design System
   Color palette: Deep navy, teal accents, soft neutrals
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Core palette */
    --bg-primary:    #0f172a;
    --bg-secondary:  #1e293b;
    --bg-card:       rgba(30, 41, 59, 0.70);
    --bg-glass:      rgba(30, 41, 59, 0.55);

    /* Accent colors */
    --accent:        #06b6d4;
    --accent-hover:  #22d3ee;
    --accent-glow:   rgba(6, 182, 212, 0.25);

    /* Vote colors */
    --vote-yes:      #10b981;
    --vote-yes-hover:#34d399;
    --vote-no:       #ef4444;
    --vote-no-hover: #f87171;
    --vote-abstain:  #f59e0b;
    --vote-abstain-hover: #fbbf24;

    /* Text */
    --text-primary:  #f1f5f9;
    --text-secondary:#94a3b8;
    --text-muted:    #64748b;

    /* Borders & Surfaces */
    --border:        rgba(148, 163, 184, 0.12);
    --border-hover:  rgba(148, 163, 184, 0.25);
    --surface-hover: rgba(148, 163, 184, 0.08);

    /* Misc */
    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     16px;
    --radius-xl:     24px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.3);
    --shadow-md:     0 4px 16px rgba(0,0,0,0.35);
    --shadow-lg:     0 8px 32px rgba(0,0,0,0.4);
    --shadow-glow:   0 0 30px var(--accent-glow);
    --transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --navbar-width:  260px;
    --navbar-collapsed: 0px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Subtle background pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(6,182,212,0.08), transparent),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(99,102,241,0.06), transparent);
    pointer-events: none;
    z-index: 0;
}

/* ---------- Wrapper ---------- */
#wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ---------- Navigation Sidebar ---------- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--navbar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-right: 1px solid var(--border);
    z-index: 1000;
    transition: transform var(--transition), opacity var(--transition);
    overflow-y: auto;
    gap: 6px;
}

/* Brand area at top of sidebar */
#navbar::before {
    content: '🗳️ Głos ZSŁ';
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    padding: 8px 12px 20px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* Nav buttons */
.nav_button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.nav_button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
    transition: transform var(--transition);
}

.nav_button:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.nav_button:hover::before {
    transform: translateY(-50%) scaleY(1);
}

.nav_button:active {
    transform: scale(0.98);
}

/* Logout button specific */
.nav_button[name="log_out"],
.nav_button[value="submit"] {
    margin-top: auto;
    color: var(--vote-no);
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 16px;
}

.nav_button[name="log_out"]:hover,
.nav_button[value="submit"]:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--vote-no-hover);
}

/* Hidden logout form */
#log_out_form {
    display: none;
}

/* Hamburger toggle */
#menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1;
}

#menu-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- Main Content Area ---------- */
#content {
    flex: 1;
    margin-left: var(--navbar-width);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: calc(100vh - 80px);
    transition: margin-left var(--transition);
}

/* ---------- Footer ---------- */
#footer {
    position: fixed;
    bottom: 0;
    left: var(--navbar-width);
    right: 0;
    padding: 12px 40px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: left var(--transition);
}

#footer br {
    display: none;
}

/* Council start/stop button in footer */
#rada {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

#rada:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* ============================================================
   CARDS & PANELS — Glassmorphism containers
   ============================================================ */

.dologowan {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: fadeSlideUp 0.5s ease-out;
}

#glos {
    width: 100%;
    max-width: 600px;
    animation: fadeSlideUp 0.5s ease-out;
}

#holder {
    width: 100%;
    max-width: 700px;
    animation: fadeSlideUp 0.5s ease-out;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

#logowanieh2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 28px;
    letter-spacing: -0.03em;
    text-align: center;
}

#trescpyt {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    padding: 20px 24px;
    margin-bottom: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    line-height: 1.5;
}

/* ============================================================
   FORMS — Inputs, textareas, selects
   ============================================================ */

.formlogin,
#register_form,
#pytanie_form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition);
    outline: none;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(15, 23, 42, 0.8);
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* br spacer removal inside forms */
.formlogin br,
#register_form br,
#pytanie_form br {
    display: none;
}

/* ============================================================
   BUTTONS — Primary, secondary, vote
   ============================================================ */

/* Primary submit button */
#zaloguj,
input[type="submit"],
button[type="submit"]:not(.nav_button) {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent), #0891b2);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

#zaloguj:hover,
input[type="submit"]:hover,
button[type="submit"]:not(.nav_button):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(6, 182, 212, 0.35);
    background: linear-gradient(135deg, var(--accent-hover), #06b6d4);
}

#zaloguj:active,
input[type="submit"]:active {
    transform: translateY(0);
}

/* Secondary / File buttons */
#zpliku,
.plik {
    padding: 10px 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

#zpliku:hover,
.plik:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* File input styling */
input[type="file"] {
    width: 100%;
    padding: 12px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
}

input[type="file"]:hover {
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.05);
}

/* ============================================================
   VOTE BUTTONS
   ============================================================ */

.voter {
    display: block;
    width: 100%;
    padding: 18px 24px;
    margin: 8px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Tak (Yes) */
.voter[value="Tak"],
.voter:first-of-type {
    background: rgba(16, 185, 129, 0.1);
    color: var(--vote-yes);
    border-color: rgba(16, 185, 129, 0.25);
}

.voter[value="Tak"]:hover,
.voter:first-of-type:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--vote-yes);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

/* Nie (No) */
.voter[value="Nie"],
.voter:nth-of-type(2) {
    background: rgba(239, 68, 68, 0.1);
    color: var(--vote-no);
    border-color: rgba(239, 68, 68, 0.25);
}

.voter[value="Nie"]:hover,
.voter:nth-of-type(2):hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--vote-no);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
}

/* Wstrzymuje się (Abstain) */
.voter[value="Wstrzymuje się"],
.voter:nth-of-type(3) {
    background: rgba(245, 158, 11, 0.1);
    color: var(--vote-abstain);
    border-color: rgba(245, 158, 11, 0.25);
}

.voter[value="Wstrzymuje się"]:hover,
.voter:nth-of-type(3):hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--vote-abstain);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2);
}

.voter:active {
    transform: translateY(0) scale(0.98);
}

/* ============================================================
   VOTE FORM AREA
   ============================================================ */

#glos_form {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Timeout overlay */
.timeout {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--accent);
    padding: 40px;
}

.timeout[style*="display: block"],
.timeout[style*="display:block"] {
    display: flex !important;
}

/* Spinner animation for timeout */
.timeout::before {
    content: '';
    display: block;
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 24px;
}

/* ============================================================
   RADIO BUTTONS (Register page)
   ============================================================ */

#radio {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
}

#wsrodku,
.radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    cursor: pointer;
}

#wsrodku:hover,
.radio-item:hover {
    background: var(--surface-hover);
}

input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

input[type="radio"] + label {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color var(--transition);
}

input[type="radio"]:checked + label {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================================
   REGISTER PAGE — User adder / Bulk / Manager
   ============================================================ */

#adder {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#bulk {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px 32px;
    margin-bottom: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#remover {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px 32px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#remover select {
    width: 100%;
    margin-bottom: 12px;
}

#remover .plik {
    width: auto;
    background: rgba(239, 68, 68, 0.1);
    color: var(--vote-no);
    border-color: rgba(239, 68, 68, 0.25);
}

#remover .plik:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--vote-no);
}

.duser {
    width: 100%;
    padding: 14px 18px !important;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
    font-family: inherit;
    font-size: 0.9rem;
}

/* Validation label */
#bad_pwd {
    color: var(--vote-no);
    font-size: 0.85rem;
    font-weight: 500;
    min-height: 0;
}

/* ============================================================
   ZADAWANIE PYTAŃ (Ask questions page)
   ============================================================ */

.pytanie {
    width: 100%;
    padding: 16px 20px;
    margin: 8px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.pytanie:hover {
    border-color: var(--border-hover);
    background: rgba(30, 41, 59, 0.85);
}

.pytanie #tresc {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

#pytanieform {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 0;
    margin: 0;
}

#zadajpytanie {
    max-width: 100% !important;
    padding: 10px 20px;
    font-size: 0.85rem;
}

#bulkAdder {
    margin-top: 20px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

/* ============================================================
   WYNIK (Results page) & CHARTS
   ============================================================ */

#myChart {
    max-width: 400px;
    max-height: 400px;
    margin: 20px auto;
}

.button1.przyciskstyl.voter {
    margin-top: 20px;
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important;
    padding: 14px 24px;
    font-size: 0.9rem;
}

.button1.przyciskstyl.voter:hover {
    background: var(--surface-hover) !important;
    color: var(--text-primary) !important;
    border-color: var(--accent) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================================
   STARE WYNIKI & RAPORTY (Report & History page)
   ============================================================ */

.report-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.report-filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.report-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.report-select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
}

.report-select:hover,
.report-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#charts {
    width: 100%;
    max-width: 900px;
    margin: 20px auto 0;
    padding-bottom: 80px; /* Prevent fixed footer overlap */
    animation: fadeSlideUp 0.3s ease-out;
}

.report-results-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.report-subtitle {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 16px 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.report-table th {
    background: rgba(15, 23, 42, 0.75);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.report-table td {
    padding: 14px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.report-table tbody tr:last-child td {
    border-bottom: none;
}

.report-table tbody tr {
    transition: background var(--transition);
}

.report-table tbody tr:hover {
    background: var(--surface-hover);
}

.text-center {
    text-align: center !important;
}

.vote-yes-cell {
    color: var(--vote-yes);
}

.vote-no-cell {
    color: var(--vote-no);
}

.vote-abstain-cell {
    color: var(--vote-abstain);
}

.vote-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 2px;
}

.badge-user {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.85rem;
}

.report-action-bar {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    padding: 16px 0;
}

.btn-pdf-download,
.buffer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--accent), #0891b2);
    color: #ffffff !important;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
    transition: all var(--transition);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-pdf-download:hover,
.buffer:hover {
    background: linear-gradient(135deg, var(--accent-hover), #06b6d4);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(6, 182, 212, 0.5);
    color: #ffffff !important;
}

.btn-pdf-download:active,
.buffer:active {
    transform: translateY(0);
}

/* ============================================================
   ERROR MESSAGES & NOTIFICATIONS
   ============================================================ */

#tempadm {
    border-color: var(--vote-abstain) !important;
    background: rgba(245, 158, 11, 0.1) !important;
    color: var(--vote-abstain);
}

/* ============================================================
   TECHNICAL / HIDDEN ELEMENTS
   ============================================================ */

.technical {
    display: none;
}

/* ============================================================
   RESET PAGE OVERRIDES
   ============================================================ */

/* The reset pages use their own wrappers but inherit these base styles */

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

/* Subtle entrance for content loads */
#content > * {
    animation: fadeSlideUp 0.4s ease-out both;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================================
   RESPONSIVE — Tablet & Mobile
   ============================================================ */

@media (max-width: 900px) {
    /* Sidebar off-canvas on mobile */
    #navbar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: none;
    }

    #navbar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    /* Overlay when menu is open */
    #navbar.show ~ #content::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    #menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #content {
        margin-left: 0;
        padding: 72px 20px 100px;
    }

    #footer {
        left: 0;
        padding: 10px 20px;
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .dologowan {
        padding: 28px 24px;
        max-width: 100%;
        border-radius: var(--radius-lg);
    }

    #glos {
        max-width: 100%;
    }

    #holder {
        max-width: 100%;
    }

    .voter {
        padding: 16px 20px;
        font-size: 1rem;
    }

    #logowanieh2 {
        font-size: 1.3rem;
    }

    #trescpyt {
        font-size: 1rem;
        padding: 16px 18px;
    }

    #myChart {
        max-width: 280px;
        max-height: 280px;
    }

    .timeout {
        font-size: 1.2rem;
    }

    /* Zadawanie pytań scroll container */
    #trescpyt {
        max-height: 250px;
        overflow-y: auto;
    }

    #adder, #bulk, #remover {
        padding: 24px 20px;
        border-radius: var(--radius-lg);
    }

    .plik {
        width: 100% !important;
    }

    #zpliku {
        width: 100%;
    }
}

/* Small phones */
@media (max-width: 480px) {
    #content {
        padding: 68px 14px 96px;
    }

    .dologowan {
        padding: 24px 18px;
    }

    #logowanieh2 {
        font-size: 1.15rem;
    }

    .voter {
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"],
    textarea {
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    #zaloguj,
    input[type="submit"] {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* Large desktop */
@media (min-width: 1400px) {
    #content {
        padding: 48px 60px;
    }

    .dologowan {
        max-width: 520px;
    }

    #glos {
        max-width: 640px;
    }
}

/* ============================================================
   SELECTION HIGHLIGHT
   ============================================================ */

::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

/* ============================================================
   FOCUS VISIBLE (Accessibility)
   ============================================================ */

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
    outline: none;
}
