/**
 * Responsive Design
 * Mobile-first responsive styles
 */

/* === Tablet (768px - 1024px) === */
@media (max-width: 1024px) {
    :root {
        --section-spacing: clamp(3rem, 8vw, 6rem);
    }

    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .highlights-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === Mobile (max-width: 768px) === */
@media (max-width: 768px) {
    :root {
        --section-spacing: 3rem;
        --container-padding: 1.5rem;
    }

    /* Typography adjustments */
    h1 {
        font-size: var(--text-4xl);
    }

    h2 {
        font-size: var(--text-3xl);
    }

    h3 {
        font-size: var(--text-2xl);
    }

    /* Hero section */
    .hero-section {
        min-height: 90vh;
        padding-top: var(--space-12);
        padding-bottom: var(--space-12);
    }

    .logo-image {
        max-width: 320px;
    }

    .hero-title {
        font-size: var(--text-4xl);
        margin-bottom: var(--space-3);
    }

    .hero-subtitle {
        font-size: var(--text-xl);
        margin-bottom: var(--space-6);
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 320px;
    }

    /* Sections */
    .section {
        padding-top: var(--space-12);
        padding-bottom: var(--space-12);
    }

    .section-header {
        margin-bottom: var(--space-8);
    }

    .section-intro {
        font-size: var(--text-base);
    }

    /* About section */
    .about-text {
        font-size: var(--text-base);
    }

    .highlights-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .highlight-card {
        padding: var(--space-6);
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    /* Lightbox */
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-caption {
        font-size: var(--text-base);
        bottom: -40px;
    }

    /* Background layers */
    .waves-container {
        height: 150px;
    }

    .beach-chairs {
        height: 150px;
        bottom: 15%;
    }

    /* Buttons */
    .btn {
        padding: var(--space-3) var(--space-5);
        font-size: var(--text-base);
    }

    /* Cards */
    .card {
        padding: var(--space-5);
    }

    /* Rooms and Suitable sections */
    .rooms-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .suitable-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
}

/* === Small Mobile (max-width: 480px) === */
@media (max-width: 480px) {
    :root {
        --section-spacing: 2.5rem;
        --container-padding: 1rem;
    }

    /* Hero section */
    .hero-section {
        min-height: 85vh;
        padding-top: var(--space-10);
    }

    .logo-image {
        max-width: 260px;
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .hero-subtitle {
        font-size: var(--text-lg);
    }

    /* Sections */
    .section {
        padding-top: var(--space-10);
        padding-bottom: var(--space-10);
    }

    .section-header {
        margin-bottom: var(--space-6);
    }

    /* Typography */
    h2 {
        font-size: var(--text-2xl);
    }

    h3 {
        font-size: var(--text-xl);
    }

    p {
        font-size: var(--text-sm);
    }

    /* Highlights */
    .highlight-card {
        padding: var(--space-5);
    }

    .highlight-icon {
        font-size: 2.5rem;
    }

    /* Gallery */
    .gallery-item {
        border-radius: var(--radius-lg);
    }

    /* Background */
    .waves-container {
        height: 100px;
    }

    .beach-chairs {
        height: 100px;
        bottom: 10%;
    }

    .beach-chairs::before,
    .beach-chairs::after {
        width: 60px;
        height: 80px;
    }

    /* Chatbot */
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .chatbot-icon {
        width: 24px;
        height: 24px;
    }
}

/* === Landscape Mobile === */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding-top: var(--space-8);
        padding-bottom: var(--space-8);
    }

    .logo-image {
        max-width: 200px;
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .hero-subtitle {
        font-size: var(--text-lg);
        margin-bottom: var(--space-4);
    }
}

/* === Large Screens (min-width: 1440px) === */
@media (min-width: 1440px) {
    .container {
        max-width: 1600px;
    }

    .hero-section {
        min-height: 100vh;
    }

    .logo-image {
        max-width: 600px;
    }
}

/* === Ultra-wide Screens (min-width: 1920px) === */
@media (min-width: 1920px) {
    .container {
        max-width: 1800px;
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .highlights-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* === Touch Device Optimizations === */
@media (hover: none) and (pointer: coarse) {

    /* Increase touch targets */
    .btn {
        min-height: 48px;
        padding: var(--space-3) var(--space-6);
    }

    .chatbot-toggle {
        width: 60px;
        height: 60px;
    }

    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
    }

    .gallery-item:hover {
        transform: none;
    }

    .gallery-item:hover img {
        transform: none;
    }

    /* Tap highlight color */
    * {
        -webkit-tap-highlight-color: rgba(43, 122, 158, 0.2);
    }
}

/* === Print Styles === */
@media print {

    /* Hide interactive elements */
    .chatbot-widget,
    .lightbox,
    .waves-container,
    #marine-life-container,
    .beach-chairs {
        display: none !important;
    }

    /* Optimize for print */
    body {
        background: white;
    }

    .background-layers {
        display: none;
    }

    #main-content {
        background: white;
    }

    /* Ensure good contrast */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        color: black;
    }

    p,
    li {
        color: #333;
    }

    /* Page breaks */
    .section {
        page-break-inside: avoid;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}

/* === Reduced Motion === */
@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;
    }

    .waves-container,
    .marine-creature,
    .logo-sparkle {
        animation: none !important;
    }
}

/* === High Contrast Mode === */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid var(--white);
    }

    .btn-outline {
        border-width: 3px;
    }

    .card {
        border: 2px solid var(--gray-300);
    }
}

/* === Dark Mode Support (Future Enhancement) === */
@media (prefers-color-scheme: dark) {
    /* This can be implemented later if needed */
    /* For now, the ocean theme works well in both light and dark environments */
}

/* === Responsive Styles for New Sections === */

@media (max-width: 992px) {

    /* Why Book Here */
    .why-book-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Hosts Section */
    .hosts-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hosts-image {
        position: relative;
        top: 0;
    }

    /* Distance Grid */
    .distance-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Rating Overview */
    .rating-overview {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* Reviews Grid */
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    /* Why Book Here */
    .why-book-grid {
        grid-template-columns: 1fr;
    }

    /* Distance Grid */
    .distance-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Pricing */
    .pricing-terms {
        grid-template-columns: 1fr;
    }

    .pricing-extras {
        grid-template-columns: 1fr;
    }

    /* Activities */
    .activities-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Category Title */
    .category-title {
        font-size: 1.5rem;
    }

    /* Reviews */
    .reviews-grid {
        grid-template-columns: 1fr;
    }

    .rating-item {
        grid-template-columns: 100px 1fr 50px;
        gap: 1rem;
    }

    /* Hosts Stats */
    .hosts-stats {
        grid-template-columns: 1fr;
    }

    /* Location Highlights */
    .location-highlights {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {

    /* Distance Grid */
    .distance-grid {
        grid-template-columns: 1fr;
    }

    /* Activities */
    .activities-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Benefit Cards */
    .benefit-stat {
        font-size: 2rem;
    }

    /* Rating Score */
    .rating-score {
        font-size: 3.5rem;
    }

    /* Hosts Text */
    .hosts-text {
        padding: 2rem;
    }

    /* Review Cards */
    .review-card {
        padding: 2rem;
    }
}