/* ===========================
   RESPONSIVE STYLES
=========================== */

/* Tablet Devices (768px and below) */
@media (max-width: 768px) {
    /* Typography Adjustments */
    :root {
        --font-size-3xl: 32px;
        --font-size-2xl: 26px;
        --font-size-xl: 20px;
        --section-padding: 60px 0;
        --card-padding: 20px;
    }

    /* Navigation */
    .navbar {
        padding: 15px 20px;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-primary);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: 0 10px 27px var(--shadow-lg);
        padding: 20px 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        padding: 15px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .mobile-toggle {
        display: flex;
    }

    /* Hero Section */
    .hero {
        padding: 80px 0 60px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    /* Calculator Tabs */
    .calculator-tabs {
        gap: 10px;
    }

    .tab-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* Calculator Cards */
    .calculator-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Calculator Modal */
    .calculator-modal {
        padding: 10px;
    }

    .modal-body {
        padding: 20px;
    }

    .calculator-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .calculator-inputs,
    .calculator-results {
        padding: 20px;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .chart-wrapper {
        height: 250px;
    }

    /* Insights Section */
    .insights-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cta-section {
        padding: 40px 20px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Back to Top */
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 18px;
    }

    /* Data Table */
    .data-table-container {
        overflow-x: auto;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
        white-space: nowrap;
    }

    /* Action Buttons */
    .action-buttons {
        flex-direction: column;
    }

    /* Radio Group */
    .radio-group {
        flex-direction: column;
    }

    .radio-option {
        width: 100%;
    }
}

/* Mobile Devices (480px and below) */
@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 15px;
    }

    /* Typography */
    :root {
        --font-size-3xl: 26px;
        --font-size-2xl: 22px;
        --font-size-xl: 18px;
        --font-size-lg: 16px;
        --font-size-base: 14px;
        --section-padding: 40px 0;
        --card-padding: 15px;
    }

    /* Header */
    .nav-brand {
        font-size: 20px;
    }

    .nav-brand i {
        font-size: 22px;
    }

    .theme-toggle,
    .mobile-toggle {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Breadcrumb */
    .breadcrumb {
        padding: 10px 15px;
        font-size: 12px;
    }

    /* Hero */
    .hero {
        padding: 60px 0 40px;
    }

    .hero-title {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .hero-subtitle {
        font-size: 14px;
        margin-bottom: 30px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    /* Section Titles */
    .section-title {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .section-subtitle {
        font-size: 14px;
        margin-bottom: 30px;
    }

    /* Calculator Tabs */
    .calculator-tabs {
        flex-direction: column;
        width: 100%;
    }

    .tab-btn {
        width: 100%;
        justify-content: center;
    }

    /* Calculator Cards */
    .calc-card {
        padding: 20px;
    }

    .card-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
        margin-bottom: 15px;
    }

    .calc-card h3 {
        font-size: 18px;
    }

    .calc-card p {
        font-size: 14px;
    }

    /* Calculator Modal */
    .modal-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .modal-body {
        padding: 15px;
    }

    .calculator-header h2 {
        font-size: 22px;
    }

    .calculator-header p {
        font-size: 14px;
    }

    .calculator-inputs h3,
    .calculator-results h3 {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input,
    .form-group select {
        padding: 10px 14px;
        font-size: 14px;
    }

    .calculate-btn {
        padding: 12px;
        font-size: 14px;
    }

    .result-card .result-value {
        font-size: 26px;
    }

    .result-item .value {
        font-size: 18px;
    }

    .chart-wrapper {
        height: 220px;
    }

    /* Insights */
    .insight-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .insight-card {
        padding: 20px;
    }

    .insight-card h3 {
        font-size: 18px;
    }

    .insight-card p {
        font-size: 14px;
    }

    .cta-section {
        padding: 30px 15px;
    }

    .cta-section h3 {
        font-size: 22px;
    }

    .cta-section p {
        font-size: 14px;
    }

    /* Footer */
    .footer {
        padding: 40px 0 0;
    }

    .footer-content {
        gap: 25px;
    }

    .footer-brand {
        font-size: 20px;
    }

    .footer-brand i {
        font-size: 24px;
    }

    .footer-col h4 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .footer-links li {
        margin-bottom: 10px;
        font-size: 14px;
    }

    .footer-desc {
        font-size: 14px;
    }

    .social-links a {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .footer-bottom {
        padding: 20px 0;
        font-size: 12px;
    }

    /* Back to Top */
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
        font-size: 16px;
    }
}

/* Large Desktop (1400px and above) */
@media (min-width: 1400px) {
    :root {
        --container-width: 1320px;
    }

    .calculator-cards {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }

    .insights-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Print Styles */
@media print {
    .header,
    .breadcrumb,
    .hero,
    .footer,
    .back-to-top,
    .mobile-toggle,
    .theme-toggle,
    .modal-close,
    .action-buttons,
    .calculate-btn {
        display: none !important;
    }

    .calculator-modal {
        position: static;
        background: none;
    }

    .modal-content {
        box-shadow: none;
        max-height: none;
    }

    .calculator-container {
        grid-template-columns: 1fr;
    }

    body {
        background: white;
        color: black;
    }

    .chart-wrapper {
        page-break-inside: avoid;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
    }

    [data-theme="dark"] {
        --border-color: #fff;
    }

    .calc-card,
    .insight-card,
    .calculator-inputs,
    .calculator-results {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Dark Mode Specific Adjustments */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --bg-primary: #1a1d23;
        --bg-secondary: #252932;
        --bg-tertiary: #2f3542;
        --text-primary: #f8f9fa;
        --text-secondary: #adb5bd;
        --text-tertiary: #6c757d;
        --border-color: #404654;
        --shadow: rgba(0, 0, 0, 0.3);
        --shadow-lg: rgba(0, 0, 0, 0.5);
    }
}

/* Landscape Orientation for Small Devices */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 40px 0 30px;
    }

    .hero-title {
        font-size: 24px;
    }

    .calculator-modal {
        padding: 5px;
    }

    .modal-content {
        max-height: 95vh;
    }

    .chart-wrapper {
        height: 200px;
    }
}
