/* ═══════════════════════════════════════════════════════════════
   Sermon Admin Panel Stylesheet
   Modern, Clean, Professional
   ═══════════════════════════════════════════════════════════════ */

:root {
    --primary: #4488cc;
    --primary-dark: #3366aa;
    --danger: #ff4444;
    --danger-dark: #cc0000;
    --success: #00c851;
    --bg-main: #f4f7f9;
    --bg-card: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --border: #dcdde1;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --font-scale: 1;
}

html {
    font-size: calc(16px * var(--font-scale));
}

/* Theme Integration */
[class*="theme-"] {
    --bg-main: var(--primary-bg);
    --bg-card: var(--card-bg);
    --text-main: var(--text-color);
    --text-muted: var(--text-color);
    /* Simplified mapping */
    --primary: var(--accent-color);
    --border: rgba(128, 128, 128, 0.5);
    /* Neutral grey for visibility on both light/dark themes */
}

[class*="theme-"] .card {
    border: 1px solid var(--border);
    background: var(--bg-card);
}

[class*="theme-"] input,
[class*="theme-"] select {
    background: rgba(128, 128, 128, 0.15);
    /* Neutral tint */
    color: var(--text-main);
    border-color: var(--border);
}

[class*="theme-"] select option {
    background: var(--bg-card);
    color: var(--text-main);
}

[class*="theme-"] .btn-outline-sm {
    color: var(--text-main);
    border-color: var(--border);
}

[class*="theme-"] .verse-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

.admin-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

/* ─── Cards ─── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.card-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ─── Dashboard Header ─── */
.dashboard-header-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 40px;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.dashboard-title span {
    color: var(--primary);
}

.dashboard-subtitle {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.nav-bar-unified {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--bg-card);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.nav-divider {
    width: 1px;
    height: 24px;
    background-color: var(--border);
    margin: 0 5px;
}

.link-sm {
    font-size: 0.9rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.link-sm:hover {
    background: rgba(68, 136, 204, 0.1);
    text-decoration: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 700px;
    margin: 0 auto;
}

/* ─── Forms ─── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row-compact {
    display: flex;
    gap: 8px;
}

#set-titlebar-type {
    max-width: 120px;
}

.flex-1 {
    flex: 1;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(68, 136, 204, 0.15);
}

/* ─── Buttons ─── */
button {
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary-sm {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-outline-sm {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
}

.btn-outline-sm:hover {
    background: var(--bg-main);
}

.btn-danger-sm {
    padding: 8px 16px;
    background: #fff5f5;
    color: var(--danger);
    border: 1px solid #fed7d7;
    border-radius: 6px;
    font-size: 0.85rem;
}

.btn-danger-sm:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-icon {
    background: none;
    border: none;
    padding: 4px;
    color: var(--text-muted);
}

.btn-icon:hover {
    color: var(--danger);
}

/* ─── Section Header ─── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* ─── Verse List ─── */
.verse-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.verse-item {
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.verse-item-info {
    flex: 1;
}

.verse-item-ref {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
}

.verse-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.empty-list {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-style: italic;
}

/* ─── Messages ─── */
.error-msg {
    color: var(--danger);
    background: #fff5f5;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 15px;
    border: 1px solid #fed7d7;
}

.status-msg {
    color: var(--success);
    font-size: 0.85rem;
    margin-top: 10px;
}

/* ─── Notifier ─── */
.notifier {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
}

/* ─── Admin Info Modal ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal-admin-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    max-width: 550px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
}

/* Wider variant for the instructions modal */
.modal-admin-card-wide {
    max-width: 680px;
}

.modal-admin-card h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: var(--primary);
}

.modal-admin-body {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-main);
}

.modal-admin-body ul {
    padding-left: 20px;
    margin: 8px 0 14px;
}

.modal-admin-body li {
    margin-bottom: 4px;
}

.modal-admin-body p {
    margin-bottom: 8px;
}

/* ─── Verse Actions ─── */
.verse-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon.btn-link:hover {
    color: var(--primary);
}

/* ─── Live Display Preview (Transcriber-style toggle) ─── */
.preview-toggle-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 0;
}

.preview-toggle-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-toggle-pill {
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid var(--border);
    border-radius: 50px;
    padding: 5px 14px;
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    -webkit-user-select: none;
    user-select: none;
}

.preview-pill-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: #ff4444;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
    transition: all 0.3s ease;
}

.preview-toggle-pill.active {
    border-color: #44ff44;
    color: #44ff44;
    background: rgba(68, 255, 68, 0.05);
}

.preview-toggle-pill.active .preview-pill-dot {
    background: #44ff44;
    box-shadow: 0 0 12px rgba(68, 255, 68, 0.8);
}

.preview-toggle-pill:hover {
    transform: scale(1.05);
}

.preview-iframe-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    margin-bottom: 30px;
}

.preview-iframe-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
