/* SecondHomeMurree Hotel - Responsive Enhancements */
/* Optimized for Desktop, Tablet, and Mobile */

/* ============================================
   BASE RESPONSIVE UTILITIES
   ============================================ */

/* Smooth scrolling for all devices */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
    width: 100%;
}

/* Touch-friendly elements */
button, a, input, select, textarea {
    -webkit-tap-highlight-color: rgba(212, 175, 55, 0.3);
    touch-action: manipulation;
}

/* ============================================
   DESKTOP OPTIMIZATIONS (1200px+)
   ============================================ */

@media (min-width: 1200px) {
    /* Wider container for large screens */
    .max-w-7xl {
        max-width: 1400px;
    }
    
    /* Larger text for readability */
    body {
        font-size: 16px;
    }
    
    /* Enhanced hover effects */
    .room-card:hover,
    .card:hover {
        transform: translateY(-10px) scale(1.03);
    }
    
    /* Better spacing */
    section {
        padding: 80px 40px;
    }
}

/* ============================================
   LAPTOP/DESKTOP (992px - 1199px)
   ============================================ */

@media (min-width: 992px) and (max-width: 1199px) {
    /* Adjust container */
    .max-w-7xl {
        max-width: 1140px;
    }
    
    /* Responsive grid */
    .grid-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Navigation spacing */
    nav .space-x-8 {
        gap: 1.5rem;
    }
}

/* ============================================
   TABLET (768px - 991px)
   ============================================ */

@media (min-width: 768px) and (max-width: 991px) {
    /* Container adjustments */
    .max-w-7xl {
        max-width: 960px;
        padding: 0 30px;
    }
    
    /* Typography */
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 2rem !important;
    }
    
    h3 {
        font-size: 1.5rem !important;
    }
    
    /* Grid adjustments */
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Room cards */
    .room-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Booking form */
    .booking-form {
        padding: 30px;
    }
    
    /* Comment section */
    #comments-section .max-w-3xl {
        max-width: 100%;
    }
    
    /* Reduced animations for performance */
    .card:hover,
    .room-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
}

/* ============================================
   MOBILE LANDSCAPE (576px - 767px)
   ============================================ */

@media (min-width: 576px) and (max-width: 767px) {
    /* Container */
    .max-w-7xl {
        padding: 0 20px;
    }
    
    /* Typography */
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    /* Single column grids */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    /* Room grid - 2 columns for landscape */
    .room-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Navigation */
    nav {
        padding: 15px 20px;
    }
    
    /* Buttons */
    .btn,
    button {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Forms */
    input,
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Booking form */
    .booking-form {
        padding: 25px;
    }
    
    /* Comment cards */
    .comment-card {
        padding: 20px;
    }
}

/* ============================================
   MOBILE PORTRAIT (< 576px)
   ============================================ */

@media (max-width: 575px) {
    /* Container */
    .max-w-7xl {
        padding: 0 15px;
    }
    
    /* Typography - Mobile optimized */
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    p {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* All grids single column */
    .grid-cols-1,
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4,
    .room-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    /* Navigation */
    nav {
        padding: 12px 15px;
    }
    
    nav .text-2xl {
        font-size: 1.25rem !important;
    }
    
    /* Hero section */
    .hero-section {
        min-height: 60vh;
        padding: 80px 20px 40px;
    }
    
    .hero-section h1 {
        font-size: 2rem !important;
    }
    
    .hero-section p {
        font-size: 1rem !important;
    }
    
    /* Buttons - Touch friendly */
    .btn,
    button,
    a[class*="bg-"] {
        padding: 14px 24px;
        font-size: 15px;
        min-height: 48px; /* Touch target size */
        width: 100%;
        text-align: center;
    }
    
    /* Button groups */
    .flex.gap-4 {
        flex-direction: column;
        gap: 12px;
    }
    
    /* Forms - Mobile optimized */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 14px;
        min-height: 48px;
    }
    
    .form-row {
        grid-template-columns: 1fr !important;
    }
    
    /* Booking form */
    .booking-form {
        padding: 20px;
        border-radius: 8px;
    }
    
    .booking-summary {
        padding: 20px;
    }
    
    /* Room cards */
    .room-card {
        padding: 20px;
    }
    
    .room-card img {
        height: 200px;
        object-fit: cover;
    }
    
    /* Comment section */
    #comments-section {
        padding: 40px 15px;
    }
    
    .comment-card {
        padding: 16px;
    }
    
    .comment-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    /* Tables - Responsive */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
        font-size: 14px;
    }
    
    th, td {
        padding: 10px 8px;
    }
    
    /* Modal - Full screen on mobile */
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 20px;
        max-height: 85vh;
    }
    
    /* Footer */
    footer {
        padding: 40px 20px;
        text-align: center;
    }
    
    footer .grid {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }
    
    /* Sections */
    section {
        padding: 40px 15px;
    }
    
    /* Cards */
    .card {
        padding: 20px;
    }
    
    /* Testimonials */
    .testimonial-card {
        padding: 20px;
    }
    
    /* Service boxes */
    .service-box {
        padding: 20px;
    }
    
    /* Spacing utilities */
    .py-20 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .mb-16 {
        margin-bottom: 2rem !important;
    }
    
    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* ============================================
   EXTRA SMALL MOBILE (< 375px)
   ============================================ */

@media (max-width: 374px) {
    /* Even smaller text */
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
    
    h3 {
        font-size: 1.1rem !important;
    }
    
    /* Compact padding */
    .booking-form,
    .comment-card,
    .card {
        padding: 15px;
    }
    
    /* Smaller buttons */
    .btn,
    button {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Navigation */
    nav .text-2xl {
        font-size: 1.1rem !important;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .card:hover,
    .room-card:hover,
    .btn:hover {
        transform: none;
    }
    
    /* Larger touch targets */
    button,
    a,
    input,
    select {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better tap feedback */
    button:active,
    a:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

/* ============================================
   LANDSCAPE ORIENTATION
   ============================================ */

@media (orientation: landscape) and (max-height: 500px) {
    /* Reduce vertical spacing in landscape */
    .hero-section {
        min-height: 80vh;
        padding: 60px 20px;
    }
    
    section {
        padding: 40px 20px;
    }
    
    .py-20 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    /* Hide navigation and footer */
    nav,
    footer,
    #comments-section,
    .btn,
    button {
        display: none !important;
    }
    
    /* Optimize for printing */
    body {
        background: white;
        color: black;
    }
    
    .card,
    .room-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid #D4AF37;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #D4AF37;
    color: #000;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card,
    .room-card,
    .booking-form {
        border: 3px solid #000;
    }
    
    button,
    .btn {
        border: 2px solid #000;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* GPU acceleration for smooth animations */
.card,
.room-card,
.btn,
img {
    transform: translateZ(0);
    will-change: transform;
}

/* ============================================
   BROWSER-SPECIFIC FIXES
   ============================================ */

/* iOS Safari fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix iOS input zoom */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Fix iOS viewport height */
    .hero-section {
        min-height: -webkit-fill-available;
    }
}

/* Firefox fixes */
@-moz-document url-prefix() {
    /* Firefox-specific styles */
    button,
    .btn {
        padding: 13px 24px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Show/hide based on screen size */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 767px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
}

/* Responsive text alignment */
.text-center-mobile {
    text-align: left;
}

@media (max-width: 767px) {
    .text-center-mobile {
        text-align: center;
    }
}

/* Responsive spacing */
.space-mobile {
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .space-mobile {
        margin-bottom: 0;
    }
}

/* ============================================
   LOADING STATES
   ============================================ */

/* Skeleton loading for images */
.skeleton-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   DARK MODE SUPPORT (Future)
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
    /* Currently using light theme */
}
