/**
 * Show Details Modal Styles
 *
 * Design follows SeattleArtists modal pattern:
 * - Glass effect with blurred background image
 * - Full screen on mobile, centered modal on desktop
 * - Dark theme with design token variables
 */

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

.sdm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000; /* Base value - modalStackManager overrides dynamically */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

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

.sdm-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;
}

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

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

    .sdm-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);
    }
}

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

/* ============================================
   BACKGROUND WITH IMAGE EFFECT
   (Matching SeattleArtists modal pattern)
   ============================================ */

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

/* Background image layer at 50% opacity */
.sdm-show-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--show-bg-image);
    background-size: cover;
    background-position: center top;
    opacity: 0.5;
    z-index: 0;
}

/* Gradient overlay for readability */
.sdm-show-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.6) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    z-index: 1;
}

.sdm-show-bg > * {
    position: relative;
    z-index: 2;
}

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

.sdm-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);
}

.sdm-close-btn,
.sdm-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;
}

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

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

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

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

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

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

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

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

/* ============================================
   SHOW HEADER
   ============================================ */

.sdm-show-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 */
}

.sdm-show-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    background: var(--bg-secondary, #1a1a1a);
}

.sdm-show-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sdm-show-image img.venue-logo-fallback {
    object-fit: contain;
    padding: 16px;
    background: var(--bg-tertiary, #222);
}

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

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

.sdm-show-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 8px);
}

.sdm-date {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    line-height: 1.2;
}

.sdm-venue-name {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary, #aaa);
    margin: 0;
}

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

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

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

.sdm-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);
}

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

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

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

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

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

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

/* Calendar dropdown */
.sdm-calendar-dropdown {
    position: relative;
}

.sdm-calendar-trigger {
    padding-right: 10px;
}

.sdm-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.sdm-calendar-dropdown.open .sdm-chevron {
    transform: rotate(180deg);
}

.sdm-calendar-menu {
    position: fixed;
    min-width: 180px;
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 10002;
}

.sdm-calendar-dropdown.open .sdm-calendar-menu,
.sdm-calendar-menu--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sdm-calendar-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary, #fff);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sdm-calendar-option:first-child {
    border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
}

.sdm-calendar-option:last-child {
    border-radius: 0 0 var(--radius-lg, 12px) var(--radius-lg, 12px);
}

.sdm-calendar-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Save button in action row - grey glass (matches other buttons) */
.sdm-btn-save {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary, #fff);
}

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

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

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

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

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

.sdm-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);
}

.sdm-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);
}

/* ============================================
   ARTIST CARDS
   ============================================ */

.sdm-lineup {
    display: flex;
    flex-direction: column;
    gap: var(--space-3, 12px);
}

.sdm-artist-card {
    display: flex;
    gap: var(--space-3, 12px);
    padding: var(--space-3, 12px);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg, 12px);
    cursor: pointer;
    transition: background 0.15s ease;
}

.sdm-artist-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Cards without artist_id are not clickable */
.sdm-artist-card:not([data-artist-id]) {
    cursor: default;
}

.sdm-artist-card:not([data-artist-id]):hover {
    background: rgba(255, 255, 255, 0.05);
}

.sdm-artist-image {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
    background: var(--bg-tertiary, #222);
}

.sdm-artist-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sdm-artist-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary, #222);
    color: var(--text-tertiary, #666);
    font-size: 24px;
    font-weight: 600;
}

.sdm-artist-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Name row with play button */
.sdm-artist-name-row {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
}

.sdm-artist-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

/* Play button - styled like action menu */
.sdm-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: var(--bg-tertiary, #2a2a2a);
    border: 1px solid var(--border-primary, #333);
    border-radius: 50%;
    color: var(--text-secondary, #999);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.sdm-play-btn:hover {
    background: var(--accent-primary, #1DB954);
    border-color: var(--accent-primary, #1DB954);
    color: var(--text-inverse, #121212);
}

.sdm-play-btn.playing {
    background: var(--accent-primary, #1DB954);
    border-color: var(--accent-primary, #1DB954);
    color: var(--text-inverse, #121212);
}

.sdm-play-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Play icon - slight offset for visual centering */
.sdm-play-btn .sdm-icon-play {
    margin-left: 2px;
}

/* Pause icon - hidden by default */
.sdm-play-btn .sdm-icon-pause {
    display: none;
}

/* Playing state - swap icon visibility */
.sdm-play-btn.playing .sdm-icon-play {
    display: none;
}

.sdm-play-btn.playing .sdm-icon-pause {
    display: flex;
}

/* Genre line */
.sdm-artist-genre {
    font-size: 13px;
    color: var(--text-secondary, #aaa);
}

.sdm-artist-genre strong {
    color: var(--text-primary, #fff);
    font-weight: 500;
}

.sdm-genre-arrow {
    color: var(--text-tertiary, #666);
    margin: 0 2px;
}

/* Location */
.sdm-artist-location {
    font-size: 12px;
    color: var(--text-tertiary, #888);
}

/* Bio */
.sdm-artist-bio {
    font-size: 13px;
    color: var(--text-tertiary, #888);
    line-height: 1.4;
    margin-top: 4px;
}

/* Genre tags */
.sdm-artist-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.sdm-tag {
    font-size: 11px;
    color: var(--text-tertiary, #888);
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: var(--radius-sm, 4px);
}

/* ============================================
   VENUE FOOTER
   ============================================ */

.sdm-venue-footer {
    display: flex;
    align-items: center;
    gap: var(--space-3, 12px);
    padding: var(--space-4, 16px);
    background: rgba(30, 30, 30, 0.6);
    border-radius: var(--radius-xl, 16px);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    transition: background 0.15s ease;
}

.sdm-venue-footer:hover {
    background: rgba(50, 50, 50, 0.7);
}

.sdm-venue-logo {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
    background: var(--bg-tertiary, #222);
}

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

.sdm-venue-details {
    flex: 1;
    min-width: 0;
}

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

.sdm-venue-footer-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #fff);
}

.sdm-venue-address {
    font-size: 12px;
    color: var(--text-tertiary, #888);
    margin-top: 2px;
}

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

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

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

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

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

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

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

    .sdm-show-image {
        width: 100px;
        height: 100px;
    }

    .sdm-date {
        font-size: 18px;
    }

    .sdm-actions {
        gap: 6px;
    }

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

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

/* ============================================
   IMAGE LIGHTBOX
   ============================================ */

.sdm-show-image--clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sdm-show-image--clickable:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.sdm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    cursor: zoom-out;
}

.sdm-lightbox.sdm-lightbox--visible {
    opacity: 1;
    visibility: visible;
}

.sdm-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.sdm-lightbox.sdm-lightbox--visible img {
    transform: scale(1);
}

.sdm-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    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;
    transition: background 0.15s ease, color 0.15s ease;
}

.sdm-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary, #fff);
}

.sdm-lightbox-close svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   SIMILAR SHOWS SECTION
   ============================================ */

.sdm-similar-shows-section {
    /* Uses existing .sdm-section styles */
}

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

/* Inline loading spinner (smaller, for sections) */
.sdm-loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4, 16px);
    color: var(--text-tertiary, #888);
}

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

/* Show more button */
.sdm-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;
}

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

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

body.sdm-open {
    overflow: hidden;
}

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

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

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

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

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

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