/* SecondHomeMurree Hotel - Advanced Mobile Enhancements */
/* Complete Mobile-First Responsive Design */

/* ============================================
   MOBILE-FIRST BASE STYLES
   ============================================ */

/* Reset and base mobile styles */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   MOBILE NAVIGATION ENHANCEMENTS
   ============================================ */

/* Enhanced mobile navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    z-index: 9999;
    transition: left 0.3s ease-in-out;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-nav-title {
    color: #D4AF37;
    font-size: 1.2rem;
    font-weight: bold;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.mobile-nav-menu {
    padding: 20px 0;
}

.mobile-nav-item {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    background: rgba(212, 175, 55, 0.2);
    color: #D4AF37;
    padding-left: 30px;
}

.mobile-nav-item i {
    margin-right: 10px;
    width: 20px;
}

/* Hamburger menu animation */
.hamburger {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #1f2937;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ============================================
   MOBILE TYPOGRAPHY SYSTEM
   ============================================ */

/* Mobile-optimized typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.875rem !important;
    }
    
    h3 {
        font-size: 1.5rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.75rem !important;
    }
    
    h4 {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.625rem !important;
    }
    
    p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1rem !important;
    }
    
    .text-sm {
        font-size: 0.875rem !important;
    }
    
    .text-xs {
        font-size: 0.75rem !important;
    }
}

/* ============================================
   MOBILE LAYOUT SYSTEM
   ============================================ */

/* Container adjustments */
@media (max-width: 768px) {
    .container,
    .max-w-7xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
    }
    
    /* Grid system - mobile first */
    .grid {
        display: grid;
        gap: 1rem;
    }
    
    .grid-cols-1,
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr !important;
    }
    
    /* Flexbox adjustments */
    .flex-col-mobile {
        flex-direction: column !important;
    }
    
    .items-center-mobile {
        align-items: center !important;
    }
    
    .text-center-mobile {
        text-align: center !important;
    }
}

/* ============================================
   MOBILE HERO SECTION
   ============================================ */

@media (max-width: 768px) {
    .hero-section {
        min-height: 70vh !important;
        padding: 100px 1rem 2rem !important;
        background-attachment: scroll !important; /* Better performance on mobile */
    }
    
    .hero-section h1 {
        font-size: 2.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-section p {
        font-size: 1.125rem !important;
        margin-bottom: 2rem !important;
    }
    
    .hero-section .flex {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .hero-section .btn,
    .hero-section button,
    .hero-section a[class*="bg-"] {
        width: 100% !important;
        padding: 1rem 2rem !important;
        font-size: 1.125rem !important;
        text-align: center !important;
    }
}

/* ============================================
   MOBILE CARDS & COMPONENTS
   ============================================ */

@media (max-width: 768px) {
    /* Room cards */
    .room-card {
        margin-bottom: 1.5rem !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    }
    
    .room-card img {
        height: 200px !important;
        width: 100% !important;
        object-fit: cover !important;
    }
    
    .room-card .p-6 {
        padding: 1.25rem !important;
    }
    
    /* Service boxes */
    .service-box {
        padding: 1.5rem !important;
        margin-bottom: 1rem !important;
        border-radius: 12px !important;
    }
    
    /* Testimonial cards */
    .testimonial-card {
        padding: 1.5rem !important;
        margin-bottom: 1rem !important;
        border-radius: 12px !important;
    }
    
    /* Comment cards */
    .comment-card {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        border-radius: 8px !important;
    }
    
    .comment-avatar {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }
}

/* ============================================
   MOBILE FORMS
   ============================================ */

@media (max-width: 768px) {
    /* Form enhancements */
    .form-group {
        margin-bottom: 1.25rem !important;
    }
    
    .form-group label {
        display: block !important;
        margin-bottom: 0.5rem !important;
        font-weight: 600 !important;
        color: #374151 !important;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100% !important;
        padding: 0.875rem !important;
        font-size: 1rem !important; /* Prevents iOS zoom */
        border: 2px solid #d1d5db !important;
        border-radius: 8px !important;
        background: white !important;
        transition: border-color 0.3s ease !important;
        min-height: 48px !important; /* Touch target */
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        outline: none !important;
        border-color: #D4AF37 !important;
        box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1) !important;
    }
    
    /* Booking form */
    .booking-form {
        padding: 1.5rem !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    }
    
    .booking-summary {
        padding: 1.25rem !important;
        border-radius: 8px !important;
        background: #f9fafb !important;
        margin-top: 1rem !important;
    }
}

/* ============================================
   MOBILE BUTTONS
   ============================================ */

@media (max-width: 768px) {
    /* Button system */
    .btn,
    button,
    a[class*="bg-"] {
        display: inline-block !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        text-align: center !important;
        text-decoration: none !important;
        border: none !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        min-height: 48px !important; /* Touch target */
        min-width: 48px !important;
        line-height: 1.2 !important;
    }
    
    /* Primary buttons */
    .btn-primary,
    .bg-gray-800 {
        background: #1f2937 !important;
        color: white !important;
    }
    
    .btn-primary:hover,
    .bg-gray-800:hover {
        background: #374151 !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
    }
    
    /* Secondary buttons */
    .btn-secondary,
    .border-2 {
        background: transparent !important;
        border: 2px solid #1f2937 !important;
        color: #1f2937 !important;
    }
    
    .btn-secondary:hover,
    .border-2:hover {
        background: #1f2937 !important;
        color: white !important;
    }
    
    /* WhatsApp button */
    .bg-green-500 {
        background: #10b981 !important;
        color: white !important;
    }
    
    .bg-green-500:hover {
        background: #059669 !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
    }
    
    /* Button groups */
    .button-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .button-group .btn,
    .button-group button {
        width: 100% !important;
    }
}

/* ============================================
   MOBILE NAVIGATION BAR
   ============================================ */

@media (max-width: 768px) {
    /* Navigation bar */
    nav {
        padding: 0.75rem 1rem !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        border-bottom: 1px solid rgba(0,0,0,0.1) !important;
    }
    
    nav .text-2xl {
        font-size: 1.25rem !important;
    }
    
    /* Hide desktop menu */
    nav .hidden.md\\:flex {
        display: none !important;
    }
    
    /* Mobile menu button */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 8px !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer !important;
    }
    
    /* Notification bell mobile */
    #notificationBell {
        padding: 0.5rem !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }
    
    #notificationDropdown {
        width: 95vw !important;
        right: 2.5vw !important;
        left: 2.5vw !important;
        max-height: 70vh !important;
    }
}

/* ============================================
   MOBILE SECTIONS
   ============================================ */

@media (max-width: 768px) {
    /* Section spacing */
    section {
        padding: 3rem 1rem !important;
    }
    
    .py-20 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .py-12 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* About section */
    .about-section .flex {
        flex-direction: column !important;
    }
    
    .about-section .md\\:w-1\\/2 {
        width: 100% !important;
        margin-bottom: 2rem !important;
    }
    
    /* Rooms section */
    .rooms-section .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Amenities section */
    .amenities-section .grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Footer */
    footer {
        padding: 2rem 1rem !important;
    }
    
    footer .grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center !important;
    }
    
    footer .flex {
        justify-content: center !important;
    }
}

/* ============================================
   MOBILE IMAGES & MEDIA
   ============================================ */

@media (max-width: 768px) {
    /* Image optimizations */
    img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 8px !important;
    }
    
    /* Gallery grids */
    .gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .gallery-grid.two-col {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Video containers */
    .video-container {
        position: relative !important;
        width: 100% !important;
        height: 0 !important;
        padding-bottom: 56.25% !important; /* 16:9 aspect ratio */
    }
    
    .video-container iframe {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }
}

/* ============================================
   MOBILE TABLES
   ============================================ */

@media (max-width: 768px) {
    /* Responsive tables */
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .table-responsive table {
        min-width: 600px !important;
        font-size: 0.875rem !important;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem !important;
        white-space: nowrap !important;
    }
    
    /* Card-style tables for mobile */
    .table-cards {
        display: block !important;
    }
    
    .table-cards thead {
        display: none !important;
    }
    
    .table-cards tbody,
    .table-cards tr,
    .table-cards td {
        display: block !important;
    }
    
    .table-cards tr {
        background: white !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 8px !important;
        margin-bottom: 1rem !important;
        padding: 1rem !important;
    }
    
    .table-cards td {
        border: none !important;
        padding: 0.5rem 0 !important;
        position: relative !important;
        padding-left: 50% !important;
    }
    
    .table-cards td:before {
        content: attr(data-label) !important;
        position: absolute !important;
        left: 0 !important;
        width: 45% !important;
        font-weight: bold !important;
        color: #374151 !important;
    }
}

/* ============================================
   MOBILE MODALS & POPUPS
   ============================================ */

@media (max-width: 768px) {
    /* Modal adjustments */
    .modal {
        padding: 1rem !important;
    }
    
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 90vh !important;
        padding: 1.5rem !important;
        border-radius: 12px !important;
        overflow-y: auto !important;
    }
    
    .modal-header {
        padding-bottom: 1rem !important;
        border-bottom: 1px solid #e5e7eb !important;
        margin-bottom: 1rem !important;
    }
    
    .modal-footer {
        padding-top: 1rem !important;
        border-top: 1px solid #e5e7eb !important;
        margin-top: 1rem !important;
    }
    
    /* Toast notifications */
    .toast {
        width: 95% !important;
        right: 2.5% !important;
        left: 2.5% !important;
        padding: 1rem !important;
        border-radius: 8px !important;
    }
}

/* ============================================
   MOBILE PERFORMANCE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Reduce animations for better performance */
    .reduce-motion * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
    
    /* Optimize transforms */
    .card,
    .room-card,
    .btn {
        transform: translateZ(0) !important;
        backface-visibility: hidden !important;
    }
    
    /* Lazy loading placeholder */
    .lazy-loading {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
        background-size: 200% 100% !important;
        animation: shimmer 1.5s ease-in-out infinite !important;
    }
    
    @keyframes shimmer {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
}

/* ============================================
   MOBILE ACCESSIBILITY
   ============================================ */

@media (max-width: 768px) {
    /* Focus indicators */
    *:focus {
        outline: 3px solid #D4AF37 !important;
        outline-offset: 2px !important;
    }
    
    /* Skip links */
    .skip-link {
        position: absolute !important;
        top: -40px !important;
        left: 0 !important;
        background: #D4AF37 !important;
        color: #000 !important;
        padding: 0.5rem 1rem !important;
        text-decoration: none !important;
        z-index: 10000 !important;
        border-radius: 0 0 8px 0 !important;
    }
    
    .skip-link:focus {
        top: 0 !important;
    }
    
    /* Screen reader only */
    .sr-only {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
}

/* ============================================
   MOBILE DARK MODE SUPPORT
   ============================================ */

@media (max-width: 768px) and (prefers-color-scheme: dark) {
    /* Dark mode adjustments for mobile */
    body {
        background: #1f2937 !important;
        color: #f9fafb !important;
    }
    
    .card,
    .room-card,
    .booking-form {
        background: #374151 !important;
        border-color: #4b5563 !important;
    }
    
    nav {
        background: rgba(31, 41, 55, 0.95) !important;
        border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #374151 !important;
        border-color: #4b5563 !important;
        color: #f9fafb !important;
    }
}

/* ============================================
   MOBILE UTILITY CLASSES
   ============================================ */

/* Show/hide utilities */
.mobile-show {
    display: none !important;
}

.mobile-hide {
    display: block !important;
}

@media (max-width: 768px) {
    .mobile-show {
        display: block !important;
    }
    
    .mobile-hide {
        display: none !important;
    }
    
    .mobile-flex {
        display: flex !important;
    }
    
    .mobile-grid {
        display: grid !important;
    }
}

/* Spacing utilities */
@media (max-width: 768px) {
    .mobile-p-4 { padding: 1rem !important; }
    .mobile-p-6 { padding: 1.5rem !important; }
    .mobile-m-4 { margin: 1rem !important; }
    .mobile-m-6 { margin: 1.5rem !important; }
    .mobile-mb-4 { margin-bottom: 1rem !important; }
    .mobile-mb-6 { margin-bottom: 1.5rem !important; }
    .mobile-mt-4 { margin-top: 1rem !important; }
    .mobile-mt-6 { margin-top: 1.5rem !important; }
}

/* Text utilities */
@media (max-width: 768px) {
    .mobile-text-center { text-align: center !important; }
    .mobile-text-left { text-align: left !important; }
    .mobile-text-right { text-align: right !important; }
    .mobile-text-sm { font-size: 0.875rem !important; }
    .mobile-text-base { font-size: 1rem !important; }
    .mobile-text-lg { font-size: 1.125rem !important; }
}

/* Width utilities */
@media (max-width: 768px) {
    .mobile-w-full { width: 100% !important; }
    .mobile-w-auto { width: auto !important; }
    .mobile-max-w-full { max-width: 100% !important; }
}

/* ============================================
   MOBILE LOADING STATES
   ============================================ */

@media (max-width: 768px) {
    /* Loading spinner */
    .mobile-loading {
        display: inline-block !important;
        width: 20px !important;
        height: 20px !important;
        border: 3px solid #f3f3f3 !important;
        border-top: 3px solid #D4AF37 !important;
        border-radius: 50% !important;
        animation: spin 1s linear infinite !important;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    /* Content loading */
    .content-loading {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important;
        background-size: 200% 100% !important;
        animation: loading-shimmer 1.5s ease-in-out infinite !important;
        border-radius: 4px !important;
    }
    
    @keyframes loading-shimmer {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
}

/* ============================================
   MOBILE PRINT STYLES
   ============================================ */

@media print {
    .mobile-nav,
    .mobile-nav-overlay,
    .hamburger,
    .mobile-menu-btn,
    #notificationBell,
    .btn,
    button {
        display: none !important;
    }
    
    body {
        font-size: 12pt !important;
        line-height: 1.4 !important;
    }
    
    h1 { font-size: 18pt !important; }
    h2 { font-size: 16pt !important; }
    h3 { font-size: 14pt !important; }
    
    .room-card,
    .card {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }
}