/* Archive table and card styles */

.archive-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.archive-table th,
.archive-table td {
    padding: 14px 12px;
    text-align: left;
}

.archive-table th {
    color: var(--hf-text-light);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--hf-border);
}

.archive-table td {
    border-bottom: 1px solid var(--hf-border);
    font-size: 15px;
}

.archive-table tr:hover {
    background: var(--hf-light-gray);
}

/* Inline player row in table view */
.player-row td {
    padding: 0 !important;
    border-bottom: none !important;
}

.player-row #playback-player-container {
    margin: 0;
    border-radius: 0;
    border-left: 4px solid var(--hf-purple);
    border-top: 1px solid var(--hf-border);
}

/* No hover effect on player row */
.archive-table .player-row:hover {
    background: transparent;
}

.preacher {
    color: var(--hf-text-muted);
    font-size: 13px;
}

/* Action buttons */
.action-btn {
    padding: 6px 14px;
    font-size: 12px;
}

.action-btn-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

/* Share button — icon-only, matches Play pill height */
.btn-share {
    background: transparent;
    color: var(--hf-purple);
    border: 2px solid var(--hf-purple);
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-share:hover {
    background: var(--hf-purple);
    color: var(--hf-white);
}

.btn-share:focus-visible {
    outline: 2px solid var(--hf-purple-dark);
    outline-offset: 2px;
}

/* Share modal (<dialog>) */
.share-modal {
    /* Explicit centering — don't rely on UA defaults which differ across browsers */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    border: none;
    border-radius: 14px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.1);
    width: min(92vw, 440px);
    max-height: 92vh;
    color: var(--hf-text);
    font-family: var(--hf-font-family);
    background: var(--hf-white);
    overflow: visible;
}

.share-modal[open] {
    animation: shareModalIn 180ms ease-out;
}

@keyframes shareModalIn {
    from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.share-modal::backdrop {
    background: rgba(20, 20, 30, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.share-modal-inner {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.share-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--hf-text);
    margin: 0;
    letter-spacing: -0.2px;
}

.share-modal-close {
    background: transparent;
    border: none;
    color: var(--hf-text-light);
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}

.share-modal-close:hover {
    color: var(--hf-text);
    background: var(--hf-light-gray);
}

.share-modal-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    background: var(--hf-light-gray);
    border-radius: 10px;
    border-left: 3px solid var(--hf-purple);
}

.share-modal-meta strong {
    color: var(--hf-text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.share-modal-meta span {
    color: var(--hf-text-light);
    font-size: 13px;
}

.share-modal-url-row {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--hf-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--hf-white);
    transition: border-color 0.15s;
}

.share-modal-url-row:focus-within {
    border-color: var(--hf-purple);
}

.share-modal-url-row input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    font-size: 13px;
    border: none;
    color: var(--hf-text);
    background: transparent;
    font-family: var(--hf-font-family);
    outline: none;
    text-overflow: ellipsis;
}

.share-modal-copy {
    border: none;
    border-left: 1px solid var(--hf-border);
    background: var(--hf-white);
    color: var(--hf-purple);
    font-weight: 600;
    font-size: 13px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.share-modal-copy:hover {
    background: var(--hf-purple);
    color: var(--hf-white);
}

.share-modal-copy.is-copied {
    background: #1f8a4c;
    color: var(--hf-white);
}

.share-modal-status {
    font-size: 12px;
    color: var(--hf-text-light);
    min-height: 0;
    margin-top: -6px;
}

.share-modal-status.is-success {
    color: #1f8a4c;
    min-height: 16px;
}


/* Mobile-friendly */
.archive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.archive-card-container {
    display: none;
}

.archive-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--hf-text-light);
    font-size: 16px;
}

@media (max-width: 768px) {
    .archive-wrapper {
        display: none;
    }

    .archive-card-container {
        display: block;
    }

    .archive-card {
        background: var(--hf-white);
        border-radius: var(--hf-radius-card);
        padding: 16px;
        margin-bottom: 12px;
        border-left: 4px solid var(--hf-purple);
        box-shadow: var(--hf-shadow);
    }

    .archive-card-header {
        display: flex;
        justify-content: space-between;
        align-items: start;
        margin-bottom: 8px;
    }

    .archive-card-title {
        font-weight: 600;
        font-size: 16px;
        color: var(--hf-text);
        margin-bottom: 4px;
    }

    .archive-card-preacher {
        font-size: 14px;
        color: var(--hf-text-light);
        margin-bottom: 8px;
    }

    .archive-card-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 12px;
        font-size: 13px;
    }

    .archive-card-meta-item {
        color: var(--hf-text-light);
    }

    .archive-card-meta-label {
        font-weight: 600;
        margin-right: 4px;
    }

    .archive-card-actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
    }

    .archive-card-actions .action-btn {
        flex: 1;
        min-width: 70px;
        text-align: center;
    }

    .archive-card-actions .btn-share-card {
        flex: 0 0 auto;
        min-width: 0;
    }

    /* Inline player after card in mobile view */
    .archive-card-container #playback-player-container {
        margin-bottom: 12px;
        border-radius: var(--hf-radius-card);
        border-left: 4px solid var(--hf-purple);
    }
}
