/* ===== MOBILE RESPONSIVE OPTIMIZATION ===== */
/* Optimized for smartphones - most guests will view on mobile */

/* ===== MOBILE BREAKPOINTS ===== */
/* Small phones: 320px - 480px */
/* Medium phones: 481px - 768px */
/* Tablets: 769px - 1024px */

/* ===== GENERAL MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {

    /* Base adjustments */
    :root {
        --spacing-xs: 0.5rem;
        --spacing-sm: 0.75rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
    }

    body {
        font-size: 14px;
    }

    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 2rem 0;
    }

    .section-title {
        font-size: clamp(1.75rem, 6vw, 2.25rem);
        margin-bottom: 1rem;
    }

    .section-subtitle {
        font-size: clamp(0.9rem, 3vw, 1rem);
        margin-bottom: 1.5rem;
    }
}

/* ===== HERO SECTION MOBILE ===== */
@media (max-width: 768px) {
    .hero {
        min-height: 100vh;
        min-height: 100svh;
        /* Use small viewport height for mobile */
    }

    .hero-video {
        object-fit: cover;
        object-position: center;
    }

    /* Hide floating elements on small screens to reduce clutter */
    .floating-elements {
        display: none;
    }

    .hero-content {
        padding: 1rem;
    }

    .vintage-frame {
        padding: 1.5rem 1rem;
        border-width: 2px;
    }

    .hero-subtitle {
        font-size: clamp(0.75rem, 3vw, 0.9rem);
        letter-spacing: 0.2em;
    }

    .hero-names {
        font-size: clamp(2.5rem, 10vw, 3.5rem);
        margin: 0.5rem 0;
    }

    .hero-date {
        font-size: clamp(1rem, 4vw, 1.25rem);
        margin: 0.75rem 0;
    }

    .hero-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    /* Video controls - larger touch target */
    .video-control-btn {
        width: 60px;
        height: 60px;
        bottom: 80px;
        right: 20px;
        font-size: 1.5rem;
    }

    .scroll-indicator {
        bottom: 20px;
        font-size: 1.5rem;
    }
}

/* ===== COUNTDOWN SECTION MOBILE ===== */
@media (max-width: 768px) {
    .countdown {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .countdown-item {
        padding: 1rem 0.5rem;
    }

    .countdown-number {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    .countdown-label {
        font-size: clamp(0.75rem, 3vw, 0.9rem);
    }
}

@media (max-width: 480px) {
    .countdown {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .countdown-item {
        padding: 0.75rem 0.5rem;
    }
}

/* ===== EVENT DETAILS MOBILE ===== */
@media (max-width: 768px) {
    .event-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .event-card {
        padding: 1.5rem 1rem;
    }

    .event-icon {
        font-size: 2rem;
    }

    .event-card h3 {
        font-size: 1.25rem;
    }

    .event-card p {
        font-size: 0.95rem;
    }
}

/* ===== COUPLE SECTION MOBILE ===== */
@media (max-width: 768px) {
    .couple-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .couple-card {
        padding: 1.5rem;
    }

    .couple-photo {
        width: 150px;
        height: 150px;
    }

    .couple-name {
        font-size: 1.5rem;
    }
}

/* ===== GALLERY SECTION MOBILE ===== */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gallery-item {
        border-radius: 8px;
    }

    .gallery-item img {
        border-radius: 8px;
    }
}

/* ===== VIDEO GALLERY MOBILE ===== */
@media (max-width: 768px) {
    .video-gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .video-card {
        border-radius: 12px;
    }

    .video-wrapper {
        border-radius: 12px 12px 0 0;
    }

    .play-icon-large {
        font-size: 3rem;
    }

    .video-info {
        padding: 1rem;
    }

    .video-info h3 {
        font-size: 1.25rem;
    }

    .video-info p {
        font-size: 0.9rem;
    }
}

/* ===== WISHES SECTION MOBILE ===== */
@media (max-width: 768px) {
    .wishes-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .wishes-form-wrapper {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .wishes-form label {
        font-size: 0.95rem;
    }

    .wishes-form input,
    .wishes-form textarea {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .submit-wish-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .wishes-display {
        padding: 1.5rem;
        max-height: 500px;
        border-radius: 12px;
    }

    .wishes-display-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .wish-card {
        padding: 1rem;
        border-radius: 8px;
    }

    .wish-icon {
        font-size: 1.25rem;
    }

    .wish-author {
        font-size: 0.95rem;
    }

    .wish-message {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .wish-date {
        font-size: 0.75rem;
    }
}

/* ===== RSVP SECTION MOBILE ===== */
@media (max-width: 768px) {
    .rsvp-form {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.95rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.75rem;
        font-size: 0.95rem;
        border-radius: 6px;
    }

    .submit-button {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* ===== LOCATION SECTION MOBILE ===== */
@media (max-width: 768px) {
    .location-info {
        padding: 1.5rem;
    }

    .location-name {
        font-size: 1.5rem;
    }

    .location-address {
        font-size: 0.95rem;
    }

    .map-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .map-container {
        height: 300px;
        border-radius: 12px;
    }
}

/* ===== FOOTER MOBILE ===== */
@media (max-width: 768px) {
    .footer {
        padding: 2rem 0 1.5rem;
    }

    .footer-content p {
        font-size: 0.85rem;
    }
}

/* ===== SMALL PHONES OPTIMIZATION (320px - 480px) ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .section {
        padding: 1.5rem 0;
    }

    .section-title {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    .vintage-frame {
        padding: 1rem 0.75rem;
    }

    .hero-names {
        font-size: clamp(2rem, 12vw, 3rem);
    }

    .countdown {
        gap: 0.5rem;
    }

    .countdown-item {
        padding: 0.75rem 0.25rem;
    }

    .event-card {
        padding: 1.25rem 0.75rem;
    }

    .wishes-form-wrapper,
    .wishes-display,
    .rsvp-form {
        padding: 1rem;
    }

    .video-control-btn {
        width: 50px;
        height: 50px;
        bottom: 70px;
        right: 15px;
    }
}

/* ===== TOUCH OPTIMIZATION ===== */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets for mobile */
    button,
    a.hero-button,
    .submit-button,
    .submit-wish-btn,
    .map-button,
    .video-control-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .gallery-item:hover,
    .video-card:hover,
    .event-card:hover,
    .wish-card:hover {
        transform: none;
    }

    /* Tap highlight color */
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* ===== LANDSCAPE MODE MOBILE ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
    }

    .hero-content {
        padding: 0.5rem;
    }

    .vintage-frame {
        padding: 1rem;
    }

    .hero-names {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    .video-control-btn {
        bottom: 20px;
        right: 20px;
    }

    .scroll-indicator {
        bottom: 15px;
    }
}

/* ===== ACCESSIBILITY - REDUCE MOTION ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .floating-elements {
        display: none;
    }
}

/* ===== PERFORMANCE OPTIMIZATION ===== */
@media (max-width: 768px) {

    /* Reduce animation complexity on mobile */
    .animate-on-scroll {
        transition-duration: 0.4s;
    }

    /* Simplify shadows on mobile for better performance */
    .video-card,
    .event-card,
    .wish-card,
    .wishes-form-wrapper,
    .wishes-display {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
}

/* =========================================
   REVISION UPDATES - MOBILE VIDEO FIX
   ========================================= */

@media (max-width: 991px) {

    /* Make video darker on mobile for better text readability */
    .global-video-overlay {
        background: rgba(0, 0, 0, 0.85) !important;
    }

    /* Mobile viewport with dark background overlay similar to cover page */
    #mobile-viewport {
        background: url('assets/images/opening.jpg') center center / cover no-repeat fixed !important;
        background-color: #000000 !important;
        position: relative !important;
    }

    /* Dark overlay for mobile viewport */
    #mobile-viewport::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.11);
        z-index: 0;
        pointer-events: none;
    }

    /* Ensure all content is above the overlay */
    #invitation-content,
    .hero,
    section {
        position: relative !important;
        z-index: 1 !important;
    }

    /* Keep sections without their own backgrounds */
    section:not(#cover-page) {
        background: transparent !important;
    }

    /* Cover page with background image - FULL SCREEN */
    #cover-page {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        min-height: 100vh !important;
        min-height: 100svh !important;
        /* Small viewport height for mobile */
        background: url('assets/images/opening.jpg') center 20% / cover no-repeat !important;
        background-color: #000000 !important;
        z-index: 9999 !important;
    }

    /* Dark overlay for text readability on cover page */
    #cover-page::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(to bottom,
                rgba(0, 0, 0, 0.4) 0%,
                rgba(0, 0, 0, 0.6) 50%,
                rgba(0, 0, 0, 0.7) 100%);
        z-index: 0;
    }

    /* Ensure cover content is above the overlay */
    .cover-content {
        position: relative !important;
        z-index: 1 !important;
    }

    .cover-content {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* GLOBAL VIDEO is handled in style.css #global-video-container */

    /* Ensure .hero-video and .cover-video are hidden/ignored if they still exist for some reason */
    .hero-video,
    .cover-video {
        display: none !important;
    }

    .hero {
        background: transparent !important;
        position: relative;
        z-index: 1;
    }

    /* All sections transparent to show video */
    .verse-section,
    .invitation-section,
    .couple-section,
    .countdown-section,
    .event-section,
    .gallery-section,
    .gift-section,
    .rsvp-section,
    .wishes-section,
    .video-gallery-section,
    .footer-section {
        background: transparent !important;
        background-color: transparent !important;
        position: relative;
        z-index: 2;
    }

    /* Cards and form wrappers need Glassmorphism background */
    .vintage-frame,
    .countdown-item,
    .event-card,
    .gift-card,
    .rsvp-form,
    .wishes-form-wrapper,
    .wishes-display,
    .video-card {
        background: var(--glass-bg) !important;
        backdrop-filter: var(--glass-blur) !important;
        -webkit-backdrop-filter: var(--glass-blur) !important;
        border: 1px solid var(--glass-border) !important;
        position: relative;
        z-index: 3;
        box-shadow: var(--glass-shadow);
    }

    /* Cover guest info should NOT be blurry */
    .cover-guest-info {
        background: rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
    }

    /* Couple photo styling */
    .couple-photo {
        background: var(--glass-bg) !important;
        border: 1px solid var(--glass-border) !important;
        backdrop-filter: var(--glass-blur) !important;
        position: relative;
        z-index: 3;
    }

    /* Couple section specific fix */
    .couple-card {
        background: transparent !important;
        position: relative;
        z-index: 3;
    }

    /* Gallery items */
    .gallery-item {
        background: transparent !important;
        position: relative;
        z-index: 3;
    }

    /* QRIS modal should be above everything */
    .qris-modal {
        z-index: 9999 !important;
    }

    /* QRIS modal content should have dark transparent bg */
    .qris-modal-content {
        background: rgba(0, 0, 0, 0.95) !important;
        position: relative;
        z-index: 10000;
        color: #fff !important;
    }

    .qris-modal-content h3 {
        color: #fff !important;
    }

    /* Ensure cover page is above video when visible */
    #cover-page {
        z-index: 9998 !important;
    }

    /* Ensure all text is readable with text shadow */
    .section-title,
    .hero-names,
    .hero-subtitle,
    .hero-date,
    .couple-name,
    .event-title,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p {
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8) !important;
    }

    /* Force remove any white backgrounds at footer/bottom */
    .footer-section,
    .footer-content,
    footer,
    .footer-message,
    .footer-names,
    .footer-credit {
        background: transparent !important;
        background-color: transparent !important;
    }

    /* Ensure all sections at bottom have transparent background */
    section:last-child,
    .section:last-child,
    #invitation-content>section:last-of-type {
        background: transparent !important;
        background-color: transparent !important;
        padding-bottom: 3rem !important;
    }

    /* Remove any potential white space at bottom */
    #mobile-viewport::after,
    #invitation-content::after {
        content: none !important;
        display: none !important;
    }

    /* Ensure body and html extend full height */
    html,
    body {
        min-height: 100vh !important;
        background: transparent !important;
    }

    /* Notification styling for mobile - ensure it shows above everything */
    .notification {
        position: fixed !important;
        z-index: 99999 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Force glass background for all form inputs on mobile */
    input,
    select,
    textarea {
        background: var(--glass-bg) !important;
        color: #fff !important;
        border: 1px solid var(--glass-border) !important;
        backdrop-filter: var(--glass-blur) !important;
    }

    /* Placeholder styling for mobile */
    input::placeholder,
    textarea::placeholder {
        color: rgba(255, 255, 255, 0.6) !important;
    }

    input:focus,
    select:focus,
    textarea:focus {
        background: rgba(0, 0, 0, 0.6) !important;
        border-color: #fff !important;
        outline: none !important;
    }

    /* Ensure select dropdown text is visible */
    select option {
        background: #000 !important;
        color: #fff !important;
    }
}

/* FORCE GLOBAL TRANSPARENT BACKGROUND */
html,
body {
    background: transparent !important;
}

#mobile-viewport {
    background: transparent !important;
}