:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --accent-color: #0e7490;
}

html, body { 
    font-family: 'Outfit', sans-serif; 
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-x: none;
    /* Updated to 'Deep Ocean' Theme: Slate to Teal */
    background: linear-gradient(135deg, var(--bg-color) 0%, #1e293b 50%, var(--accent-color) 100%);
    min-height: 100vh;
}

/* Mobile scroll-snap pages */
@media (max-width: 768px) {
    main {
        scroll-snap-type: y mandatory;
    }
    .mobile-page {
        scroll-snap-align: start;
        padding-top: env(safe-area-inset-top, 1rem); /* Safe area support */
        padding-bottom: 1rem;
    }
    /* Compact form on mobile */
    .glass-panel {
        padding: 1rem !important;
    }
    .glass-panel header {
        margin-bottom: 1rem !important;
    }
    .glass-panel h1 {
        font-size: 1.75rem !important;
    }
    .glass-panel .space-y-6 {
        gap: 0.75rem !important;
    }
    .glass-panel input[type="text"] {
        padding: 0.75rem !important;
        font-size: 16px !important; /* Prevent iOS auto-zoom */
    }
    .glass-panel button[type="submit"] {
        padding: 0.875rem !important;
        font-size: 1rem !important;
    }
    /* Full-screen card view on mobile */
    .mobile-card-active #form-section {
        display: none !important;
    }
    .mobile-card-active #guest-card-container {
        min-height: 100svh;
        display: flex !important;
        align-items: center;
        justify-content: center;
        animation: fadeSlideIn 0.4s ease-out;
        padding-top: env(safe-area-inset-top, 2rem);
    }
    /* Edit Details Button adjustments */
    .mobile-back-button {
        top: 2rem !important;
        left: 2rem !important;
    }
    
    /* Hide card when editing on mobile */
    body:not(.mobile-card-active) #guest-card-container {
        display: none !important;
    }
    body:not(.mobile-card-active) #form-section {
        animation: fadeSlideIn 0.4s ease-out;
    }
    
    @keyframes fadeSlideIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Glassmorphism Classes */
.glass-panel {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.glass-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}
.glass-input:focus {
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
}

.glass-button {
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}
.glass-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0.2) 100%);
}

/* Print Styles */
@media print {
    @page { margin: 0; size: auto; }
    html, body { 
        background: white !important; 
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    
    /* Hide EVERYTHING except print area */
    body > *:not(#print-area) { 
        display: none !important; 
    }

    /* Show print area */
    #print-area {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        height: 100% !important; 
        min-height: 100vh;
        z-index: 99999 !important;
        background: white !important; /* Ink-friendly white */
        padding: 0;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    /* Reset card styles within print area */
    #guest-card {
        margin: 0 !important;
        transform: scale(1) !important;
    }
}


/* Ensure print area is hidden by default on screen */
#print-area { display: none; }

/* Footer Adjustments */
@media (max-width: 768px) {
    /* Ensure content doesn't get hidden behind the fixed footer on mobile */
    main {
        padding-bottom: 5rem; 
    }
}

/* Custom Details Marker */
details > summary {
    list-style: none; /* Firefox/Standard */
    position: relative;
    /* padding-right: 2.5rem; Space for the arrow */ 
}
details > summary::-webkit-details-marker {
    display: none; /* Chrome/Safari */
}
details > summary::after {
    content: '❯'; 
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    transition: transform 0.3s ease;
    font-size: 0.8em;
    opacity: 0.7;
    color: white;
}
details[open] > summary::after {
    transform: translateY(-50%) rotate(270deg);
}

/* Accordion Animation */
details {
    overflow: hidden;
    transition: height 0.3s ease-out;
}

/* Dynamic Height & Scrolling removed to allow natural page layout */
/* Smooth Collapse/Expand Utility */
.smooth-collapse {
    /* 
       Using 80px as a "safe" max-height for single input fields/text rows.
       The delay comes from animating 200px -> 0px when content is only 50px. 
       Reducing this minimizes the invisible part of the animation.
    */
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                margin 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 100px; 
    opacity: 1;
    overflow: hidden;
}
.smooth-collapse.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border: none !important;
}

/* Attention seeking pulse for update button */
@keyframes softPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.btn-update-needed {
    background: linear-gradient(135deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.3) 100%) !important;
    animation: softPulse 2s infinite;
    border-color: rgba(255,255,255,0.8) !important;
    transform: scale(1.02);
}
