/* UK CALCULATOR - STANDARDIZED STYLES FOR ALL CALCULATORS */
/* Enhanced for 2025 with Dark Mode, FAQ sections, and Universal Accessibility */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark: #343a40;
    --light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0,0,0,0.1);

    /* Dark mode variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #343a40;
    --text-secondary: #6c757d;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
}

/* Dark mode color scheme */
html[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #706fd3;
    --card-bg: #2c2c54;
    --shadow: 0 10px 30px rgba(0,0,0,0.3);
}

body.dark-mode {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #706fd3;
    --card-bg: #2c2c54;
    --shadow: 0 10px 30px rgba(0,0,0,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
}

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

/* CALCULATOR CARD */
.calculator-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.dark-mode .calculator-container {
    background: #2c2c54;
    color: #ffffff;
    border: 1px solid #706fd3;
}

.calculator-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary-color);
}

.calculator-header h1 {
    color: var(--dark);
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.calculator-header p {
    color: #6c757d;
    font-size: 1.1rem;
}

/* INPUT GROUPS */
.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input[type="number"],
.input-group input[type="text"],
.input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* INPUT ROW FOR 2 COLUMNS */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* CALCULATE BUTTON */
.calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* KEYBOARD SHORTCUTS */
.keyboard-shortcut {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 10px;
    opacity: 0.7;
}

.keyboard-shortcut kbd {
    background: var(--light);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 0.7rem;
}

.dark-mode .keyboard-shortcut kbd {
    background: #40407a;
    border-color: #706fd3;
    color: #ffffff;
}

/* CURRENCY FORMATTING HELPERS */
.currency {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.large-currency {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* RESULTS BOX - STANDARDIZED */
.results-box {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    border-left: 5px solid var(--primary-color);
    display: none;
    animation: slideIn 0.5s ease;
}

.results-box.show {
    display: block;
}

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

.results-header {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 1rem;
}

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

.result-label {
    color: #6c757d;
    font-weight: 500;
}

.result-value {
    font-weight: 700;
    color: var(--dark);
    font-size: 1.1rem;
}

.result-value.positive {
    color: var(--success-color);
}

.result-value.negative {
    color: var(--danger-color);
}

.result-value.primary {
    color: var(--primary-color);
    font-size: 1.3rem;
}

/* RESULT DIVIDER */
.result-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin: 20px 0;
}

/* HIGHLIGHT BOX */
.result-highlight {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.result-highlight .label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.result-highlight .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* INFO BOX */
.info-box {
    background: #e7f3ff;
    border-left: 4px solid var(--info-color);
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

.info-box i {
    color: var(--info-color);
    margin-right: 10px;
}

/* WARNING BOX */
.warning-box {
    background: #fff3cd;
    border-left: 4px solid var(--warning-color);
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

.warning-box i {
    color: var(--warning-color);
    margin-right: 10px;
}

/* TABLE STYLE FOR RESULTS */
.result-table {
    width: 100%;
    margin: 20px 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.result-table th {
    background: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.result-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

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

.result-table tr:hover {
    background: var(--light);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .calculator-container {
        padding: 20px;
    }

    .calculator-header h1 {
        font-size: 1.8rem;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .result-item {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
}

/* NAVIGATION */
.nav-bar {
    background: white;
    padding: 15px 0;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.nav-bar ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.nav-bar a {
    color: var(--dark);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-bar a:hover {
    background: var(--primary-color);
    color: white;
}

.nav-bar a.active {
    background: var(--primary-color);
    color: white;
}

/* FOOTER */
.footer {
    text-align: center;
    padding: 30px 0;
    color: white;
    margin-top: 50px;
}

.footer a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
}

.footer a:hover {
    text-decoration: underline;
}

/* LOADING SPINNER */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid var(--light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* CHART CONTAINER */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* PROGRESS BAR */
.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    transition: width 0.5s ease;
}

/* TABS */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    padding: 20px 0;
}

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

/* FAQ SECTION */
.faq-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: var(--shadow);
}

.faq-section h2 {
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-align: center;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    padding-bottom: 20px;
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.faq-question {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    transition: color 0.3s ease;
}

.faq-question:hover {
    color: var(--primary-color);
}

.faq-question::after {
    content: "+";
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.faq-question.active::after {
    transform: rotate(45deg);
}

.faq-answer {
    color: var(--text-secondary);
    line-height: 1.6;
    display: none;
    padding: 0 0 10px 0;
    animation: fadeIn 0.3s ease;
}

.faq-answer.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* STRUCTURED DATA HELPERS */
.schema-org {
    display: none;
}

/* ACCESSIBILITY IMPROVEMENTS */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus-visible:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* HIGH CONTRAST MODE */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0066cc;
        --secondary-color: #004499;
        --text-primary: #000000;
        --border-color: #000000;
    }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* OFFLINE INDICATOR */
.offline-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: var(--warning-color);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    display: none;
    z-index: 1000;
}

.offline-indicator.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* FOOTER UPDATES */
.footer {
    text-align: center;
    padding: 30px 0;
    color: white;
    margin-top: 50px;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.footer-links a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.footer-disclaimer {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 15px;
    line-height: 1.5;
}

.footer-update {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 10px;
}

/* PRINT STYLES */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .calculate-btn,
    .nav-bar,
    .footer,
    .dark-mode-toggle,
    .export-buttons,
    .faq-section {
        display: none !important;
    }

    .calculator-container {
        box-shadow: none;
        border: 1px solid #ddd;
        background: white !important;
        color: black !important;
    }

    .results-box {
        background: white !important;
        border: 1px solid #ddd;
        color: black !important;
    }

    .result-highlight {
        background: #f8f9fa !important;
        color: black !important;
    }

    .result-value {
        color: black !important;
    }

    /* Print header */
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #333;
    }

    .print-footer {
        display: block !important;
        text-align: center;
        margin-top: 20px;
        padding-top: 10px;
        border-top: 1px solid #333;
        font-size: 0.9rem;
    }
}

/* RESPONSIVE IMPROVEMENTS */
@media (max-width: 480px) {
    .calculator-container {
        padding: 15px;
        margin: 10px;
    }

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

    .export-buttons {
        justify-content: center;
    }

    .export-btn {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}