/* Info Modal Styles — Dark Space Theme */
.info-modal {
    display: none;
    position: fixed;
    -webkit-tap-highlight-color: transparent;
    z-index: 2000;
    inset: 0;
    width: 100%;
    min-height: 100%;
    background: rgba(3, 0, 10, 0.74);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
}

.info-modal[open] {
    display: block;
}

.info-modal::backdrop {
    background: rgba(3, 0, 10, 0.74);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.info-modal-content {
    box-sizing: border-box;
    position: relative;
    background:
        linear-gradient(180deg, rgba(11, 6, 27, 0.98), rgba(7, 3, 18, 0.98)) padding-box,
        linear-gradient(140deg, rgba(0, 255, 255, 0.36), rgba(151, 72, 255, 0.46) 50%, rgba(0, 255, 176, 0.22)) border-box;
    margin: clamp(16px, 5vh, 44px) auto;
    width: min(calc(100vw - 32px), 640px);
    max-height: min(88vh, 820px);
    max-height: min(88dvh, 820px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: clamp(22px, 4vw, 32px);
    border-radius: 18px;
    color: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72), 0 0 34px rgba(91, 32, 160, 0.26);
    border: 1px solid transparent;
}

/* Subtle top-edge light line for depth */
.info-modal-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 22px;
    right: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.32), rgba(128, 0, 255, 0.24), transparent);
    pointer-events: none;
    z-index: 1;
}

/* Dark scrollbar */
.info-modal-content::-webkit-scrollbar { width: 10px; }
.info-modal-content::-webkit-scrollbar-track { background: rgba(10, 5, 25, 0.18); border-radius: 999px; }
.info-modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0, 255, 255, 0.34), rgba(128, 0, 255, 0.38));
    border: 3px solid rgba(8, 3, 20, 0.95);
    border-radius: 999px;
}
.info-modal-content::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(0, 255, 255, 0.48), rgba(128, 0, 255, 0.54)); }

.close-button {
    position: absolute;
    right: clamp(10px, 2.5vw, 18px);
    top: clamp(10px, 2.5vw, 18px);
    color: rgba(200, 180, 255, 0.8);
    font-size: 26px;
    line-height: 1;
    font-weight: bold;
    background: rgba(14, 7, 33, 0.62);
    border: 1px solid transparent;
    cursor: pointer;
    padding: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    z-index: 2;
}

.close-button:hover {
    background: rgba(128, 0, 255, 0.15);
    border-color: rgba(128, 0, 255, 0.4);
    box-shadow: 0 0 12px rgba(128, 0, 255, 0.3);
    color: #fff;
}

.info-modal-content h2 {
    color: #00ffff;
    text-shadow: 0 0 6px rgba(0, 255, 255, 0.4);
    margin-top: 0;
    margin-bottom: clamp(15px, 4vw, 25px);
    font-size: clamp(22px, 4vw, 26px);
    padding-right: 52px;
}

.info-modal-content h3 {
    color: #c080ff;
    text-shadow: 0 0 6px rgba(192, 128, 255, 0.3);
    margin-top: clamp(20px, 4vw, 25px);
    margin-bottom: clamp(10px, 2vw, 15px);
    font-size: clamp(18px, 4vw, 20px);
}

.info-modal-content h4 {
    color: #00ff80;
    text-shadow: 0 0 6px rgba(0, 255, 128, 0.3);
    margin-top: clamp(15px, 3vw, 20px);
    margin-bottom: clamp(10px, 2vw, 15px);
    font-size: clamp(16px, 3.5vw, 18px);
}

.info-modal-content p,
.info-modal-content ul {
    font-size: clamp(14px, 3vw, 16px);
    line-height: 1.6;
    margin-bottom: clamp(10px, 2vw, 15px);
    color: rgba(220, 215, 235, 0.9);
}

.info-modal-content ul {
    padding-left: clamp(20px, 4vw, 30px);
}

.info-modal-content li {
    margin-bottom: clamp(5px, 1vw, 8px);
}

/* Keyboard Shortcuts Link */
.keyboard-shortcuts-link {
    background: none;
    border: none;
    color: #00ffff;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    margin: 0;
    font-weight: 500;
    transition: all 0.2s ease;
}

.keyboard-shortcuts-link:hover {
    color: #80ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

.keyboard-shortcuts-link:focus-visible,
.share-button:focus-visible,
.copy-button:focus-visible,
.close-button:focus-visible {
    outline: 2px solid rgba(0, 255, 255, 0.72);
    outline-offset: 3px;
}

/* Share Modal Specific Styles */
.share-modal-content {
    /* Compact content reads better in a narrower panel */
    width: min(calc(100vw - 32px), 480px);
}

.share-track-info {
    margin: 18px 0 16px;
    padding: 14px 16px;
    background: rgba(20, 10, 40, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(128, 0, 255, 0.2);
}

.share-track-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: white;
}

.share-track-genre {
    font-size: 14px;
    margin: 0;
    color: rgba(200, 180, 255, 0.7);
}

/* Equal-width tile grid; auto-fit handles the info modal's two buttons */
.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: clamp(15px, 3vw, 20px) 0;
}

/* Share modal: always three equal columns, no uneven wrapping */
.share-modal-content .share-grid {
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
}

.share-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: rgba(200, 180, 255, 0.45);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.share-divider::before,
.share-divider::after {
    content: '';
    flex: 1;
    height: 1px;
}

.share-divider::before {
    background: linear-gradient(90deg, transparent, rgba(128, 0, 255, 0.35));
}

.share-divider::after {
    background: linear-gradient(90deg, rgba(128, 0, 255, 0.35), transparent);
}

.copy-link-container {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin: 16px 0 0;
    align-items: stretch;
}

.share-link-input {
    flex: 1;
    min-width: 0;
    padding: 10px 15px;
    background: rgba(15, 8, 30, 0.8);
    border: 1px solid rgba(128, 0, 255, 0.25);
    border-radius: 8px;
    color: rgba(220, 215, 235, 0.9);
    font-size: 13px;
    font-family: monospace;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.share-link-input:focus {
    outline: none;
    border-color: rgba(0, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1), inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.copy-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    background: rgba(15, 8, 30, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.25);
    border-radius: 8px;
    color: rgba(200, 240, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.05);
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-button:hover {
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow: 0 0 16px rgba(0, 255, 255, 0.15);
    transform: translateY(-2px);
}

.copy-button.copied {
    background: rgba(0, 255, 128, 0.1);
    border-color: rgba(0, 255, 128, 0.4);
    box-shadow: 0 0 16px rgba(0, 255, 128, 0.2);
}

/* One consistent tile style; platform identity lives in the icon and only
   surfaces on the border at hover — no rainbow of borders at rest */
.share-button {
    --accent: 200, 180, 255;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 8, 30, 0.8);
    border: 1px solid rgba(128, 0, 255, 0.22);
    color: rgba(225, 220, 240, 0.92);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.share-button svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: rgba(var(--accent), 0.85);
    transition: color 0.2s ease;
}

.share-button:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--accent), 0.55);
    box-shadow: 0 0 16px rgba(var(--accent), 0.16);
}

.share-button:active {
    transform: translateY(0);
}

.share-button.twitter { --accent: 220, 235, 255; }
.share-button.facebook { --accent: 96, 140, 220; }
.share-button.whatsapp { --accent: 70, 220, 135; }

.bookmark-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 18px;
    font-size: 13px;
    color: rgba(200, 180, 255, 0.6);
    text-decoration: none;
    border-bottom: 1px dashed rgba(128, 0, 255, 0.35);
    padding-bottom: 2px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.bookmark-link svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.bookmark-link:hover {
    color: #c080ff;
    border-bottom-color: rgba(192, 128, 255, 0.7);
}

.contact-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(128, 0, 255, 0.15);
}

.contact-info a {
    color: #00ffff;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.contact-info a:hover {
    border-color: rgba(0, 255, 255, 0.7);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

@media (max-width: 640px) {
    .info-modal {
        background: rgba(3, 0, 10, 0.82);
    }

    .info-modal-content {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: min(86vh, 760px);
        max-height: min(86dvh, 760px);
        margin: 0;
        padding: 22px 18px max(22px, env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 22px 22px 0 0;
        scrollbar-gutter: auto;
    }

    .info-modal-content::after {
        left: 50%;
        right: auto;
        top: 9px;
        width: 46px;
        height: 4px;
        border-radius: 999px;
        transform: translateX(-50%);
        background: rgba(212, 200, 255, 0.26);
    }

    .close-button {
        right: 12px;
        top: 12px;
    }

    .info-modal-content h2 {
        font-size: 22px;
        line-height: 1.18;
        padding-right: 54px;
        margin-bottom: 18px;
    }

    .info-modal-content h3 {
        font-size: 18px;
        margin-top: 22px;
    }

    .info-modal-content p,
    .info-modal-content ul {
        font-size: 15px;
        line-height: 1.55;
    }

    .info-modal-content ul {
        padding-left: 20px;
    }

    .info-modal-content li {
        margin-bottom: 9px;
    }

    /* Compact tiles: icon over label keeps three equal columns on phones */
    .share-modal-content .share-grid .share-button {
        flex-direction: column;
        gap: 5px;
        padding: 10px 6px;
        font-size: 12px;
    }
}
