:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #f59e0b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(245, 158, 11, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.header-logo-img {
    height: 70px;
    width: auto;
    display: block;
    margin-bottom: 0.25rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.header-logo .subtitle {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.header-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.header-nav a:hover {
    color: white;
}

.header-nav .btn-highlight {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
}

.header-nav .btn-highlight:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Common Components */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    color: white;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.full-width {
    width: 100%;
}

/* Sections Layout */
.top-grid,
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    margin-bottom: 3rem;
    /* Increased margin to avoid overlap with next section */
    align-items: start;
    /* Allow cards to have natural height */
}

/* About Section */
.intro-text {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.features-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.feature-item i {
    color: var(--accent);
    width: 20px;
}

/* Gallery Section */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.badge {
    background: var(--glass-border);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.media-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    /* Take available space */
}

.media-main {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(to bottom, #1e293b, #0f172a);
    /* Lighter background to see black waveforms */
    min-height: 200px;
    /* Reduced min-height */
    max-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    position: relative;
}

.gallery-video,
.gallery-img-main {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Mantener aspect ratio del video */
    max-height: 350px;
    animation: fadeIn 0.3s ease;
}

.mini-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: auto;
    /* Push to bottom if extra space */
}

.mini-thumb-img {
    width: 100%;
    height: 60px;
    /* Reduced height */
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px;
    /* Small padding to frame content */
}

.mini-thumb-img:hover,
.mini-thumb-img.active {
    opacity: 1;
    transform: scale(1.05);
    border-color: var(--primary);
}

/* Calendar Section - Prominent */
.calendar-section {
    margin-bottom: 2rem;
    min-height: 500px;
    /* Make it big */
}

.calendar-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--primary);
}

.calendar-grid-header,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 2px;
}

.calendar-grid-header {
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

.calendar-grid {
    background: transparent;
    gap: 4px;
    /* Space between cells */
}

.calendar-day {
    background: rgba(255, 255, 255, 0.03);
    min-height: 120px;
    /* Taller cells */
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.calendar-day:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
}

.day-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.calendar-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot.free {
    border: 1px solid var(--text-muted);
    /* Empty circle */
}

.dot.partial {
    background-color: var(--accent);
}

.dot.busy {
    background-color: var(--danger);
}

/* FAQs */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-available {
    color: var(--success);
}

.status-partial {
    color: var(--accent);
}

.status-busy {
    color: var(--danger);
}

details {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 0.5rem;
    transition: var(--transition);
}

details[open] {
    background: rgba(255, 255, 255, 0.06);
}

summary {
    padding: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    list-style: none;
    /* Hide default triangle */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--accent);
}

details[open] summary::after {
    content: '-';
}

details p {
    padding: 0 0.75rem 1rem 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

/* Contact */
.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact-item i {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.contact-item .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.contact-item .value {
    font-size: 1.1rem;
    font-weight: 500;
    color: white;
}

.contact-item .value.link {
    color: var(--primary);
    text-decoration: none;
}

.contact-item .value.link:hover {
    text-decoration: underline;
}

/* Modal */
.hidden {
    display: none;
}

/* ===== Dialog Modal System ===== */
/* Native <dialog> renders in the browser's "top layer" - no stacking context issues */
.modal-dialog {
    border: none;
    background: transparent;
    padding: 0;
    margin: auto; /* Center natively */
    max-width: 450px;
    width: calc(100% - 2rem);
    max-height: 90vh;
    overflow: visible;
}

.modal-dialog::backdrop {
    background: rgba(0, 0, 0, 0.85);
}

.modal-card {
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem; /* Ensure correct padding to avoid text touching the edges */
    position: relative;
    color: var(--text-main);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); /* Adding shadow to look good */
    max-height: 90vh;
    overflow-y: auto;
}

/* Modal Stepper */
.modal-step {
    display: none !important;
}

.modal-step.active {
    display: block !important;
}

.day-status-info {
    text-align: center;
    padding: 1rem 0 2rem 0;
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.status-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.status-subtext {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
}

/* Custom UI Controls */
.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
}

.segment-btn {
    flex: 1;
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.segment-btn.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.time-grid::-webkit-scrollbar {
    width: 6px;
}
.time-grid::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

.time-grid.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.time-slot {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-muted);
    padding: 0.6rem 0;
    text-align: center;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.time-slot:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.time-slot.hover-range {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary);
    color: white;
}

.time-slot.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

.empty-state {
    grid-column: span 4;
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}




.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 0.5rem;
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    color: white;
}

/* Booking Code Confirmation Modal */
.booking-code-modal {
    text-align: center;
    max-width: 420px;
}

.booking-code-content {
    padding: 1rem;
}

.booking-code-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    70% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.booking-code-content h2 {
    border: none;
    padding: 0;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    color: var(--success);
}

.booking-code-intro {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.booking-code-display {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
    border: 2px dashed var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 6px;
    color: white;
    text-shadow: 0 2px 10px rgba(59, 130, 246, 0.5);
    margin-bottom: 1.5rem;
    user-select: all;
    cursor: pointer;
    transition: var(--transition);
}

.booking-code-display:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(16, 185, 129, 0.3));
    transform: scale(1.02);
}

.booking-code-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    text-align: left;
}

.booking-code-warning i {
    color: var(--accent);
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.booking-code-warning p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.booking-code-warning strong {
    color: var(--accent);
}

.booking-code-warning em {
    color: var(--text-main);
}

/* Calendar Actions */
.calendar-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.calendar-actions button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Manage Booking Modal */
.manage-booking-modal {
    max-width: 450px;
}

.manage-booking-content h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
    padding: 0;
    margin-bottom: 1rem;
}

.manage-booking-content h2 i {
    color: var(--primary);
}

.manage-intro {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Booking Info Card */
.booking-info-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.booking-info-card h4 {
    color: var(--success);
    margin-bottom: 1rem;
    font-size: 1rem;
    text-align: center;
}

.booking-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.booking-info-row:last-child {
    border-bottom: none;
}

.booking-info-row .label {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.booking-info-row .label i {
    color: var(--primary);
    width: 16px;
}

.booking-info-row .value {
    color: white;
    font-weight: 500;
}

/* Danger Button */
.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* Copy Code Button */
.btn-copy-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    margin-bottom: 1.25rem;
    background: rgba(59, 130, 246, 0.12);
    border: 1px dashed var(--primary);
    color: var(--primary);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy-code:hover {
    background: rgba(59, 130, 246, 0.22);
}

.btn-copy-code.copied {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    color: var(--success);
}

/* ===== RESPONSIVE: Tablet ===== */
@media (max-width: 900px) {

    .app-container {
        padding: 1.5rem;
    }

    .top-grid,
    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .booking-code-display {
        font-size: 2rem;
        letter-spacing: 4px;
        padding: 1rem;
    }

    .calendar-day {
        min-height: 80px;
    }
}

/* ===== RESPONSIVE: Mobile ===== */
@media (max-width: 600px) {

    /* --- App Container --- */
    .app-container {
        padding: 1rem;
    }

    /* --- Header --- */
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .header-logo-img {
        height: 50px;
    }

    .header-logo .subtitle {
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }

    .header-nav {
        width: 100%;
        gap: 0;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        overflow: hidden;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }

    .header-nav a {
        padding: 0.65rem 0.25rem;
        text-align: center;
        font-size: 0.75rem;
        border-right: 1px solid var(--glass-border);
    }

    .header-nav a:last-child {
        border-right: none;
    }

    .header-nav .btn-highlight {
        border-radius: 0;
        padding: 0.65rem 0.25rem;
    }

    /* --- Glass Panels --- */
    .glass-panel {
        padding: 1.25rem;
        border-radius: 16px;
    }

    h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    /* --- About / Features --- */
    .intro-text {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .features-list {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* --- Gallery --- */
    .media-main {
        min-height: 180px;
        max-height: 240px;
    }

    .mini-gallery {
        grid-template-columns: repeat(4, 1fr);
    }

    .mini-thumb-img {
        height: 50px;
    }

    /* --- Calendar --- */
    .calendar-section {
        min-height: auto;
    }

    .calendar-header-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .calendar-header-wrapper h2 {
        margin-bottom: 0;
    }

    .calendar-grid-header span,
    .calendar-grid-header {
        font-size: 0.65rem;
        letter-spacing: 0;
    }

    .calendar-day {
        min-height: 52px;
        padding: 0.35rem;
        border-radius: 6px;
    }

    .day-number {
        font-size: 0.85rem;
        margin-bottom: 0.2rem;
    }

    .calendar-legend {
        gap: 0.75rem;
        flex-wrap: wrap;
        font-size: 0.8rem;
        margin-top: 1rem;
    }

    .calendar-actions {
        margin-top: 1rem;
    }

    /* --- FAQs --- */
    summary {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    details p {
        font-size: 0.88rem;
    }

    /* --- Contact --- */
    .contact-methods {
        gap: 1rem;
        margin: 1rem 0;
    }

    .contact-item .value {
        font-size: 0.95rem;
    }

    /* --- Modals --- */
    .modal-dialog {
        max-width: 100%;
        width: calc(100% - 1rem);
        margin: auto 0.5rem;
    }

    .modal-card {
        padding: 1.25rem;
        border-radius: 16px;
    }

    /* --- Time Grid in Modal --- */
    .time-grid {
        grid-template-columns: repeat(3, 1fr);
        max-height: 160px;
    }

    .time-slot {
        padding: 0.5rem 0;
        font-size: 0.8rem;
    }

    /* --- Segmented Controls --- */
    .segment-btn {
        padding: 0.65rem 0.25rem;
        font-size: 0.8rem;
    }

    /* --- Booking Code Display --- */
    .booking-code-display {
        font-size: 1.75rem;
        letter-spacing: 3px;
        padding: 1rem;
    }

    /* --- Buttons --- */
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        padding: 0.7rem 1rem;
        font-size: 0.95rem;
    }
}