/**
 * Venue Details Modal Styles
 *
 * Design follows artist_details and show_details modal patterns:
 * - Glass effect with blurred background image
 * - Full screen on mobile, centered modal on desktop
 * - Dark theme with design token variables
 *
 * Modal z-index: All modals start at 10000 base.
 * The modalStackManager.js dynamically assigns higher z-index values
 * to modals opened later, ensuring proper stacking regardless of order.
 */

/* ============================================
   MODAL OVERLAY & CONTAINER
   ============================================ */

.vdm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.vdm-overlay[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.vdm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.vdm-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--bg-primary, #121212);
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.vdm-overlay[aria-hidden="false"] .vdm-container {
    transform: translateY(0);
}

/* Desktop: top-aligned modal with border radius, below sticky nav */
@media (min-width: 768px) {
    .vdm-overlay {
        top: var(--desktop-nav-height, 48px); /* Start below sticky nav */
        align-items: flex-start;
        padding-top: 3vh;
    }

    .vdm-container {
        height: auto;
        max-height: calc(100vh - var(--desktop-nav-height, 48px) - 6vh); /* Account for nav + padding */
        border-radius: var(--radius-xl, 16px);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
}

.vdm-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   BACKGROUND WITH IMAGE EFFECT
   ============================================ */

.vdm-venue-bg {
    position: relative;
    min-height: 100%;
    padding: var(--space-4, 16px);
}

/* Background image layer - pinned to top with fade */
.vdm-venue-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 350px;
    background-image: var(--venue-bg-image);
    background-size: cover;
    background-position: center top;
    opacity: 0.5;
    z-index: 0;
    mask-image: linear-gradient(to bottom, black 0%, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 60%, transparent 100%);
}

/* Gradient overlay for readability */
.vdm-venue-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 0, 0, 0.5) 200px,
        rgba(0, 0, 0, 0.85) 350px,
        rgba(0, 0, 0, 0.85) 100%
    );
    z-index: 1;
}

.vdm-venue-bg > * {
    position: relative;
    z-index: 2;
}

/* ============================================
   HEADER BAR (Close & Share)
   ============================================ */

.vdm-header-bar {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2, 8px);
    padding: var(--space-3, 12px);
}

.vdm-close-btn,
.vdm-share-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary, #999);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1, 4px);
    transition: background 0.15s ease, color 0.15s ease, width 0.15s ease, padding 0.15s ease;
}

.vdm-close-btn:hover,
.vdm-share-btn:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.15));
    color: var(--text-primary, #fff);
}

.vdm-close-btn svg,
.vdm-share-btn svg {
    width: 20px;
    height: 20px;
}

/* Share button - check icon hidden by default */
.vdm-share-btn .vdm-check-icon {
    display: none;
}

/* Share label hidden by default */
.vdm-share-label {
    display: none;
    font-size: 14px;
    font-weight: 500;
}

/* Share button copied state */
.vdm-share-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    width: auto;
    padding: 0 12px;
    border-radius: 18px;
}

.vdm-share-btn.copied .vdm-share-icon {
    display: none;
}

.vdm-share-btn.copied .vdm-check-icon {
    display: block;
}

.vdm-share-btn.copied .vdm-share-label {
    display: inline;
}

/* ============================================
   VENUE HEADER
   ============================================ */

.vdm-venue-header {
    display: flex;
    gap: var(--space-4, 16px);
    margin-bottom: var(--space-4, 16px);
    padding-top: var(--space-8, 32px); /* Space for close/share buttons */
}

.vdm-venue-logo {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    background: var(--bg-secondary, #1a1a1a);
}

.vdm-venue-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.vdm-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary, #222);
}

.vdm-image-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--text-tertiary, #666);
}

.vdm-venue-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1, 4px);
}

.vdm-name-row {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
}

.vdm-venue-name {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin: 0;
    line-height: 1.2;
}

.vdm-location {
    font-size: 14px;
    color: var(--text-secondary, #aaa);
}

.vdm-address {
    font-size: 13px;
    color: var(--text-tertiary, #888);
}

/* ============================================
   STATS BAR
   ============================================ */

.vdm-stats-bar {
    display: flex;
    gap: var(--space-4, 16px);
    padding: var(--space-3, 12px) var(--space-4, 16px);
    background: rgba(30, 30, 30, 0.6);
    border-radius: var(--radius-lg, 12px);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin-bottom: var(--space-3, 12px);
}

.vdm-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vdm-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    line-height: 1;
}

.vdm-stat-label {
    font-size: 12px;
    color: var(--text-tertiary, #888);
}


/* ============================================
   ACTION BUTTONS
   ============================================ */

.vdm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2, 8px);
    margin-top: var(--space-3, 12px);
}

.vdm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-lg, 12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.vdm-btn:active {
    transform: scale(0.97);
}

.vdm-btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Soundcheck - Green glass */
.vdm-btn-primary {
    background: rgba(29, 185, 84, 0.25);
    border-color: rgba(29, 185, 84, 0.4);
    color: #1DB954;
}

.vdm-btn-primary:hover {
    background: rgba(29, 185, 84, 0.35);
    border-color: rgba(29, 185, 84, 0.6);
}

/* Grey glass - used by Tickets */
.vdm-btn-outline {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary, #fff);
}

.vdm-btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Save button - Grey glass */
.vdm-btn-save {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary, #fff);
}

.vdm-btn-save:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.vdm-btn-save.vdm-favorited {
    background: rgba(255, 77, 109, 0.2);
    border-color: rgba(255, 77, 109, 0.4);
    color: #ff4d6d;
}

.vdm-btn-save.vdm-favorited:hover {
    background: rgba(255, 77, 109, 0.3);
    border-color: rgba(255, 77, 109, 0.5);
}

.vdm-btn-label {
    font-size: inherit;
}

/* ============================================
   SECTIONS
   ============================================ */

.vdm-section {
    background: rgba(30, 30, 30, 0.6);
    border-radius: var(--radius-xl, 16px);
    padding: var(--space-4, 16px);
    margin-bottom: var(--space-4, 16px);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.vdm-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary, #888);
    margin: 0 0 var(--space-3, 12px);
}

/* ============================================
   SHOWS LIST
   ============================================ */

.vdm-shows-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 8px);
}

/* No shows message */
.vdm-no-shows {
    font-size: 14px;
    color: var(--text-tertiary, #888);
    margin: 0;
}

/* Show more button */
.vdm-show-more {
    display: block;
    width: 100%;
    padding: var(--space-3, 12px);
    margin-top: var(--space-2, 8px);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #aaa);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg, 12px);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.vdm-show-more:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

/* ============================================
   ARTIST CARDS (Top Artists Section)
   ============================================ */

.vdm-artists-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 8px);
}

/* Artist cards now rendered by artist_card component */

/* ============================================
   LOADING STATE
   ============================================ */

.vdm-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-tertiary, #888);
}

.vdm-loading::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: vdm-spin 0.8s linear infinite;
}

@keyframes vdm-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   ERROR STATE
   ============================================ */

.vdm-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: var(--space-4, 16px);
    color: var(--text-tertiary, #888);
    text-align: center;
    font-size: 14px;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 767px) {
    .vdm-container {
        max-height: 100%;
        border-radius: 0;
    }

    /* Add padding at bottom for mobile nav bar */
    .vdm-venue-bg {
        padding-bottom: calc(var(--space-4, 16px) + 52px + env(safe-area-inset-bottom, 34px));
    }

    .vdm-venue-logo {
        width: 80px;
        height: 80px;
    }

    .vdm-venue-name {
        font-size: 20px;
    }

    .vdm-stats-bar {
        gap: var(--space-3, 12px);
        padding: var(--space-2, 8px) var(--space-3, 12px);
    }

    .vdm-stat-value {
        font-size: 20px;
    }

    .vdm-stat-label {
        font-size: 11px;
    }

    .vdm-actions {
        gap: 6px;
    }

    .vdm-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .vdm-btn-icon {
        width: 14px;
        height: 14px;
    }

    .vdm-show-date {
        width: 70px;
        font-size: 12px;
    }

    .vdm-show-artists {
        font-size: 13px;
    }
}

/* ============================================
   BODY SCROLL LOCK
   ============================================ */

body.vdm-open {
    overflow: hidden;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

/* Firefox */
.vdm-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Chrome, Safari, Edge */
.vdm-content::-webkit-scrollbar {
    width: 6px;
}

.vdm-content::-webkit-scrollbar-track {
    background: transparent;
}

.vdm-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.vdm-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}
