/* ============================================================
   MyCollections – Dark Theme
   Palette: #1a1a2e bg | #16213e card | #0f3460 accent | #e94560 red
   ============================================================ */

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg:          #1a1a2e;
    --card:        #16213e;
    --accent:      #0f3460;
    --red:         #e94560;
    --red-hover:   #c73652;
    --text:        #e0e0e0;
    --text-muted:  #8892a4;
    --text-dim:    #5a6478;
    --border:      rgba(255,255,255,0.07);
    --border-soft: rgba(255,255,255,0.04);
    --success:     #4caf50;
    --warning:     #ff9800;
    --shadow:      0 8px 32px rgba(0,0,0,0.4);
    --radius:      12px;
    --radius-sm:   8px;
    --transition:  0.2s ease;
    --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
    --navbar-h:    64px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--red);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--red-hover); }

code {
    font-family: 'Courier New', monospace;
    background: var(--accent);
    color: #7eb8f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* ── Scrollbar ── */
::-webkit-scrollbar             { width: 8px; height: 8px; }
::-webkit-scrollbar-track       { background: var(--bg); }
::-webkit-scrollbar-thumb       { background: var(--accent); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ============================================================
   Layout
   ============================================================ */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: calc(var(--navbar-h) + 32px) 24px 48px;
}

.container-narrow {
    max-width: 760px;
}

/* ============================================================
   Navbar
   ============================================================ */

.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 24px;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text);
    background: var(--border);
}

.nav-link.active {
    color: var(--red);
    background: rgba(233, 69, 96, 0.12);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.nav-username {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--red);
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background: var(--red-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.4);
}

.btn-secondary {
    background: var(--accent);
    color: var(--text);
}
.btn-secondary:hover:not(:disabled) {
    background: #143d78;
    color: var(--text);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--border);
    color: var(--text);
    border-color: var(--border);
}

.btn-danger {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.2);
}
.btn-danger:hover:not(:disabled) {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    gap: 5px;
}

.btn-full { width: 100%; justify-content: center; }

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

/* ============================================================
   Forms
   ============================================================ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="search"]:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}

input::placeholder { color: var(--text-dim); }

.password-wrapper {
    position: relative;
}

.password-wrapper input { padding-right: 46px; }

.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition);
}
.toggle-pw:hover { color: var(--text); }

/* ============================================================
   Alerts
   ============================================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.alert svg { flex-shrink: 0; margin-top: 1px; }

.alert-error {
    background: rgba(233, 69, 96, 0.12);
    border: 1px solid rgba(233, 69, 96, 0.3);
    color: #ff8a9a;
}

.alert-success {
    background: rgba(76, 175, 80, 0.12);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #81c784;
}

.alert-warning {
    background: rgba(255, 152, 0, 0.12);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #ffb74d;
}

.alert-info {
    background: rgba(33, 150, 243, 0.12);
    border: 1px solid rgba(33, 150, 243, 0.3);
    color: #64b5f6;
}

/* ============================================================
   Badges
   ============================================================ */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-year {
    background: rgba(15, 52, 96, 0.8);
    color: #7eb8f7;
}

.badge-ean {
    background: rgba(255,255,255,0.05);
    color: var(--text-dim);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* ============================================================
   Page header
   ============================================================ */

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ============================================================
   Search bar
   ============================================================ */

.search-bar {
    position: relative;
    margin-bottom: 28px;
}

.search-bar svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

.search-bar input {
    padding-left: 46px;
    border-radius: 50px;
    background: var(--card);
    border-color: var(--border);
}

/* ============================================================
   Collection grid
   ============================================================ */

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.collection-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
}

.collection-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(233, 69, 96, 0.3);
}

/* Cover */
.card-cover {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--accent);
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.collection-card:hover .card-cover img {
    transform: scale(1.04);
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    background: linear-gradient(135deg, var(--accent) 0%, var(--bg) 100%);
}

.card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 7px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* Body */
.card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
}

.card-artist {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 4px;
}

/* Footer */
.card-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-date {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ============================================================
   Empty state
   ============================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 80px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    color: var(--text-dim);
    margin-bottom: 8px;
}

.empty-state h2 {
    font-size: 1.2rem;
    color: var(--text);
    font-weight: 600;
}

.empty-state p {
    font-size: 0.9rem;
    max-width: 360px;
}

/* ============================================================
   Login page
   ============================================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(15, 52, 96, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(233, 69, 96, 0.15) 0%, transparent 50%),
        var(--bg);
    padding: 24px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    margin-bottom: 12px;
}

.login-logo h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.login-card h2 {
    font-size: 1.3rem;
    margin-bottom: 24px;
}

.login-hint {
    text-align: center;
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.8;
}

/* ============================================================
   Scan page
   ============================================================ */

.scan-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

/* Tabs */
.scan-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.scan-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.scan-tab:hover {
    color: var(--text);
    background: var(--border-soft);
}

.scan-tab.active {
    color: var(--red);
    border-bottom-color: var(--red);
    background: rgba(233, 69, 96, 0.06);
}

/* Panels */
.scan-panel {
    padding: 24px;
}

/* Scanner viewport */
.scanner-viewport {
    position: relative;
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 4/3;
    max-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* QuaggaJS injects a <video> inside #quagga-container */
#quagga-container {
    position: absolute;
    inset: 0;
}

#quagga-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#quagga-container canvas {
    display: none; /* hide debug canvas */
}

/* Scan overlay */
.scan-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scan-frame {
    position: relative;
    width: 70%;
    height: 55%;
}

.scan-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--red);
    border-style: solid;
}

.scan-corner.tl { top: 0;    left: 0;  border-width: 3px 0 0 3px; }
.scan-corner.tr { top: 0;    right: 0; border-width: 3px 3px 0 0; }
.scan-corner.bl { bottom: 0; left: 0;  border-width: 0 0 3px 3px; }
.scan-corner.br { bottom: 0; right: 0; border-width: 0 3px 3px 0; }

.scan-line {
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
    animation: scanAnim 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--red);
}

@keyframes scanAnim {
    0%   { top: 0%;   opacity: 1; }
    50%  { top: 100%; opacity: 1; }
    100% { top: 0%;   opacity: 1; }
}

/* Camera placeholder */
.camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: #0a0a1a;
    z-index: 2;
}

.camera-placeholder.hidden { display: none; }

/* Scanner controls */
.scanner-controls {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.scan-hint {
    margin-top: 14px;
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.5;
}

/* Manual input */
.manual-input-area {
    text-align: center;
    padding: 16px 0;
}

.manual-icon {
    color: var(--text-dim);
    margin-bottom: 16px;
}

.manual-input-area p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.ean-input-group {
    display: flex;
    gap: 10px;
    max-width: 480px;
    margin: 0 auto;
}

.ean-input-group input {
    flex: 1;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* ============================================================
   Result card
   ============================================================ */

.result-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-header h3 {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

.result-body {
    padding: 24px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.result-cover {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.result-cover-placeholder {
    color: var(--text-dim);
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}

.result-artist {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.result-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.result-source {
    font-size: 0.8rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.result-not-found {
    padding: 24px;
}

.result-not-found .manual-add-form {
    margin-top: 20px;
}

.manual-add-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.manual-add-form .form-row.full { grid-template-columns: 1fr; }

/* ============================================================
   Status message (floating toast)
   ============================================================ */

.status-message {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.status-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.status-message.success { border-color: rgba(76, 175, 80, 0.5); color: #81c784; }
.status-message.error   { border-color: rgba(233, 69, 96, 0.5); color: #ff8a9a; }
.status-message.info    { border-color: rgba(33, 150, 243, 0.5); color: #64b5f6; }

/* ============================================================
   Spinner
   ============================================================ */

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.15);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Loading state in result card */
.result-loading {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* ============================================================
   Duplicate warning
   ============================================================ */

.duplicate-banner {
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.4);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #ff8a9a;
    font-weight: 500;
    margin-bottom: 0;
}

.duplicate-banner svg { flex-shrink: 0; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
    :root { --navbar-h: 56px; }

    .navbar { padding: 0 16px; gap: 12px; }
    .nav-brand span { display: none; }
    .nav-link span  { display: none; }
    .nav-link       { padding: 8px 10px; }
    .nav-username   { display: none; }

    .container { padding: calc(var(--navbar-h) + 20px) 16px 40px; }

    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-header .btn { align-self: flex-start; }

    .collection-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }

    .result-body { flex-direction: column; align-items: center; text-align: center; }
    .result-cover { width: 160px; height: 160px; }
    .result-actions { justify-content: center; }
    .result-meta { justify-content: center; }

    .manual-add-form .form-row { grid-template-columns: 1fr; }

    .ean-input-group { flex-direction: column; }

    .login-card { padding: 24px; }
}

@media (max-width: 480px) {
    .collection-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .scan-tab        { font-size: 0.8rem; padding: 12px 8px; }
}

/* ── Sort buttons ────────────────────────────────────────────────────────── */
.sort-buttons {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #0f3460;
    background: transparent;
    color: #888;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
}

.sort-btn:hover {
    background: #0f3460;
    color: #e0e0e0;
}

.sort-btn.active {
    background: #0f3460;
    color: #e0e0e0;
    border-color: #e94560;
}

@media (max-width: 600px) {
    .sort-btn span { display: none; }
    .sort-buttons  { gap: 4px; }
    .sort-btn      { padding: 6px 8px; }
}

/* ── Duplicate Modal ─────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn .15s ease;
    overflow-y: auto;
}

@media (max-height: 600px) {
    .modal-backdrop { align-items: flex-start; padding-top: 16px; }
}

.modal {
    background: #16213e;
    border-radius: 16px;
    padding: 32px 28px 24px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
    animation: slideUp .2s ease;
    text-align: center;
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(233, 69, 96, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #e94560;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #e0e0e0;
    margin-bottom: 8px;
}

.modal-text {
    color: #888;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 24px;
}

.modal-text strong {
    color: #e0e0e0;
}

.modal-actions {
    display: flex;
    justify-content: center;
}

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Edit Modal ──────────────────────────────────────────────────────────── */
.edit-modal {
    max-width: 480px;
    width: calc(100% - 32px);
    padding: 0;
    text-align: left;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #0f3460;
    flex-shrink: 0;
}

.edit-cover-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px 0;
    flex-shrink: 0;
}

.edit-cover-preview {
    position: relative;
    width: 90px;
    height: 90px;
    min-width: 90px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #0f1b35;
    border: 2px dashed #0f3460;
    transition: border-color .2s;
}

.edit-cover-preview:hover { border-color: #e94560; }

.edit-cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-width: 100%;
}

.edit-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 6px;
    color: #555;
    font-size: .75rem;
}

.edit-cover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #fff;
    font-size: .75rem;
    opacity: 0;
    transition: opacity .2s;
}

.edit-cover-preview:hover .edit-cover-overlay { opacity: 1; }

.edit-cover-hint {
    color: #888;
    font-size: .8rem;
    line-height: 1.5;
    min-width: 0;
}

.edit-cover-hint small { color: #555; }

.edit-fields {
    padding: 16px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.edit-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: .8rem;
    color: #888;
    font-weight: 500;
}

.form-group input {
    background: #0f1b35;
    border: 1px solid #0f3460;
    border-radius: 8px;
    padding: 9px 12px;
    color: #e0e0e0;
    font-size: .9rem;
    transition: border-color .15s;
    width: 100%;
}

.form-group input:focus {
    outline: none;
    border-color: #e94560;
}

.edit-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 24px;
    border-top: 1px solid #0f3460;
    margin-top: 20px;
}

