html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* PWA and Mobile Optimizations */
@media (max-width: 767px) {
    /* Mobile-first responsive adjustments */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }
    
    .navbar-nav .dropdown-item {
        padding-left: 2rem;
    }
    
    /* Make buttons more touch-friendly */
    .btn {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .btn-sm {
        min-height: 38px;
        padding: 8px 12px;
    }
    
    /* Improve form controls for mobile */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Better spacing for mobile cards */
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 13px;
    }
    
    /* Hide some non-essential columns on mobile tables */
    .table .d-none-mobile {
        display: none !important;
    }
}

/* PWA Install Button Enhancements */
#pwa-install-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

#pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Touch-friendly navigation */
@media (max-width: 991px) {
    .navbar-nav {
        padding-top: 1rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        margin: 0.25rem 0;
        border-radius: 0.375rem;
    }
    
    .nav-link:hover {
        background-color: rgba(0,0,0,0.05);
    }
}

/* Improved carousel for mobile */
@media (max-width: 767px) {
    .carousel-item {
        height: 250px !important;
    }
    
    .carousel-caption {
        padding-bottom: 1rem;
    }
    
    .carousel-caption .display-4 {
        font-size: 1.5rem;
    }
    
    .carousel-caption .lead {
        font-size: 1rem;
    }
}

/* Loading states and offline indicators */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Offline mode styles */
.offline-mode {
    filter: grayscale(50%);
    opacity: 0.8;
}

.offline-badge {
    position: fixed;
    top: 80px;
    right: 10px;
    z-index: 1000;
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-outline-primary {
        border-width: 2px;
    }
    
    .card {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .carousel-item {
        transition: none;
    }
    
    .btn, .nav-link {
        transition: none;
    }
    
    #pwa-install-btn {
        transition: none;
    }
}

/* Dark mode support (basic) */
@media (prefers-color-scheme: dark) {
    .bg-light {
        background-color: #2b3035 !important;
        color: #ffffff;
    }
    
    .text-muted {
        color: #a6a8aa !important;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin: 0;
    padding-bottom: 80px; /* Reduced padding for smaller footer */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.card {
    transition: transform 0.2s ease-in-out;
}

    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: auto;
    background-color: #f8f9fa;
    flex-shrink: 0;
}

/* Responsive footer adjustments */
@media (max-width: 768px) {
    body {
        padding-bottom: 100px; /* Increase padding on mobile for better spacing */
    }

    .footer .row {
        text-align: center;
    }

    .footer .col-md-4 {
        margin-bottom: 0.5rem;
    }

    .footer .text-end {
        text-align: center !important;
    }

    .footer a {
        display: inline-block;
        margin: 0.25rem;
    }
}

@media (max-width: 576px) {
    body {
        padding-bottom: 120px; /* Extra padding for very small screens */
    }

    .footer {
        font-size: 0.85rem;
    }
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.property-card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.appointment-card {
    border-left: 4px solid #007bff;
}

.booking-status-pending {
    border-left: 4px solid #ffc107;
}

.booking-status-confirmed {
    border-left: 4px solid #28a745;
}

.booking-status-cancelled {
    border-left: 4px solid #dc3545;
}

.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
}

.service-icon {
    font-size: 3rem;
    color: #007bff;
    margin-bottom: 1rem;
}

.price-display {
    font-size: 2rem;
    font-weight: bold;
    color: #28a745;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.image-gallery {
    max-height: 400px;
    overflow: hidden;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

.quantity-input {
    width: 80px;
}

.sticky-booking-card {
    position: sticky;
    top: 2rem;
}

@media (max-width: 768px) {
    .sticky-booking-card {
        position: relative;
        top: 0;
    }
}

.property-amenities {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.amenity-item {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.event-duration-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.loading-spinner {
    display: none;
}

.loading .loading-spinner {
    display: inline-block;
}

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
}

.navbar-nav .nav-link:hover {
    color: #007bff !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.carousel-item img {
    border-radius: 0.375rem;
}

.form-floating {
    margin-bottom: 1rem;
}

.btn-group .btn {
    border-radius: 0;
}

    .btn-group .btn:first-child {
        border-top-left-radius: 0.375rem;
        border-bottom-left-radius: 0.375rem;
    }

    .btn-group .btn:last-child {
        border-top-right-radius: 0.375rem;
        border-bottom-right-radius: 0.375rem;
    }

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.toast-content {
    display: flex;
    align-items: center;
}

/* Cart and wishlist badges */
.navbar-nav .nav-link {
    position: relative;
}

.navbar-nav .badge {
    font-size: 0.7rem;
    min-width: 1.2rem;
    height: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Toast notifications - lower z-index to stay below nav */
.toast-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    padding: 1rem;
    min-width: 300px;
    z-index: 1050;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

    .toast-notification.show {
        transform: translateX(0);
        opacity: 1;
    }

/* Intelligent Responsive Navbar */
/* Priority-based visibility system */

/* High priority items: Always visible */
.priority-high {
    display: flex !important;
}

/* Medium priority items: Hidden on small screens */
@media (max-width: 991px) {
    .priority-medium {
        display: none !important;
    }
}

/* Low priority items: Hidden on medium and small screens */
@media (max-width: 1199px) {
    .priority-low {
        display: none !important;
    }
}

/* Compact text on smaller screens */
@media (max-width: 767px) {
    .navbar-nav .nav-link {
        padding: 0.5rem 0.25rem;
        font-size: 0.9rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}

/* More dropdown styling */
#moreDropdown .dropdown-menu {
    max-height: 60vh;
    overflow-y: auto;
}

/* Smooth transitions for priority changes */
.nav-item {
    transition: opacity 0.3s ease;
}

/* Ensure icons are always visible in compact mode */
.nav-link i {
    font-size: 1.1rem;
    margin-right: 0.25rem;
}

@media (max-width: 767px) {
    .nav-link i {
        margin-right: 0;
    }
}