/*
 * Responsive CSS - Mobile & Tablet Optimization
 * Tax NetworthFD Theme
 * Comprehensive responsive styles for all screen sizes
 */

/* ============================================
   RESPONSIVE BREAKPOINTS
   - Mobile: < 768px
   - Tablet: 768px - 1024px
   - Desktop: > 1024px
   ============================================ */

/* ============================================
   LARGE DESKTOP (1400px+)
   ============================================ */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* ============================================
   TABLET & SMALL DESKTOP (768px - 1024px)
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --spacing-3xl: 3rem;
        --spacing-2xl: 2.5rem;
        --spacing-xl: 1.75rem;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Hero Section */
    .hero-section-3d {
        min-height: 80vh;
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .hero-content-3d {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .hero-title-3d {
        font-size: 3rem;
    }
    
    .hero-description-3d {
        font-size: 1.125rem;
    }
    
    .hero-stats {
        gap: var(--spacing-xl);
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    /* Calculator Grid */
    .calculator-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Trending Grid */
    .trending-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Guides Grid */
    .guides-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   TABLET PORTRAIT (768px - 991px)
   ============================================ */
@media (min-width: 768px) and (max-width: 991px) {
    .calculator-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .trending-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .hero-actions-3d {
        flex-wrap: wrap;
    }
}

/* ============================================
   MOBILE & SMALL TABLET (< 768px)
   ============================================ */
@media (max-width: 768px) {
    /* Root Variables */
    :root {
        --spacing-3xl: 2rem;
        --spacing-2xl: 1.5rem;
        --spacing-xl: 1.25rem;
        --header-height: 60px;
    }
    
    html {
        font-size: 15px;
    }
    
    body {
        padding-top: var(--header-height);
    }
    
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.125rem; }
    h6 { font-size: 1rem; }
    
    /* Container */
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Header */
    .header-container {
        height: 60px;
        padding: 0 var(--spacing-md);
    }
    
    .site-title {
        font-size: 1.25rem;
    }
    
    /* Hero Section */
    .hero-section-3d {
        min-height: auto;
        padding: var(--spacing-2xl) var(--spacing-md);
    }
    
    .hero-content-3d {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        padding: 0;
    }
    
    .hero-main-content {
        padding: 0;
    }
    
    .hero-badge {
        padding: var(--spacing-xs) var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }
    
    .badge-text {
        font-size: 0.8rem;
    }
    
    .hero-title-3d {
        font-size: 2rem;
        margin-bottom: var(--spacing-lg);
    }
    
    .hero-description-3d {
        font-size: 1rem;
        margin-bottom: var(--spacing-lg);
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }
    
    .stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: var(--spacing-md);
        background: rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-md);
    }
    
    .stat-number {
        font-size: 1.5rem;
        margin-bottom: 0;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    .hero-actions-3d {
        flex-direction: column;
        gap: var(--spacing-sm);
        width: 100%;
    }
    
    .hero-btn-primary, .hero-btn-secondary {
        width: 100%;
        justify-content: center;
        padding: var(--spacing-md);
        font-size: 0.95rem;
    }
    
    .hero-visual {
        display: none;
    }
    
    /* Calculator Grid */
    .calculator-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .calculator-card {
        padding: var(--spacing-lg);
    }
    
    .calculator-icon {
        font-size: 2.5rem;
    }
    
    .calculator-card h3 {
        font-size: 1.25rem;
    }
    
    .calculator-card p {
        font-size: 0.9rem;
    }
    
    /* Trending Section */
    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .trending-card {
        padding: var(--spacing-md);
    }
    
    .trending-card h4 {
        font-size: 0.9rem;
    }
    
    /* Guides Grid */
    .guides-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .guide-card {
        padding: var(--spacing-lg);
    }
    
    .guide-icon {
        font-size: 2rem;
    }
    
    /* Expertise Section */
    .expertise-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* FAQ Section */
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .faq-item {
        padding: var(--spacing-md);
    }
    
    .faq-question {
        font-size: 1rem;
        padding: var(--spacing-md);
    }
    
    .faq-answer {
        font-size: 0.9rem;
        padding: var(--spacing-md);
    }
    
    /* Section Headers */
    .section-header {
        margin-bottom: var(--spacing-xl);
    }
    
    .section-title {
        font-size: 1.75rem;
        margin-bottom: var(--spacing-md);
    }
    
    .section-description {
        font-size: 0.95rem;
    }
    
    /* Error 404 Page */
    .error-404-page {
        min-height: 60vh;
        padding: var(--spacing-xl) 0;
    }
    
    .error-number {
        font-size: 5rem;
    }
    
    .error-emoji {
        font-size: 2rem;
        right: 0;
    }
    
    .error-title {
        font-size: 1.75rem;
    }
    
    .error-description {
        font-size: 1rem;
    }
    
    .error-404-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
        padding: var(--spacing-md);
    }
    
    .error-404-suggestions {
        padding: var(--spacing-lg);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }
    
    .footer-column {
        text-align: center;
    }
    
    .footer-minimal-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .footer-links-minimal {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    /* Calculator Pages */
    .calc-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .calculator-main-full {
        padding: var(--spacing-md);
    }
    
    .calculator-sidebar {
        padding: var(--spacing-md);
    }
    
    .calc-form-group {
        margin-bottom: var(--spacing-md);
    }
    
    .calc-input {
        font-size: 1rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .calc-btn {
        width: 100%;
        padding: var(--spacing-md);
        font-size: 1rem;
    }
    
    .results-card {
        padding: var(--spacing-lg);
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    /* FAQs Page */
    .faqs-header {
        padding: var(--spacing-lg);
    }
    
    .faqs-title {
        font-size: 1.75rem;
    }
    
    .faqs-subtitle {
        font-size: 1rem;
    }
    
    .faq-category {
        padding: var(--spacing-lg);
        margin-bottom: var(--spacing-xl);
    }
    
    .category-title {
        font-size: 1.5rem;
    }
    
    /* Contact Page */
    .contact-form {
        padding: var(--spacing-lg);
    }
    
    .form-group {
        margin-bottom: var(--spacing-lg);
    }
    
    /* About Page */
    .about-content {
        padding: var(--spacing-md);
    }
    
    /* Breadcrumbs */
    .breadcrumbs {
        font-size: 0.8rem;
        padding: var(--spacing-sm) 0;
    }
    
    .breadcrumbs ol {
        gap: var(--spacing-xs);
    }
}

/* ============================================
   MOBILE SMALL (< 480px)
   ============================================ */
@media (max-width: 480px) {
    :root {
        --spacing-3xl: 1.5rem;
        --spacing-2xl: 1.25rem;
        --spacing-xl: 1rem;
    }
    
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-section-3d {
        padding: var(--spacing-xl) var(--spacing-sm);
    }
    
    .hero-title-3d {
        font-size: 1.75rem;
    }
    
    .hero-description-3d {
        font-size: 0.95rem;
    }
    
    .calculator-card {
        padding: var(--spacing-md);
    }
    
    .calculator-icon {
        font-size: 2rem;
    }
    
    .calculator-card h3 {
        font-size: 1.125rem;
    }
    
    .trending-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .trending-card {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .error-number {
        font-size: 4rem;
    }
    
    .error-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .calculator-main-full {
        padding: var(--spacing-sm);
    }
    
    .results-card {
        padding: var(--spacing-md);
    }
    
    .result-value {
        font-size: 1.75rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
}

/* ============================================
   MOBILE LANDSCAPE (< 768px height)
   ============================================ */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section-3d {
        min-height: auto;
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .hero-stats {
        display: none;
    }
    
    .hero-visual {
        display: none;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-header,
    .mobile-menu-toggle,
    .footer-section,
    .hero-background,
    .floating-emoji,
    .breadcrumbs,
    .calculator-sidebar {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    .calculator-main-full,
    .results-card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0052A3;
        --text-primary: #000000;
        --text-secondary: #222222;
        --border-color: #000000;
    }
    
    .calculator-card,
    .trending-card,
    .guide-card {
        border: 2px solid var(--border-color);
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-emoji,
    .shape {
        animation: none !important;
    }
}

/* ============================================
   TOUCH DEVICES - BETTER TAP TARGETS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .nav-menu a,
    .calculator-card,
    .trending-card,
    .guide-card,
    .quick-link-card,
    .btn-primary,
    .btn-secondary,
    .faq-question {
        min-height: 44px;
        min-width: 44px;
    }
    
    .calculator-card:hover,
    .trending-card:hover,
    .guide-card:hover {
        transform: none;
    }
    
    .calculator-card:active,
    .trending-card:active,
    .guide-card:active {
        transform: scale(0.98);
    }
}
