/* ===================================
   RESPONSIVE DESIGN - RVA COMMONS
   Mobile-First Approach
=================================== */

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-blue);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius-soft);
}

.mobile-menu-toggle:hover {
    background: rgba(96, 165, 250, 0.1);
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary-blue);
    margin: 5px 0;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(44, 82, 130, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.mobile-nav-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 2rem;
}

.mobile-nav-links {
    list-style: none;
    text-align: center;
    margin-bottom: 2rem;
}

.mobile-nav-links li {
    margin: 1.5rem 0;
}

.mobile-nav-links a {
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 25px;
    display: block;
    color: white;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    margin-bottom: 1rem;
}

.mobile-nav-links a:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Mobile navigation button colors */
.mobile-nav-links .mobile-nav-link {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: 1px solid rgba(99, 102, 241, 0.5);
}

.mobile-nav-links .mobile-nav-cta {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 1px solid rgba(245, 158, 11, 0.5);
    font-weight: 700;
    font-size: 1.2rem;
    margin-top: 1rem;
    padding: 1.25rem 2rem;
}

/* ===================================
   BREAKPOINTS
=================================== */

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    /* Typography */
    .hero h1 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem !important;
        margin-bottom: 2rem;
    }
    
    /* Layout */
    .section {
        padding: 3rem 1rem 2rem;
    }
    
    .nav-container {
        padding: 1rem;
        grid-template-columns: 1fr auto;
        gap: 1rem;
    }
    
    .nav-left,
    .nav-right {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
        justify-self: end;
    }
    
    .mobile-nav-overlay {
        display: block;
    }
    
    /* Hero Section */
    .hero {
        padding: 8rem 1rem 4rem;
        text-align: center;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .hero-buttons .cta-button,
    .hero-buttons .secondary-button {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
    
    /* Cards and Grids */
    .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* Forms */
    .booking-form {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    #available-time-slots {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .time-slot {
        padding: 0.5rem;
        font-size: 0.875rem;
        min-height: 45px;
    }
    
    /* Portfolio */
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .portfolio-item {
        margin-bottom: 1rem;
    }
    
    /* Statistics */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .section {
        padding: 4rem 1.5rem 3rem;
    }
    
    .nav-container {
        padding: 1rem 1.5rem;
        grid-template-columns: 1fr auto;
    }
    
    .nav-links-center,
    .nav-container > .cta-button {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-nav-overlay {
        display: block;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    #available-time-slots {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .nav-container {
        grid-template-columns: auto 1fr auto;
        gap: 1.5rem;
    }
    
    .nav-links-center {
        gap: 1.5rem;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .section {
        padding: 4rem 2rem 3rem;
    }
    
    .grid-2 {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    /* Timeline adjustments for tablets */
    .timeline-item {
        flex-direction: row;
        align-items: center;
    }
    
    .timeline-dot {
        margin-right: 1.5rem;
        margin-bottom: 0;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .nav-container {
        max-width: 960px;
    }
    
    .section {
        max-width: 960px;
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .nav-container {
        max-width: 1140px;
    }
    
    .section {
        max-width: 1140px;
    }
}

/* ===================================
   TOUCH DEVICE OPTIMIZATIONS
=================================== */

@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .nav-link {
        padding: 1rem 1.5rem;
        min-height: 44px;
    }
    
    .cta-button,
    .secondary-button {
        min-height: 44px;
        padding: 1rem 2rem;
    }
    
    .time-slot {
        min-height: 44px;
        padding: 1rem;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover,
    .portfolio-item:hover {
        transform: none;
    }
    
    .nav-link:hover {
        transform: none;
    }
    
    /* Improve form controls for touch */
    .form-group input,
    .form-group textarea,
    .form-group select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ===================================
   LANDSCAPE ORIENTATION
=================================== */

@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        padding: 6rem 2rem 3rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .mobile-nav-content {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
    }
    
    .mobile-nav-links {
        display: flex;
        gap: 2rem;
        margin-bottom: 0;
    }
    
    .mobile-nav-links li {
        margin: 0;
    }
}

/* ===================================
   PRINT STYLES
=================================== */

@media print {
    .navbar,
    .mobile-menu-toggle,
    .mobile-nav-overlay,
    .cta-button,
    .secondary-button {
        display: none !important;
    }
    
    .hero {
        padding-top: 2rem;
    }
    
    .section {
        padding: 2rem 1rem;
        page-break-inside: avoid;
    }
    
    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    a {
        text-decoration: underline;
    }
    
    .portfolio-overlay {
        position: static;
        transform: none;
        background: #f8f9fa;
        color: #333;
    }
}

/* ===================================
   ACCESSIBILITY IMPROVEMENTS
=================================== */

/* Focus indicators */
@media (prefers-reduced-motion: no-preference) {
    .nav-link:focus,
    .cta-button:focus,
    .secondary-button:focus,
    .time-slot:focus {
        outline: 3px solid rgba(96, 165, 250, 0.5);
        outline-offset: 2px;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .fluid-animation::after {
        animation: none;
    }
    
    .nav-link.shimmer::before {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark-grey);
    }
    
    .nav-link:hover {
        background: var(--dark-grey);
        color: white;
    }
    
    .cta-button {
        border: 2px solid var(--primary-blue);
    }
}

/* Dark mode preferences - now handled by data-theme attribute */
/* Removed to prevent conflicts with manual theme toggle */

/* ===================================
   CONTAINER QUERIES (Modern Responsive)
=================================== */

/* Container query support for modern browsers */
@supports (container-type: inline-size) {
    .responsive-container {
        container-type: inline-size;
    }
    
    @container (max-width: 400px) {
        .card {
            padding: 1rem;
            font-size: 0.9rem;
        }
        
        .card h3 {
            font-size: 1.1rem;
        }
    }
    
    @container (min-width: 600px) {
        .grid {
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        }
    }
}

/* ===================================
   ENHANCED MOBILE OPTIMIZATIONS
=================================== */

/* Improved mobile typography scaling */
@media (max-width: 575.98px) {
    html {
        font-size: 14px; /* Slightly smaller base font for mobile */
    }
    
    /* Better mobile spacing */
    .section {
        padding: 2rem 1rem;
    }
    
    /* Optimized mobile navigation */
    .mobile-nav-links a {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
    
    /* Mobile-optimized forms */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem;
    }
    
    /* Better mobile button sizing */
    .cta-button,
    .secondary-button {
        font-size: 0.95rem;
        padding: 0.875rem 1.5rem;
        min-height: 48px; /* Better touch target */
    }
}

/* Enhanced tablet experience */
@media (min-width: 768px) and (max-width: 1023.98px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .hero-content {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* ===================================
   UTILITY CLASSES FOR RESPONSIVE
=================================== */

/* Hide/Show on different screen sizes */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

@media (max-width: 575.98px) {
    .d-xs-none { display: none !important; }
    .d-xs-block { display: block !important; }
    .d-xs-flex { display: flex !important; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
}

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
}

/* Text alignment utilities */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

@media (max-width: 767.98px) {
    .text-sm-center { text-align: center !important; }
    .text-sm-left { text-align: left !important; }
}

/* Spacing utilities for mobile */
@media (max-width: 767.98px) {
    .mb-sm-0 { margin-bottom: 0 !important; }
    .mb-sm-1 { margin-bottom: 0.5rem !important; }
    .mb-sm-2 { margin-bottom: 1rem !important; }
    .mb-sm-3 { margin-bottom: 1.5rem !important; }
    
    .mt-sm-0 { margin-top: 0 !important; }
    .mt-sm-1 { margin-top: 0.5rem !important; }
    .mt-sm-2 { margin-top: 1rem !important; }
    .mt-sm-3 { margin-top: 1.5rem !important; }
    
    .px-sm-1 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
    .px-sm-2 { padding-left: 1rem !important; padding-right: 1rem !important; }
    
    .py-sm-1 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
    .py-sm-2 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
}