/* ============================================
   TTC Tax & Finance Calculators - Blue to Black Update
   Professional, Accessible Design
============================================ */

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ===== UPDATED COLOR VARIABLES (Blue → Black) ===== */
:root {
    --primary: #000000;     /* Changed from #2c5aa0 to black */
    --primary-dark: #333333; /* Changed from #1e4070 to dark gray */
    --secondary: #27ae60;   /* Green for success/results (unchanged) */
    --accent: #e74c3c;      /* Red for warnings/important (unchanged) */
    --light-bg: #f8f9fa;    /* Light gray background (unchanged) */
    --border-color: #dee2e6; /* Subtle border color (unchanged) */
    --text-primary: #2c3e50; /* Main text color (unchanged) */
    --text-secondary: #6c757d; /* Secondary text (unchanged) */
}

/* ===== LAYOUT CONTAINERS ===== */
.app-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== HEADER (Updated gradient) ===== */
.main-header {
    background: linear-gradient(135deg, #000000 0%, #333333 100%); /* Changed blue gradient to black */
    color: #ffffff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-section h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.global-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 120px;
}

.control-item label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-item select,
.control-item input {
    padding: 0.625rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.control-item select:focus,
.control-item input:focus {
    outline: none;
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3); /* Changed blue to black */
}

.control-item input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.control-item select option {
    background: #000000; /* Changed from #2c3e50 to black */
    color: #ffffff;
}

/* ===== NAVIGATION (Updated hover colors) ===== */
.main-nav {
    background: #ffffff;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 70px;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nav-container {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.nav-container::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    padding: 0.625rem 1.25rem;
    border: 2px solid var(--border-color);
    background: #ffffff;
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--primary); /* Now black instead of blue */
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Changed blue to black */
}

.nav-btn.active {
    background: var(--primary); /* Now black instead of blue */
    color: #ffffff;
    border-color: var(--primary);
}

/* ===== CALCULATOR CARDS (Updated accent) ===== */
.main-calculators {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.calculator-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary)); /* Primary is now black */
    transition: width 0.3s ease;
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary); /* Now black */
}

.calculator-card:hover::before {
    width: 8px;
}

.calculator-card h2 {
    color: var(--primary); /* Now black instead of blue */
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 1.25rem;
    font-weight: 700;
    position: relative;
}

.calculator-card h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--secondary); /* Green - unchanged */
}

.calculator-card input,
.calculator-card select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #ffffff;
    color: var(--text-primary);
}

.calculator-card input:focus,
.calculator-card select:focus {
    outline: none;
    border-color: var(--primary); /* Now black */
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1); /* Changed blue to black */
}

.calculator-card input::placeholder {
    color: #adb5bd;
}

/* ===== BUTTONS (Updated gradient) ===== */
.calculator-card button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); /* Now black gradient */
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Changed blue to black */
}

.calculator-card button:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #555555 100%); /* Darker black/gray */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); /* Changed blue to black */
}

.calculator-card button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Changed blue to black */
}

/* ===== RESULT BOXES (Unchanged - still green border) ===== */
.result-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.25rem;
    border-radius: 8px;
    margin-top: 1.25rem;
    border-left: 4px solid var(--secondary); /* Green - unchanged */
    display: none;
    animation: fadeIn 0.3s ease;
}

.result-box.active {
    display: block;
}

.result-box p {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.result-box span {
    font-weight: 700;
    color: var(--accent); /* Red - unchanged */
    font-size: 1.1rem;
}

.result-box h4 {
    color: var(--primary); /* Now black instead of blue */
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
}

.result-box ul {
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.result-box li {
    margin-bottom: 0.25rem;
}

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

/* ===== CALCULATOR SECTIONS ===== */
.calculator-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 2px solid var(--border-color);
    display: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.calculator-section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.calculator-section h2 {
    color: var(--primary); /* Now black instead of blue */
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
}

.calculator-section h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 3px;
    background: var(--secondary); /* Green - unchanged */
}

.calculator-section input,
.calculator-section select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.calculator-section input:focus,
.calculator-section select:focus {
    outline: none;
    border-color: var(--primary); /* Now black */
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1); /* Changed blue to black */
}

.calculator-section button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); /* Now black gradient */
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Changed blue to black */
}

.calculator-section button:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #555555 100%); /* Darker black/gray */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); /* Changed blue to black */
}

/* ===== TABLES (Updated header gradient) ===== */
.tax-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.tax-table th,
.tax-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.tax-table th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); /* Now black gradient */
    color: #ffffff;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tax-table tr:hover td {
    background-color: rgba(0, 0, 0, 0.05); /* Changed blue to black */
}

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

.tax-table .final-row {
    background: linear-gradient(135deg, #000000 0%, #333333 100%); /* Changed blue to black */
    color: #ffffff;
}

.tax-table .final-row td {
    font-weight: 700;
    font-size: 1.1rem;
}

/* ===== FOOTER (Updated gradient) ===== */
.main-footer {
    background: linear-gradient(135deg, #000000 0%, #333333 100%); /* Changed blue to black */
    color: #ffffff;
    padding: 1.5rem 0;
    margin-top: auto;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.main-footer p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

/* ===== FOCUS STATES (Updated) ===== */
button:focus,
input:focus,
select:focus {
    outline: 3px solid #000000; /* Changed from var(--accent) to black */
    outline-offset: 2px;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 1024px) {
    .main-calculators,
    .section-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.25rem;
    }
    
    .calculator-card,
    .calculator-section {
        padding: 1.25rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .global-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .control-item {
        flex: 1;
        min-width: auto;
    }
}

/* Mobile */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .app-container {
        padding: 0 15px;
    }
    
    .main-calculators,
    .section-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-nav {
        top: 130px;
    }
    
    .nav-container {
        padding: 0.5rem 0;
    }
    
    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    .calculator-card h2,
    .calculator-section h2 {
        font-size: 1.125rem;
    }
    
    .global-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .control-item {
        width: 100%;
    }
    
    .calculator-card button,
    .calculator-section button {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.75rem;
    }
    
    .tax-table th,
    .tax-table td {
        padding: 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .app-container {
        padding: 0 10px;
    }
    
    .logo-section h1 {
        font-size: 1.25rem;
    }
    
    .nav-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .calculator-card,
    .calculator-section {
        padding: 1rem;
    }
    
    .result-box {
        padding: 1rem;
    }
    
    .calculator-card::before {
        width: 4px;
    }
    
    .calculator-card:hover::before {
        width: 5px;
    }
}

/* Print Styles */
@media print {
    .main-header,
    .main-nav,
    .main-footer,
    button {
        display: none;
    }
    
    .calculator-card,
    .calculator-section {
        border: 1px solid #000;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .result-box {
        background: #fff;
        border: 1px solid #000;
    }
    
    .result-box span {
        color: #000 !important;
    }
}