/* ==========================================================================
   HomeFax Mobile Styles
   ========================================================================== */

@media (max-width: 768px) {
    
    /* ==========================================================================
       Typography
       ========================================================================== */
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    /* ==========================================================================
       Layout
       ========================================================================== */
    
    .container {
        padding: 0 1rem;
    }
    
    /* ==========================================================================
       Header & Navigation
       ========================================================================== */
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 2rem 1rem;
        gap: 1.5rem;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        font-size: 1.125rem;
        width: 100%;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-light);
    }
    
    .nav-link::after {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .nav-actions .btn {
        display: none;
    }
    
    .nav-menu-actions {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        margin-top: 1rem;
        padding-top: 1.5rem;
        border-top: 1px solid var(--border-light);
    }
    
    .nav-menu-actions .btn {
        width: 100%;
        text-align: center;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
    }
    
    /* ==========================================================================
       Hero Section
       ========================================================================== */
    
    .hero {
        padding: 6rem 0 4rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1.125rem;
        margin-bottom: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Hero Gnome Styles - Overridden by main.css responsive rules */
    /* These rules are kept for fallback compatibility only */
    
    .hero-gnome {
        padding: 0.5rem 0 0;
        overflow: hidden; /* Prevent button overflow from affecting layout */
        width: 100%;
        max-width: 100vw;
    }
    
    .hero-gnome-content {
        gap: 0.75rem;
        padding-top: 0.25rem;
        overflow: visible;
        max-width: 90%;
        margin: 0 auto;
        position: relative;
        z-index: 2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 0.75rem;
        max-width: 100%;
    }
    
    .service-buttons-container {
        margin-bottom: 2rem;
        overflow: visible; /* Allow tooltips and button effects to show */
        width: 100vw;
        position: relative;
        left: 1rem;
    }
    
    /* Add scroll indicator */
    .service-buttons-container::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 0;
        transform: translateY(-50%);
        width: 30px;
        height: 100%;
        background: linear-gradient(to left, rgba(255,255,255,0.8) 0%, transparent 100%);
        pointer-events: none;
        z-index: 5;
    }
    
    .service-buttons-grid {
        display: flex;
        overflow-x: auto;
        overflow-y: visible; /* Allow tooltips to show above */
        scroll-behavior: smooth;
        gap: 0.75rem;
        padding: 1rem 1rem 1rem 1rem; /* Reduced left padding for proper alignment */
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .service-buttons-grid::-webkit-scrollbar {
        display: none;
    }
    
    .service-button {
        /* Complete mobile button styling for smaller screens */
        background: linear-gradient(135deg, #372153 0%, #3b246c 50%, #613877 100%);
        border: none;
        color: white;
        text-decoration: none;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 10px 30px rgba(107, 70, 193, 0.3);
        
        /* Square dimensions for smaller screens */
        flex: 0 0 120px; /* Fixed width for smaller screens */
        min-width: 120px;
        width: 120px;
        height: 120px; /* Fixed height to make perfect squares */
        padding: 0.75rem;
        border-radius: 12px;
        
        /* Layout */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        position: relative; /* For tooltip positioning */
        
        /* Animation */
        animation: mobileButtonBounce 2s ease-in-out 1s;
        scroll-snap-align: start;
    }
    
    /* Remove last button margin since we have proper container padding */
    .service-button:last-child {
        margin-right: 0;
    }
    
    /* Add subtle scale effect for better visual feedback */
    .service-button:active {
        transform: scale(0.98);
    }
    
    /* Ensure tooltips display properly on mobile */
    .service-tooltip {
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 0.5rem;
        z-index: 10;
        white-space: nowrap;
        pointer-events: none;
    }
    
    /* ==========================================================================
       Sections
       ========================================================================== */
    
    .section {
        padding: 4rem 0;
    }
    
    .section-header {
        margin-bottom: 3rem;
    }
    
    /* ==========================================================================
       Features Grid
       ========================================================================== */
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
    }
    
    .feature-card {
        padding: 1.5rem;
        margin: 0;
        width: 100%;
    }
    
    .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .feature-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .feature-description {
        font-size: 0.9375rem;
        line-height: 1.5;
    }
    
    /* ==========================================================================
       Stats Section
       ========================================================================== */
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-label {
        font-size: 1rem;
    }
    
    /* ==========================================================================
       Buttons
       ========================================================================== */
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-large {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    /* ==========================================================================
       Forms
       ========================================================================== */
    
    .form-input {
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* ==========================================================================
       Footer
       ========================================================================== */
    
    .footer {
        padding: 3rem 0 2rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 2rem;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-section:first-child {
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .footer-links li {
        margin-bottom: 0;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-bottom-links {
        justify-content: center;
        gap: 1rem;
    }
    
    /* ==========================================================================
       Cards
       ========================================================================== */
    
    .card-header,
    .card-body,
    .card-footer {
        padding: 1.25rem;
    }
    
    /* ==========================================================================
       Utilities
       ========================================================================== */
    
    .text-center-mobile {
        text-align: center;
    }
    
    .hidden-mobile {
        display: none;
    }
    
    .visible-mobile {
        display: block;
    }

    /* Auth Pages Mobile Styles */
    .auth-container {
        margin: 100px 1rem;
        padding: 1.5rem;
    }

    .auth-header h1 {
        font-size: 1.75rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .social-auth {
        grid-template-columns: 1fr;
    }

    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .service-button:hover .service-tooltip { display:none; }
    /* ==========================================================================
       Extra Small Screens
       ========================================================================== */
    
    .container {
        padding: 0 0.75rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .hero {
        padding: 5rem 0 3rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .features-grid {
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 2rem 0 1.5rem;
    }
    
    .social-links {
        gap: 0.75rem;
    }
    
    .social-link {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
    
    /* Hero Gnome Styles - Handled by main.css responsive system */
    
    .hero-gnome {
        padding: 0.25rem 0 0;
        overflow: hidden;
    }
    
    .hero-gnome-content {
        gap: 0.5rem;
        padding-top: 0;
        overflow: visible;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .service-buttons-container {
        margin-bottom: 1.5rem;
        overflow: visible; /* Allow tooltips and button effects to show */
    }
    
    .service-buttons-grid {
        gap: 0.75rem;
        padding: 1rem 1rem 1rem 1rem; /* Reduced left padding for proper alignment */
        overflow-y: visible; /* Allow tooltips to show above */
    }
    
    .service-button {
        /* Complete mobile button styling for smaller screens */
        background: linear-gradient(135deg, #372153 0%, #3b246c 50%, #613877 100%);
        border: none;
        color: white;
        text-decoration: none;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 10px 30px rgba(107, 70, 193, 0.3);
        
        /* Square dimensions for smaller screens */
        flex: 0 0 120px; /* Fixed width for smaller screens */
        min-width: 120px;
        width: 120px;
        height: 120px; /* Fixed height to make perfect squares */
        padding: 0.75rem;
        border-radius: 12px;
        
        /* Layout */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        position: relative; /* For tooltip positioning */
    }
}

/* Bounce animation for mobile buttons */
@keyframes mobileButtonBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(0);
    }
    10% {
        transform: translateX(-10px);
    }
    30% {
        transform: translateX(10px);
    }
    40% {
        transform: translateX(-5px);
    }
    60% {
        transform: translateX(5px);
    }
} 