/* FinKalkulator - Style dla kalkulatorów finansowych */

/* === RESET I BAZOWE STYLE === */
.fk-calculator {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 600px;
    margin: 30px auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.fk-calculator * {
    box-sizing: border-box;
}

/* === NAGŁÓWEK === */
.fk-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: white;
    padding: 28px 30px;
    text-align: center;
}

.fk-icon {
    font-size: 42px;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.fk-header h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.fk-subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.85;
    font-weight: 400;
}

/* === BODY / FORMULARZ === */
.fk-body {
    padding: 28px 30px;
}

.fk-form-group {
    margin-bottom: 22px;
}

.fk-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.fk-form-row {
    display: flex;
    gap: 16px;
}

.fk-half {
    flex: 1;
}

/* === INPUTY === */
.fk-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: #fff;
    color: #1f2937;
}

.fk-input:focus {
    outline: none;
    border-color: #2d5a87;
    box-shadow: 0 0 0 4px rgba(45, 90, 135, 0.1);
}

.fk-input::placeholder {
    color: #9ca3af;
}

/* === SELECT === */
.fk-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 12px center;
    background-size: 20px;
    appearance: none;
    cursor: pointer;
    color: #1f2937;
    transition: all 0.2s ease;
}

.fk-select:focus {
    outline: none;
    border-color: #2d5a87;
    box-shadow: 0 0 0 4px rgba(45, 90, 135, 0.1);
}

/* === TOGGLE BUTTONS === */
.fk-toggle-group {
    display: flex;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.fk-toggle {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fk-toggle:hover {
    color: #374151;
}

.fk-toggle.active {
    background: #fff;
    color: #1e3a5f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* === CHECKBOX === */
.fk-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fk-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #2d5a87;
    cursor: pointer;
}

.fk-checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}

/* === RANGE SLIDER === */
.fk-range-container {
    margin-top: 12px;
}

.fk-range-container input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    appearance: none;
    cursor: pointer;
}

.fk-range-container input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d5a87 0%, #1e3a5f 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.4);
    transition: transform 0.2s;
}

.fk-range-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.fk-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}

/* === PRZYCISK GŁÓWNY === */
.fk-button {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #2d5a87 0%, #1e3a5f 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(30, 58, 95, 0.35);
}

.fk-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.45);
}

.fk-button:active {
    transform: translateY(0);
}

/* === HINT / PODPOWIEDŹ === */
.fk-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}

/* === WYNIKI === */
.fk-results {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 28px 30px;
    border-top: 1px solid #e0e7ef;
}

.fk-results h4 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e3a5f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fk-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.fk-result-item {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.fk-result-item.fk-highlight {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: white;
    grid-column: span 2;
}

.fk-result-item.fk-big {
    padding: 24px;
}

.fk-result-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
    font-weight: 500;
}

.fk-highlight .fk-result-label {
    color: rgba(255, 255, 255, 0.8);
}

.fk-result-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.fk-highlight .fk-result-value {
    color: white;
    font-size: 28px;
}

.fk-big .fk-result-value {
    font-size: 32px;
}

/* === INFO BOX === */
.fk-info-box {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    border-left: 4px solid #2d5a87;
}

.fk-info-box p {
    margin: 0;
    font-size: 14px;
    color: #4b5563;
}

.fk-info-box.fk-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.fk-info-box.fk-warning p {
    color: #92400e;
}

/* === TABY === */
.fk-tabs {
    display: flex;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.fk-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fk-tab.active {
    background: #fff;
    color: #1e3a5f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fk-tab-content {
    display: none;
}

.fk-tab-content.active {
    display: block;
}

/* === WALUTY === */
.fk-currency-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.fk-currency-select {
    flex: 1;
}

.fk-swap-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 22px;
}

.fk-swap-btn:hover {
    background: #f3f4f6;
    border-color: #2d5a87;
}

.fk-currency-result {
    text-align: center;
    padding: 24px;
    background: white;
    border-radius: 16px;
    margin-bottom: 16px;
}

.fk-currency-result span {
    display: block;
}

#fk-wal-z-kwota {
    font-size: 18px;
    color: #6b7280;
}

.fk-equals {
    font-size: 24px;
    color: #9ca3af;
    margin: 8px 0;
}

.fk-big-result {
    font-size: 36px;
    font-weight: 700;
    color: #1e3a5f;
}

.fk-exchange-info {
    text-align: center;
}

.fk-exchange-info p {
    margin: 4px 0;
    font-size: 14px;
    color: #6b7280;
}

/* === OKRES LOKATY === */
.fk-period-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fk-period-btn {
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fk-period-btn:hover {
    border-color: #2d5a87;
    color: #2d5a87;
}

.fk-period-btn.active {
    background: #1e3a5f;
    border-color: #1e3a5f;
    color: white;
}

/* === URZĄDZENIA === */
.fk-quick-devices {
    margin-bottom: 20px;
}

.fk-quick-devices label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.fk-device-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fk-device-btn {
    padding: 8px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fk-device-btn:hover {
    border-color: #2d5a87;
    color: #2d5a87;
    background: #f0f9ff;
}

/* === VAT === */
.fk-vat-rates {
    display: flex;
    gap: 8px;
}

.fk-vat-rate {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fk-vat-rate:hover {
    border-color: #2d5a87;
}

.fk-vat-rate.active {
    background: #1e3a5f;
    border-color: #1e3a5f;
    color: white;
}

.fk-vat-summary {
    background: white;
    border-radius: 16px;
    overflow: hidden;
}

.fk-vat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.fk-vat-item:last-child {
    border-bottom: none;
}

.fk-vat-label {
    font-size: 15px;
    color: #6b7280;
}

.fk-vat-value {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.fk-vat-plus {
    background: #f0f9ff;
}

.fk-vat-total {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
}

.fk-vat-total .fk-vat-label,
.fk-vat-total .fk-vat-value {
    color: white;
}

.fk-vat-total .fk-vat-value {
    font-size: 24px;
}

/* === TABELA === */
.fk-table-container {
    margin-top: 20px;
    overflow-x: auto;
}

.fk-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    font-size: 14px;
}

.fk-table th,
.fk-table td {
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid #f3f4f6;
}

.fk-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    text-align: right;
}

.fk-table th:first-child,
.fk-table td:first-child {
    text-align: left;
}

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

.fk-table tr:hover td {
    background: #f0f9ff;
}

/* === WYKRES OSZCZĘDNOŚCI === */
.fk-savings-chart {
    margin-top: 20px;
    background: white;
    border-radius: 12px;
    padding: 20px;
}

.fk-chart-bar {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.fk-chart-label {
    width: 80px;
    font-size: 13px;
    color: #6b7280;
}

.fk-chart-track {
    flex: 1;
    height: 24px;
    background: #f3f4f6;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.fk-chart-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.fk-chart-fill.wplaty {
    background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
}

.fk-chart-fill.odsetki {
    background: linear-gradient(90deg, #34d399 0%, #10b981 100%);
}

.fk-chart-value {
    width: 100px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-left: 12px;
}

/* === RESPONSYWNOŚĆ === */
@media (max-width: 640px) {
    .fk-calculator {
        margin: 16px;
        border-radius: 16px;
    }
    
    .fk-header {
        padding: 24px 20px;
    }
    
    .fk-header h3 {
        font-size: 20px;
    }
    
    .fk-body,
    .fk-results {
        padding: 20px;
    }
    
    .fk-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .fk-results-grid {
        grid-template-columns: 1fr;
    }
    
    .fk-result-item.fk-highlight {
        grid-column: span 1;
    }
    
    .fk-currency-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .fk-swap-btn {
        align-self: center;
        margin: 0 0 16px 0;
        transform: rotate(90deg);
    }
    
    .fk-toggle-group {
        flex-direction: column;
    }
    
    .fk-vat-rates {
        flex-wrap: wrap;
    }
    
    .fk-vat-rate {
        flex: 0 0 calc(50% - 4px);
    }
    
    .fk-period-buttons {
        justify-content: center;
    }
}

/* === ANIMACJE === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fk-results {
    animation: fadeIn 0.3s ease;
}

.fk-result-item {
    animation: fadeIn 0.3s ease;
    animation-fill-mode: both;
}

.fk-result-item:nth-child(1) { animation-delay: 0.05s; }
.fk-result-item:nth-child(2) { animation-delay: 0.1s; }
.fk-result-item:nth-child(3) { animation-delay: 0.15s; }
.fk-result-item:nth-child(4) { animation-delay: 0.2s; }
.fk-result-item:nth-child(5) { animation-delay: 0.25s; }
.fk-result-item:nth-child(6) { animation-delay: 0.3s; }
.fk-result-item:nth-child(7) { animation-delay: 0.35s; }
.fk-result-item:nth-child(8) { animation-delay: 0.4s; }

/* === DODATKOWE STYLE DLA OPCJI UOP === */
.fk-uop-options {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.fk-uop-options.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
}

/* === SCROLLBAR === */
.fk-table-container::-webkit-scrollbar {
    height: 6px;
}

.fk-table-container::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.fk-table-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.fk-table-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
