/* ========================================
   PROPER MOBILE FIXES - Clean Approach
   ======================================== */

/* Prevent horizontal scroll - MOST IMPORTANT */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

/* Mobile Fixes - Tablets and Phones */
@media (max-width: 768px) {
    
    /* Remove the bad zoom hack */
    body {
        zoom: 1 !important;
        transform: none !important;
        -webkit-transform: none !important;
        -moz-transform: none !important;
    }
    
    /* Fix all containers */
    .container,
    section,
    .hero,
    .about,
    .subjects,
    .pricing,
    .contact,
    footer {
        max-width: 100% !important;
        overflow-x: hidden !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* HIDE the ethical discount banner on mobile */
    .ethical-banner {
        display: none !important;
    }
    
    /* Move header back to top since banner is hidden */
    header {
        top: 0 !important;
        padding: 10px 0 !important;
    }
    
    /* HAMBURGER MENU HEADER */
    header .container {
        display: grid !important;
        grid-template-columns: 50px 1fr auto !important;
        grid-template-rows: auto auto !important;
        gap: 0 !important;
        align-items: center !important;
        padding: 15px 20px !important;
        min-height: auto !important;
    }
    
    /* Hamburger button */
    .mobile-menu-toggle {
        grid-column: 1 !important;
        grid-row: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
        background: none !important;
        border: none !important;
        cursor: pointer !important;
        padding: 8px !important;
        z-index: 100 !important;
    }
    
    .mobile-menu-toggle span {
        display: block !important;
        width: 25px !important;
        height: 3px !important;
        background: #1f2937 !important;
        border-radius: 2px !important;
        transition: 0.3s !important;
    }
    
    /* Logo centered */
    .logo {
        grid-column: 2 !important;
        grid-row: 1 !important;
        text-align: center !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        font-size: 24px !important;
        width: auto !important;
        display: inline-block !important;
    }
    
    /* Auth buttons - ALWAYS visible */
    .auth-actions {
        grid-column: 3 !important;
        grid-row: 1 !important;
        display: flex !important;
        gap: 8px !important;
        margin: 0 !important;
        width: auto !important;
        z-index: 100 !important;
        pointer-events: auto !important;
    }
    
    .login-btn,
    .register-btn,
    .profile-btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
        cursor: pointer !important;
    }
    
    /* Navigation - hidden until clicked */
    nav {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.3s ease !important;
        background: #f8f9fa !important;
        border-radius: 8px !important;
        position: static !important;
        transform: none !important;
        width: 100% !important;
        display: block !important;
        flex-direction: column !important;
        z-index: 99 !important;
    }
    
    nav.active {
        max-height: 400px !important;
        margin-top: 15px !important;
        padding: 10px 0 !important;
    }
    
    nav a {
        display: block !important;
        padding: 12px 20px !important;
        border-bottom: 1px solid #e5e7eb !important;
        text-align: left !important;
        white-space: normal !important;
        font-size: 15px !important;
    }
    
    nav a:last-child {
        border-bottom: none !important;
    }
    
    /* ===== HERO SECTION ===== */
    .hero {
        min-height: 70vh !important;
        padding: 60px 0 40px 0 !important;
    }
    
    .hero h1 {
        font-size: 2rem !important;
        white-space: normal !important;
        line-height: 1.3 !important;
        text-align: center !important;
    }
    
    .hero-line {
        white-space: normal !important;
        display: block !important;
        margin-bottom: 0.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
        max-width: 100% !important;
        text-align: center !important;
    }
    
    .hero-buttons {
        flex-direction: column !important;
        width: 100% !important;
        gap: 12px !important;
        padding: 0 20px !important;
    }
    
    .hero-buttons .cta-button {
        width: 100% !important;
        max-width: 300px !important;
        margin: 0 auto !important;
    }
    
    /* Hide scroll cues on mobile */
    .scroll-cue,
    .scroll-cue-about {
        display: none !important;
    }
    
    /* Reduce math symbols size */
    .math-symbol {
        font-size: 1.8rem !important;
        opacity: 0.08 !important;
    }
    
    /* ===== ABOUT SECTION ===== */
    .about-content {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        padding: 40px 0 80px 0 !important;
    }
    
    .about {
        background: transparent !important;
    }
    
    .about-text {
        text-align: center !important;
        margin-bottom: 30px !important;
    }
    
    .about-text .subtitle,
    .about-text .subtitle h3,
    .about-text .subtitle span,
    .about-text p {
        text-align: center !important;
    }
    
    .about-text .subtitle h3 {
        font-size: 2.2rem !important;
    }
    
    .about-points {
        align-items: center !important;
    }
    
    .point {
        justify-content: center !important;
    }
    
    /* FIX LUKAS PHOTO - Make it visible */
    .about-image {
        width: 100% !important;
        max-width: 320px !important;
        height: auto !important;
        margin: 30px auto !important;
        padding: 0 !important;
    }
    
    .photo-container {
        width: 100% !important;
        max-width: 320px !important;
        height: 420px !important;
        margin: 0 auto !important;
        padding: 12px !important;
        border-radius: 12px !important;
        aspect-ratio: auto !important;
    }
    
    .photo-inner {
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
        border-radius: 8px !important;
    }
    
    .tutor-photo {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center 30% !important;
        display: block !important;
        aspect-ratio: auto !important;
    }
    
    /* ===== SUBJECTS SECTION ===== */
    .subjects h2,
    .pricing h2,
    .contact h2,
    section h2 {
        text-align: center !important;
    }
    
    .layout-option-2 .section-header-scroll {
        flex-direction: column !important;
        gap: 20px !important;
        align-items: center !important;
    }
    
    .layout-option-2 .header-content {
        width: 100% !important;
        text-align: center !important;
    }
    
    .layout-option-2 .header-content h2 {
        font-size: 1.8rem !important;
        text-align: center !important;
        margin: 0 auto !important;
    }
    
    .layout-option-2 .section-subtitle {
        text-align: center !important;
    }
    
    .level-selector {
        width: 100% !important;
        max-width: 300px !important;
    }
    
    .level-btn {
        flex: 1 !important;
        font-size: 14px !important;
        padding: 10px 12px !important;
    }
    
    .category-header {
        flex-direction: column !important;
        text-align: center !important;
        gap: 15px !important;
    }
    
    .category-icon {
        width: 50px !important;
        height: 50px !important;
        margin: 0 auto !important;
    }
    
    .category-info h3 {
        text-align: center !important;
    }
    
    .subject-card-scroll {
        min-width: 240px !important;
        max-width: 240px !important;
    }
    
    /* ===== PRICING SECTION ===== */
    .pricing h2 {
        font-size: 2rem !important;
    }
    
    .pricing-cards,
    .discounted-cards {
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .price-card {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* ===== CONTACT SECTION ===== */
    .contact-options {
        grid-template-columns: 1fr !important;
    }
    
    /* ===== FOOTER ===== */
    .footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center !important;
    }
    
    .footer-heading::after {
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    .footer-brand {
        text-align: center !important;
    }
    
    .footer-brand h3 {
        text-align: center !important;
        margin: 0 auto !important;
    }
    
    .footer-section,
    .footer-links {
        text-align: center !important;
    }
    
    .footer-contact {
        text-align: center !important;
        margin: 0 auto !important;
    }
    
    .footer-social {
        justify-content: center !important;
        margin: 0 auto !important;
    }
    
    /* ===== SIGN IN/SIGN UP MODAL FIXES ===== */

    /* Fix modal overlay - highest priority */
    #auth-modal.auth-overlay {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 99999 !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 10px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    #auth-modal.auth-overlay.active {
        display: flex !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Fix modal card */
    #auth-modal .auth-card.auth-card--minimal {
        width: 95% !important;
        max-width: 400px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin: auto !important;
        transform: scale(1) !important;
        position: relative !important;
        padding: 22px !important;
        box-sizing: border-box !important;
    }

    /* Extend dark header background FULLY across the card */
    #auth-modal .auth-header-integrated {
        margin: -22px -22px 32px -22px !important;
        padding: 55px 20px 24px !important;
        border-radius: 12px 12px 0 0 !important;
        position: relative !important;
        width: calc(100% + 44px) !important;
        box-sizing: border-box !important;
    }

    /* Position X button INSIDE the dark header area */
    #auth-modal .auth-close {
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 20 !important;
        touch-action: manipulation !important;
        color: rgba(255, 255, 255, 0.95) !important;
        background: rgba(255, 255, 255, 0.15) !important;
        border: none !important;
        border-radius: 8px !important;
        font-size: 18px !important;
        padding: 0 !important;
        cursor: pointer !important;
    }

    #auth-modal .auth-close:active {
        background: rgba(255, 255, 255, 0.25) !important;
        transform: scale(0.95) !important;
    }

    /* Center the auth content */
    #auth-modal .auth-brand-section {
        text-align: center !important;
    }

    #auth-modal .auth-logo {
        text-align: center !important;
        margin: 0 auto !important;
    }

    #auth-modal #auth-title {
        text-align: center !important;
        margin: 0 auto !important;
    }

    /* Prevent zoom on input focus (iOS) */
    #auth-modal input,
    #auth-modal select,
    #auth-modal textarea {
        font-size: 16px !important;
        -webkit-appearance: none !important;
    }

    /* Prevent body scroll when modal is open */
    body.modal-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }

    /* Extra Small Phones */
    @media (max-width: 375px) {
        .hero h1 {
            font-size: 1.75rem !important;
        }
        
        .subject-card-scroll {
            min-width: 220px !important;
            max-width: 220px !important;
        }
        
        .photo-container {
            max-width: 260px !important;
            height: 360px !important;
        }
        
        .header-content h2 {
            font-size: 1.6rem !important;
        }
    }
}
