/* ==========================================================================
   Global & Shared Structural Layout Rules
   ========================================================================== */
body {
    background-color: #f8f9fa;
    color: #212529;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.navbar-custom {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* ==========================================================================
   Home Landing Grid & Chapter Album Cards
   ========================================================================== */
.chapter-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    overflow: hidden;
}

.chapter-card:hover {
    transform: translateY(-4px);
}

.chapter-thumb-wrapper {
    width: 100%;
    height: 240px;
    background-color: #e9ecef;
    overflow: hidden;
    border-radius: 8px;
}

.chapter-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chapter-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
}

.gallery-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    background: white;
}

.gallery-img-wrapper {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background-color: #e9ecef;
    position: relative;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ==========================================================================
   EXIF UI Contract Badges & Date Hooks
   ========================================================================== */
.date-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.best-guess-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: #f59e0b;
    color: #ffffff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: help;
}

.best-guess-badge:hover {
    background-color: #d97706;
}

/* ==========================================================================
   FAMILY MEMORY ARCHIVE - AUTHENTICATION LAYER LAYOUT
   ========================================================================== */
:root {
    --card-vault-surface: #ffffff;
    --text-primary: #1e2229;
    --text-secondary: #656e7b;
    --accent-vault: #2563eb;
    --border-light: #e5e7eb;
    --danger-soft: #fef2f2;
    --danger-text: #dc2626;
}

.archive-auth-wrapper {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 2rem 1rem;
}

.archive-auth-card {
    background: var(--card-vault-surface);
    width: 100%;
    max-width: 440px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-light);
    padding: 2.5rem;
}

.archive-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.archive-logo-icon {
    background: #eff6ff;
    color: var(--accent-vault);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.archive-logo-icon i {
    font-size: 1.5rem;
}

.archive-auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.025em;
}

.archive-auth-header .subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Form Structural Controls */
.archive-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: 0.815rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Custom Injected Django Input Widget Properties */
.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background-color: #f9fafb;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--accent-vault);
    box-shadow: 0 0 0 4px rgba(37, 99, 213, 0.1);
}

/* System Diagnostic Error Contexts */
.auth-error-banner {
    background-color: var(--danger-soft);
    border: 1px solid #fee2e2;
    color: var(--danger-text);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

.field-error-text {
    font-size: 0.75rem;
    color: var(--danger-text);
    margin-top: 0.25rem;
}

/* Actions & Submission Controls */
.btn-archive-submit {
    background-color: var(--text-primary);
    color: white;
    border: none;
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: 0.5rem;
}

.btn-archive-submit:hover {
    background-color: #0b0d12;
}

.btn-archive-submit:active {
    transform: scale(0.98);
}

/* Footer Link Routing Wrappers */
.archive-auth-footer {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.archive-auth-footer .divider {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    line-height: 0.1em;
    margin: 1rem 0 1.5rem 0;
}

.archive-auth-footer .divider span {
    background: var(--card-vault-surface);
    padding: 0 10px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-archive-register {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.btn-archive-register:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    color: var(--accent-vault);
}

.registration-invite-pulse {
    border-color: #bfdbfe;
    background-color: #eff6ff;
    color: var(--accent-vault);
}

.registration-invite-pulse:hover {
    background-color: #dbeafe;
}

/* ==========================================================================
   FAMILY MEMORY ARCHIVE - REAL-TIME NOTIFICATION TOAST PIPELINE
   ========================================================================== */
.archive-notification-toast-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 420px;
    pointer-events: none;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* TOP-CENTER POSITION CONFIGURATION (Change to top-right/bottom-right if preferred) */
.toast-position-top-center {
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
}

.archive-toast {
    pointer-events: auto;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
    animation: toastSlideDownIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Animation: Sliding smoothly down into view from above */
@keyframes toastSlideDownIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animation: Fading cleanly out of view on dismissal */
.archive-toast.toast-fade-out {
    animation: toastFadeOutActive 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastFadeOutActive {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.95);
        opacity: 0;
    }
}

.toast-icon-side {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* Success Pipeline Flavor Theme */
.toast-success {
    border-left: 4px solid #10b981;
}

.toast-success .toast-icon-side {
    color: #10b981;
}

/* Failure / Error Pipeline Flavor Theme */
.toast-error, .toast-danger {
    border-left: 4px solid #ef4444;
    background-color: #fef2f2;
}

.toast-error .toast-icon-side, .toast-danger .toast-icon-side {
    color: #ef4444;
}

.toast-body-side {
    flex-grow: 1;
    padding-right: 1.25rem;
}

.toast-body-side p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e2229;
    line-height: 1.4;
}

.toast-close-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    display: inline-flex;
    transition: color 0.2s ease;
    margin-top: 0.1rem;
}

.toast-close-btn:hover {
    color: #4b5563;
}

/* ==========================================================================
   FAMILY MEMORY ARCHIVE - REFINED LIGHT THEME IMAGE INSPECTOR
   ========================================================================== */
.archive-inspector-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 82vh;
    background-color: #ffffff; /* Shift from charcoal block to clean white */
    color: #1e2229;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border-radius: 12px;
    border: 1px solid #e5e7eb; /* Thin, soft border frame */
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.inspector-top-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background-color: #f9fafb; /* Light backdrop header row */
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.btn-inspector-back {
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.15s ease;
}

.btn-inspector-back:hover {
    color: #2563eb; /* Consistent blue focus accent */
}

.inspector-counter {
    background-color: #e5e7eb;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #4b5563;
}

.inspector-meta-title {
    text-align: right;
}

.inspector-meta-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e2229;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inspector-theater-core {
    flex-grow: 1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    position: relative;
    padding: 2.5rem 1.5rem;
    background-color: #f3f4f6; /* Soft, warm neutral background to pop image files */
}

.inspector-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    max-height: 62vh;
}

.inspector-core-img {
    max-width: 100%;
    max-height: 62vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 4px solid #ffffff; /* Premium white border gallery frame wrapper */
}

/* Subtle, floating arrow buttons */
.btn-nav-arrow {
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-nav-arrow:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    transform: scale(1.05);
}

.disabled-arrow {
    background: transparent;
    color: #d1d5db;
    cursor: not-allowed;
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

.inspector-details-footer {
    background-color: #f9fafb;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.meta-pill-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.meta-pill {
    background-color: transparent;
    color: #4b5563;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.download-pill {
    background-color: #2563eb;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    margin-left: auto;
    box-shadow: 0 2px 4px rgba(37, 99, 213, 0.1);
    transition: background-color 0.15s ease;
}

.download-pill:hover {
    background-color: #1d4ed8;
}

@media (max-width: 640px) {
    .inspector-top-bar {
        grid-template-columns: 1fr auto;
    }

    .inspector-meta-title {
        display: none;
    }

    .inspector-theater-core {
        grid-template-columns: 1fr;
        padding: 1rem 0;
    }

    .nav-arrow-zone {
        position: absolute;
        bottom: -0.5rem;
        z-index: 10;
    }

    .left-zone {
        left: 1rem;
    }

    .right-zone {
        right: 1rem;
    }
}
