/* # static/css/calculator.css */

/* ... (Poprzednie style bez zmian) ... */

/* --- GLOWNE STYLE --- */
.calc-wrapper {
    background: #fff;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid #e2e8f0;
    max-width: 1100px;
    margin: -60px auto 0;
    position: relative;
    z-index: 10;
    /* Płynne przejście wysokości */
    transition: height 0.3s ease;
}

/* TOP BAR (NOWOŚĆ) */
.calc-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

/* STYLIZACJA SELECTA ROKU (Zastępuje .badge-year) */
.year-selector-wrapper {
    display: flex;
    align-items: center;
    background: #ecfdf5; /* Zielony pastelowy */
    border: 1px solid #d1fae5;
    border-radius: 20px;
    padding: 4px 12px;
    transition: all 0.2s ease;
}

.year-selector-wrapper:hover {
    border-color: #34d399;
    background: #d1fae5;
}

.year-selector-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #059669;
    margin-right: 6px;
    white-space: nowrap;
}

.year-select-minimal {
    background: transparent;
    border: none;
    color: #047857; /* Ciemniejszy zielony dla tekstu */
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    padding-right: 20px; /* Miejsce na własną strzałkę */
    appearance: none; /* Ukrycie domyślnej strzałki */
    
    /* Customowa strzałka (zielona) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23047857' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 10px;
}

.year-select-minimal:focus {
    text-decoration: underline;
}

.btn-print {
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}
.btn-print:hover { color: var(--color-navy); }


/* --- FORMULARZE (INPUT/SELECT) --- */
.form-select, .form-control, .form-control-lg, .form-control-sm, input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1; /* Slate 300 */
    border-radius: var(--radius-sm);
    background-color: #fff;
    color: var(--color-navy);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    appearance: none;
}

/* Ikona selecta */
.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%230F172A' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
}

input[type="number"] { background-image: none; }

.form-select.lg, .form-control-lg { padding: 14px 18px; font-size: 1.1rem; }
.form-control-sm { padding: 8px 12px; font-size: 0.9rem; }

.form-select:focus, .form-control:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* --- TOOLTIPS (NOWOŚĆ) --- */
.tooltipped {
    position: relative;
    cursor: help;
}
.info-icon {
    color: #94a3b8;
    font-size: 1rem;
    margin-left: 5px;
    vertical-align: middle;
}
.tooltipped:hover .info-icon { color: var(--color-gold); }

.tooltipped::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-navy);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    width: 200px;
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transition: 0.2s;
    pointer-events: none;
    z-index: 100;
    line-height: 1.4;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.tooltipped:hover::after {
    visibility: visible;
    opacity: 1;
    bottom: calc(100% + 10px);
}

/* --- ZAKŁADKI --- */
.main-mode-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 5px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
}

.mode-tab {
    flex: 1;
    padding: 15px;
    border: none;
    background: transparent;
    font-weight: 700;
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mode-tab.active {
    background: white;
    color: var(--color-navy);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* --- GRIDY KONFIGURACJI --- */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.calc-divider {
    border: 0;
    border-top: 1px dashed #cbd5e1;
    margin: 30px 0;
}

.mode-container { display: none; }
.mode-container.active { display: block; animation: fadeIn 0.4s ease; }

.center-input { max-width: 500px; margin: 0 auto; text-align: center; }
.center-input label { text-align: left; font-weight: 600; display: block; margin-bottom: 8px; color: var(--color-text-light); }

/* --- PREMIE I ZMIENNE --- */
.bonuses-section {
    margin-top: 30px;
    background: #f8fafc;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
}

.btn-add-bonus {
    background: none;
    border: none;
    color: var(--color-gold);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.bonus-row-fixed {
    display: grid;
    grid-template-columns: 1.5fr 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.variable-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.month-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: var(--radius-sm);
}

.month-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 8px;
}

.btn-add-month-bonus {
    background: none; border: none; color: var(--color-gold); cursor: pointer; padding: 0;
}
.month-bonuses-container input { margin-top: 5px; }

/* --- PARAMETRY --- */
.params-group {
    display: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 25px;
    border-radius: var(--radius-md);
    margin-top: 15px;
}
.params-group.show { display: block; }

.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.inputs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.checkbox-container {
    display: flex; align-items: center; cursor: pointer; font-size: 0.95rem; color: var(--color-text-main);
}
.checkbox-container input { display: none; }
.checkmark {
    width: 20px; height: 20px; border: 2px solid #cbd5e1; border-radius: 4px; margin-right: 10px;
    position: relative; transition: all 0.2s; display: flex; align-items: center; justify-content: center; background: white;
}
.checkbox-container input:checked + .checkmark {
    background-color: var(--color-gold); border-color: var(--color-gold); color: var(--color-navy);
}
.checkbox-container input:checked + .checkmark::after { content: '✓'; font-weight: 800; font-size: 0.8rem; }

.nested-options { display: none; margin-top: 15px; padding-left: 15px; border-left: 2px solid var(--color-gold); }
.nested-options.show { display: block; }
.radio-group-row { display: flex; gap: 15px; align-items: center; font-size: 0.9rem; margin-bottom: 10px; }
.full-width { width: 100%; }

/* --- DISCLAIMER (NOWOŚĆ) --- */
.calc-disclaimer {
    margin: 40px 0 30px;
    display: flex;
    gap: 15px;
    background-color: #fffbeb; /* Jasnożółty/beżowy */
    border: 1px solid #fcd34d; /* Złoty border */
    padding: 20px;
    border-radius: var(--radius-md);
    align-items: flex-start;
}

.calc-disclaimer i {
    font-size: 1.5rem;
    color: #d97706; /* Ciemny pomarańcz/złoto */
    flex-shrink: 0;
    margin-top: 2px;
}

.disclaimer-text {
    font-size: 0.9rem;
    color: #78350f; /* Ciemny brąz */
    line-height: 1.6;
}

/* --- SEKCJA WYNIKÓW (PREMIUM) --- */
.result-block { margin-bottom: 60px; }
.result-main-title {
    text-align: center; margin-bottom: 30px; font-size: 1.5rem; color: var(--color-navy);
}

.summary-card-grid {
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: flex-start; margin-bottom: 40px;
}

.summary-row {
    display: flex; justify-content: space-between; padding: 12px 15px; font-weight: 700; margin-bottom: 10px; border-radius: 4px;
}
.highlight-netto { background-color: #fff7ed; color: #9a3412; border-left: 4px solid #fdba74; }
.highlight-brutto { background-color: #f1f5f9; color: var(--color-navy); margin-top: 10px; border-left: 4px solid #cbd5e1; }
.highlight-total { background-color: #eff6ff; color: #1e40af; border-left: 4px solid #60a5fa; }

.deductions-list { padding: 0 10px; }
.deduction-row {
    display: flex; justify-content: space-between; padding: 6px 0; color: var(--color-text-main); border-bottom: 1px dashed #e2e8f0; font-size: 0.95rem;
}
.deduction-row:last-child { border-bottom: none; }

.summary-chart { height: 250px; position: relative; }

/* --- CTA KONWERSJA (NOWOŚĆ) --- */
.conversion-cta {
    margin: 40px 0;
    padding: 30px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-md);
    animation: slideIn 0.5s ease;
}

.cta-content-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.conversion-cta .icon-box {
    font-size: 3rem;
    color: #0284c7;
}

.conversion-cta .text-box h4 {
    margin: 0 0 5px 0;
    color: #0c4a6e;
    font-size: 1.2rem;
}
.conversion-cta .text-box p {
    margin: 0;
    color: #334155;
    font-size: 0.95rem;
}

.conversion-cta .btn-box {
    margin-left: auto;
}

.btn-navy-outline {
    border: 2px solid var(--color-navy);
    color: var(--color-navy);
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-navy-outline:hover {
    background: var(--color-navy);
    color: #fff;
}


/* --- TABELE MIESIĘCZNE --- */
.monthly-table-wrapper { margin-top: 20px; }
.table-title {
    text-align: left; margin-bottom: 15px; font-size: 1.1rem; color: var(--color-navy); font-weight: 700;
}

.detailed-table {
    width: 100%; border-collapse: collapse; font-size: 0.85rem; background: #fff; border: 1px solid #e2e8f0;
}

.detailed-table th, .detailed-table td {
    padding: 10px 8px; text-align: right; border: 1px solid #f1f5f9;
    white-space: nowrap; /* ZAPOBIEGANIE ŁAMANIU TEKSTU W TABELI */
}
.detailed-table th:first-child, .detailed-table td:first-child {
    text-align: left; font-weight: 600; background-color: #fafafa; width: 120px;
}

/* Zebra Striping */
.detailed-table tbody tr:nth-child(even) td { background-color: #fcfcfc; }
.detailed-table tbody tr:hover td { background-color: #fefce8; }

/* Nagłówki */
.detailed-table thead th {
    background-color: #fff; color: var(--color-text-light); font-weight: 600; text-align: center; vertical-align: middle;
    border-bottom: 2px solid #e2e8f0;
}

/* Kolory dla Tabel */
#emp-monthly-table .th-netto { background-color: #fff7ed !important; color: #9a3412 !important; border-bottom: 2px solid #fdba74; }
#emp-monthly-table td:last-child { font-weight: 700; background-color: #fff7ed; color: #9a3412; }
#emp-monthly-table tfoot tr { background-color: #ffedd5; font-weight: 800; color: #9a3412; }

#er-monthly-table .th-total { background-color: #eff6ff !important; color: #1e40af !important; border-bottom: 2px solid #60a5fa; }
#er-monthly-table td:last-child { font-weight: 700; background-color: #eff6ff; color: #1e40af; }
#er-monthly-table tfoot tr { background-color: #dbeafe; font-weight: 800; color: #1e40af; }

.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --- FAQ SEO --- */
.calculator-faq {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e2e8f0;
}

.calculator-faq h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.faq-item h3 {
    font-size: 1.1rem;
    color: var(--color-navy);
    margin-bottom: 10px;
}
.faq-item p {
    font-size: 0.95rem;
    color: var(--color-text-main);
    line-height: 1.6;
}

/* --- RESPONSYWNOŚĆ --- */
@media (max-width: 900px) {
    .variable-grid { grid-template-columns: repeat(2, 1fr); }
    .summary-card-grid { grid-template-columns: 1fr; }
    .faq-grid { grid-template-columns: 1fr; }
    
    .cta-content-inner { flex-direction: column; text-align: center; }
    .conversion-cta .btn-box { margin: 0; }
    .conversion-cta .icon-box { margin-bottom: 10px; }
}

@media (max-width: 600px) {
    .variable-grid { grid-template-columns: 1fr; }
    .settings-grid, .checkbox-grid, .inputs-grid { grid-template-columns: 1fr; }
    .detailed-table { font-size: 0.75rem; }
    .detailed-table th, .detailed-table td { padding: 6px 4px; }
}

/* --- DRUKOWANIE (PRINT STYLES) --- */
@media print {
    body { background: #fff; font-size: 12pt; }
    .main-header, .top-bar, .main-footer, .calc-actions, .main-mode-tabs, .calc-top-bar { display: none !important; }
    .calc-wrapper { box-shadow: none; border: none; margin: 0; padding: 0; }
    .calculator-section { padding: 0; }
    #results-panel { display: block !important; margin-top: 0; }
    .result-block { page-break-inside: avoid; margin-bottom: 30px; }
    .conversion-cta { display: none !important; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }