/* Mobile Responsive Styles */

/* Tablet and smaller desktop */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-content h2 {
        font-size: 2.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile landscape */
@media screen and (max-width: 768px) {
    .hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 8px;
        margin: -8px;
        box-sizing: border-box;
        z-index: 1201;
        position: relative;
    }

    /* Dark backdrop behind the drawer */
    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.55);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
        z-index: 1100;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Right-side slide-out drawer */
    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        height: 100vh;
        height: 100dvh;
        width: 88%;
        max-width: 400px;
        flex-direction: column;
        align-items: stretch;
        background-color: #fff;
        text-align: left;
        gap: 0;
        padding: 0 0 1.5rem;
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1200;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    /* Drawer header: brand + close button */
    .nav-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 68px;
        min-height: 68px;
        padding: 0 1.25rem;
        border-bottom: 1px solid #eef0f4;
        flex-shrink: 0;
    }

    .nav-menu-brand {
        font-size: 1.15rem;
        font-weight: 700;
        color: #0D1B2A;
    }

    .nav-menu-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-right: -8px;
        background: none;
        border: none;
        border-radius: 50%;
        font-size: 1.6rem;
        line-height: 1;
        color: #0D1B2A;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .nav-menu-close:hover,
    .nav-menu-close:active {
        background-color: #f4f6fb;
    }

    .nav-menu li {
        margin: 0;
        padding: 0 0.75rem;
    }

    .nav-menu li.nav-menu-header {
        padding: 0 1.25rem;
    }

    .nav-menu li a {
        display: flex;
        align-items: center;
        min-height: 52px;
        padding: 0 0.75rem;
        border-radius: 10px;
        color: #0D1B2A !important;
        font-weight: 500;
        font-size: 1rem;
        transition: background-color 0.2s ease;
    }

    .nav-menu li a:hover,
    .nav-menu li a:active {
        background-color: #f4f6fb;
        color: #0D1B2A !important;
    }

    .nav-menu li a.active {
        color: #1E88E5 !important;
        font-weight: 700;
        background-color: #eef1fd;
    }

    /* Login/Logout CTA - set apart from the nav links with a divider */
    .nav-menu li:last-child {
        margin-top: 0.75rem;
        padding: 0.75rem 1rem 0;
        border-top: 1px solid #eef0f4;
    }

    .nav-menu .auth-button {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 50px;
        min-height: 50px;
        margin: 0 !important;
        padding: 0 1.5rem !important;
        font-size: 1rem;
        box-sizing: border-box;
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero {
        padding: 60px 0;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .about, .services, .contact {
        padding: 60px 0;
    }

    .about h2, .services h2, .contact h2 {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .modal-content {
        margin: 20% auto;
        width: 95%;
    }

    .modal-body {
        padding: 20px;
    }
}

/* Mobile portrait */
@media screen and (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    .cta-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .about h2, .services h2, .contact h2 {
        font-size: 1.8rem;
    }
    
    .about p {
        font-size: 1rem;
    }
    
    .service-card {
        padding: 1rem;
    }
    
    #contact-form {
        padding: 0 10px;
    }
}

/* Print styles */
@media print {
    header, footer {
        display: none;
    }
    
    main {
        margin-top: 0;
    }
    
    .hero {
        background: none;
        color: black;
    }
    
    .cta-button {
        display: none;
    }
    
    a {
        text-decoration: underline;
    }
}
