/* SmartCalcs - Mobile Readability & Contrast Fix */

/* HIGH CONTRAST TEXT IMPROVEMENTS */
:root {
    /* Enhanced color variables for better mobile readability */
    --text-primary: #1a202c;      /* Darker primary text */
    --text-secondary: #2d3748;    /* Darker secondary text */
    --text-muted: #4a5568;        /* Less muted, more readable */
    --text-light: #718096;        /* Darker light text */
    
    /* Button colors with better contrast */
    --btn-primary: #ff6b35;       /* Stronger orange */
    --btn-primary-hover: #e55a2b; /* Darker on hover */
    --btn-secondary: #2b6cb0;     /* Stronger blue */
    --btn-success: #38a169;       /* Stronger green */
    
    /* Background improvements */
    --bg-card: #ffffff;
    --bg-light: #f7fafc;
    --border-strong: #e2e8f0;
}

/* UNIVERSAL TEXT CONTRAST FIXES */
body {
    color: var(--text-primary) !important;
    font-weight: 500 !important; /* Slightly bolder base text */
}

p, div, span, li {
    color: var(--text-primary) !important;
    font-weight: 500 !important;
}

/* HEADING IMPROVEMENTS */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
    letter-spacing: -0.025em;
}

h1 { font-size: 2rem !important; font-weight: 800 !important; }
h2 { font-size: 1.75rem !important; font-weight: 700 !important; }
h3 { font-size: 1.5rem !important; font-weight: 700 !important; }
h4 { font-size: 1.25rem !important; font-weight: 600 !important; }

/* MOBILE TYPOGRAPHY ENHANCEMENTS */
@media (max-width: 768px) {
    body {
        font-size: 16px !important;
        line-height: 1.6 !important;
        font-weight: 500 !important;
    }
    
    p {
        font-size: 16px !important;
        line-height: 1.6 !important;
        font-weight: 500 !important;
        color: var(--text-primary) !important;
        margin-bottom: 1rem !important;
    }
    
    /* Stronger headings on mobile */
    h1 {
        font-size: 1.875rem !important; /* 30px */
        font-weight: 800 !important;
        line-height: 1.2 !important;
        color: var(--text-primary) !important;
    }
    
    h2 {
        font-size: 1.625rem !important; /* 26px */
        font-weight: 700 !important;
        line-height: 1.3 !important;
        color: var(--text-primary) !important;
    }
    
    h3 {
        font-size: 1.375rem !important; /* 22px */
        font-weight: 700 !important;
        line-height: 1.3 !important;
        color: var(--text-primary) !important;
    }
}

/* BUTTON VISIBILITY FIXES */
.btn, button, .tool-btn, .action-btn, .calculator-btn {
    font-weight: 600 !important;
    font-size: 16px !important;
    padding: 14px 24px !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
    letter-spacing: 0.025em !important;
    min-height: 48px !important; /* Touch friendly */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Primary buttons - stronger orange */
.btn-primary, .tool-btn, .calculator-btn {
    background: var(--btn-primary) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(255, 107, 53, 0.3) !important;
}

.btn-primary:hover, .tool-btn:hover, .calculator-btn:hover {
    background: var(--btn-primary-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4) !important;
}

/* Secondary buttons */
.btn-secondary {
    background: var(--btn-secondary) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(43, 108, 176, 0.3) !important;
}

.btn-secondary:hover {
    background: #2c5282 !important;
    transform: translateY(-2px) !important;
}

/* CARD AND CONTAINER IMPROVEMENTS */
.card, .tool-card, .calculator-section, .form-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: 16px !important;
    padding: 24px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}

/* FORM ELEMENT FIXES */
input, select, textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    background: white !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    min-height: 48px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--btn-primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1) !important;
    outline: none !important;
}

/* LABEL IMPROVEMENTS */
label {
    font-weight: 600 !important;
    font-size: 14px !important;
    color: var(--text-primary) !important;
    margin-bottom: 8px !important;
    display: block !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* LIST IMPROVEMENTS */
ul, ol {
    padding-left: 1.5rem !important;
}

li {
    margin-bottom: 0.5rem !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
}

/* NAVIGATION IMPROVEMENTS */
.nav-link {
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    font-size: 16px !important;
}

.nav-link:hover {
    color: var(--btn-primary) !important;
}

/* MOBILE NAVIGATION FIXES */
@media (max-width: 768px) {
    .nav-links {
        background: white !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
    }
    
    .nav-link {
        padding: 16px 24px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid #f7fafc !important;
    }
    
    .nav-link:hover {
        background: rgba(255, 107, 53, 0.1) !important;
        color: var(--btn-primary) !important;
    }
}

/* TABLE IMPROVEMENTS */
table {
    width: 100% !important;
    font-size: 16px !important;
}

th {
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    background: var(--bg-light) !important;
    padding: 12px !important;
}

td {
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    padding: 12px !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

/* CALCULATOR SPECIFIC FIXES */
.calculator-input {
    font-size: 18px !important;
    font-weight: 600 !important;
    text-align: center !important;
    color: var(--text-primary) !important;
}

.calculator-result {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: var(--btn-primary) !important;
}

.calculator-label {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    margin-bottom: 8px !important;
}

/* MOBILE SPECIFIC OVERRIDES */
@media (max-width: 480px) {
    .container, .calculator-container {
        padding: 16px !important;
    }
    
    .card, .tool-card {
        padding: 20px !important;
        margin-bottom: 16px !important;
    }
    
    .btn, button {
        width: 100% !important;
        margin-bottom: 12px !important;
        font-size: 16px !important;
        padding: 16px !important;
    }
}

/* ACCESSIBILITY IMPROVEMENTS */
*:focus {
    outline: 2px solid var(--btn-primary) !important;
    outline-offset: 2px !important;
}

/* HIGH DPI DISPLAY OPTIMIZATION */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
}

/* PRINT OPTIMIZATION */
@media print {
    body {
        color: black !important;
        font-size: 12pt !important;
    }
    
    .btn, button {
        border: 1px solid black !important;
        background: white !important;
        color: black !important;
    }
}