/* ==================================================
   Responsive Design & Mobile Optimization
   ================================================== */

/* Hero Section - Mobile First - CRITICAL FIXES */
.hero {
    background: var(--bg-white);
    padding: 2.5rem 0 2rem; /* FIXED: Reduced excessive mobile padding */
    position: relative;
    overflow: hidden;
    min-height: auto; /* Remove min-height constraints on mobile */
}


.hero-container {
    display: flex;
    flex-direction: column; /* Mobile first - stack vertically */
    gap: 3rem;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 2.4rem;
    color: var(--gray-800);
    margin-bottom: 1.2rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    animation: titleSlideIn 1.2s ease-out;
}

.hero-title .highlight {
    color: var(--primary-green);
    font-weight: 800;
}

.hero-description {
    font-size: 1.3rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    line-height: 1.6;
    font-weight: 400;
    animation: descriptionFadeIn 1.2s ease-out 0.3s both;
    max-width: 100%; /* FIXED: Full width for better readability */
    padding: 0 0.5rem; /* Add minimal side padding */
}

.hero-buttons {
    display: flex;
    flex-direction: column; /* Mobile first - stack buttons */
    gap: 1.5rem;
    animation: buttonsFadeIn 1.2s ease-out 0.6s both;
    width: 100%;
    max-width: 300px;
}

.hero-image {
    position: relative;
    animation: imageSlideIn 1.2s ease-out 0.9s both;
    max-width: 100%;
}

.hero-image svg,
.hero-image img {
    width: 100%;
    height: auto;
    max-width: 300px; /* Much smaller on mobile */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: block;
}

/* Tablet Portrait (481px+) */
@media (min-width: 481px) {
    .hero {
        padding: 7rem 0 5rem;
    }
    
    .hero-container {
        gap: 4rem;
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
    
    .hero-description {
        font-size: 1.5rem;
        max-width: 90%;
    }
    
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
        max-width: none;
    }
    
    .hero-image svg,
    .hero-image img {
        max-width: 350px;
    }
}

/* Tablet Landscape (768px+) */
@media (min-width: 768px) {
    .hero {
        padding: 9rem 0 6rem;
    }
    
    .hero-container {
        gap: 5rem;
    }
    
    .hero-title {
        font-size: 3.8rem;
    }
    
    .hero-description {
        font-size: 1.6rem;
        margin-bottom: 3rem;
        max-width: 85%;
    }
    
    .hero-image svg,
    .hero-image img {
        max-width: 400px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .hero {
        padding: 11rem 0 8rem;
    }
    
    .hero-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6rem;
        text-align: left;
        justify-items: start;
        align-items: center;
    }
    
    .hero-title {
        font-size: 4.2rem;
        margin-left: 2rem;
    }
    
    .hero-description {
        font-size: 1.7rem;
        margin-bottom: 3.5rem;
        max-width: 100%;
        margin-left: 2rem;
    }
    
    .hero-buttons {
        justify-content: flex-start;
        max-width: none;
        margin-left: 2rem;
    }
    
    .hero-image svg,
    .hero-image img {
        max-width: 500px;
    }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .hero {
        padding: 12rem 0 8rem;
    }
    
    .hero-container {
        gap: 7rem;
    }
    
    .hero-title {
        font-size: 4.8rem;
        margin-left: 3rem;
    }
    
    .hero-description {
        font-size: 1.8rem;
        margin-left: 3rem;
    }
    
    .hero-buttons {
        margin-left: 3rem;
    }
}

/* Section Spacing - Mobile First */
section {
    padding: 5rem 0; /* Much tighter on mobile */
}

@media (min-width: 481px) {
    section {
        padding: 6rem 0;
    }
}

@media (min-width: 768px) {
    section {
        padding: 7rem 0;
    }
}

@media (min-width: 1024px) {
    section {
        padding: 8rem 0;
    }
}

@media (min-width: 1440px) {
    section {
        padding: 10rem 0;
    }
}

/* Features Grid - Mobile First */
.features-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: 1 column */
    gap: 2rem;
    justify-items: center;
    align-items: start;
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr); /* Keep 2 columns for better readability */
        gap: 4rem;
    }
}

@media (min-width: 1440px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 3rem;
    }
}

/* Quick Access Grid */
.quick-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .quick-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
}

.quick-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: white;
    border: 2px solid #f3f4f6;
    border-radius: 16px;
    padding: 2rem;
    text-decoration: none;
    color: #374151;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quick-card:hover {
    border-color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.2);
}

.quick-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quick-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.quick-icon.ranking {
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
}

.quick-icon.comparison {
    background: linear-gradient(135deg, #dcfce7 0%, #10b981 100%);
}

.quick-icon.guide {
    background: linear-gradient(135deg, #dbeafe 0%, #3b82f6 100%);
}

.quick-text {
    flex: 1;
}

.quick-text h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.quick-text p {
    font-size: 1.3rem;
    color: #6b7280;
    margin: 0;
}

.quick-arrow {
    font-size: 1.8rem;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.quick-card:hover .quick-arrow {
    color: #10b981;
    transform: translateX(4px);
}

@media (max-width: 767px) {
    .quick-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 2.5rem 2rem;
    }
    
    .quick-text h3 {
        font-size: 1.8rem;
    }
    
    .quick-text p {
        font-size: 1.4rem;
    }
    
    .quick-arrow {
        display: none;
    }
}
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-normal);
}

.quick-access-card h3 {
    color: var(--gray-800);
    margin-bottom: var(--space-sm);
    font-size: 1.8rem;
}

.quick-access-card p {
    color: var(--gray-600);
    margin: 0;
    font-size: 1.4rem;
}

/* Mobile-First Image Optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

picture {
    display: block;
    width: 100%;
}

picture img {
    width: 100%;
    height: auto;
}

/* Image loading states */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity var(--transition-normal);
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Optimize images for different screen densities */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image img,
    .hero-image svg {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Animation keyframes */
@keyframes titleSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        background-color: var(--primary-green-darker);
        border: 2px solid var(--primary-green-darker);
        color: #ffffff;
    }
    
    .btn-secondary {
        background-color: #ffffff;
        color: var(--primary-green-darker);
        border: 2px solid var(--primary-green-darker);
    }
    
    a {
        color: var(--primary-green-darker);
        font-weight: 600;
    }
    
    .hero-title, .section-title {
        color: var(--primary-green-darker) !important;
        -webkit-text-fill-color: var(--primary-green-darker) !important;
    }
}

/* Print styles */
@media print {
    .header,
    .mobile-menu-btn,
    .mobile-nav,
    .hero-buttons,
    .btn {
        display: none;
    }
    
    .hero {
        background: none;
        padding: 2rem 0;
    }
    
    .section-title {
        color: #000;
    }
    
    * {
        background: none !important;
        color: #000 !important;
        box-shadow: none !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for mobile */
    .btn {
        min-height: 48px;
        padding: 1.4rem 3rem;
    }
    
    .nav-link,
    .mobile-nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Remove hover effects that don't work on touch */
    .btn:hover,
    .card:hover,
    .feature-card:hover {
        transform: none;
    }
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles would go here if needed */
}

/* Landscape phone optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 3rem 0 2rem;
    }
    
    .hero-title {
        font-size: 2.8rem;
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
    
    section {
        padding: 3rem 0;
    }
}