/* SEO and Performance Optimizations */

/* Critical CSS for above-the-fold content */
.main-header {
    contain: layout style paint;
    will-change: transform;
}

/* Optimize images for SEO */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* First meaningful paint optimization */
.logo-img-large {
    width: 60px;
    height: 60px;
    object-fit: contain;
    loading: eager; /* Load logo immediately */
}

/* Structured data visibility helpers */
.reserve-card {
    position: relative;
}

.reserve-card::after {
    content: attr(data-reserve-name);
    position: absolute;
    left: -9999px;
    top: -9999px;
    font-size: 0;
    opacity: 0;
}

/* SEO-friendly hidden content for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Breadcrumb navigation for SEO */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    list-style: none;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    display: inline-block;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
    color: #6c757d;
}

/* Optimize font loading */
@font-face {
    font-family: 'Cairo';
    font-display: swap;
    src: url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;400;600;800&display=swap');
}

/* Performance optimizations */
.map-container-boxed {
    contain: strict;
    content-visibility: auto;
    contain-intrinsic-size: 100vh;
}

/* Lazy loading optimization */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Core Web Vitals optimizations */
.sidebar {
    contain: layout style paint;
}

.reserve-list {
    contain: layout;
}

/* Accessibility improvements for SEO */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}

.skip-link:focus {
    top: 6px;
}

/* Language selector optimization */
.lang-selector {
    contain: layout style;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        order: 2;
        max-height: 40vh;
        overflow-y: auto;
    }
    
    .map-container-boxed {
        order: 1;
        height: 60vh;
    }
}

/* Print styles for SEO */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .main-header {
        position: static;
        box-shadow: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .reserve-card {
        border: 2px solid;
    }
    
    .btn-primary {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus management for accessibility */
.focus-trap {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Semantic HTML improvements */
main {
    display: block;
}

article {
    display: block;
}

section {
    display: block;
}

nav {
    display: block;
}

/* Microdata support */
[itemscope] {
    display: block;
}

/* JSON-LD structured data styling */
script[type="application/ld+json"] {
    display: none;
}

/* Performance monitoring */
.performance-mark {
    display: none;
}

/* Critical resource hints */
.preload-hint {
    display: none;
}

/* SEO-friendly image captions */
.image-caption {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Structured navigation */
.main-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav li {
    margin: 0 1rem;
}

/* Content hierarchy */
h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* Table accessibility */
table {
    border-collapse: collapse;
    width: 100%;
}

th {
    text-align: right;
    padding: 0.75rem;
    border-bottom: 2px solid #dee2e6;
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

/* Form accessibility */
label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

input, textarea, select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

input:focus, textarea:focus, select:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-color: #007bff;
}

/* Error states */
.error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.success {
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}