﻿
/* ===== GLOBAL LOADER, TOASTS & MODALS ===== */

.hidden {
    display: none !important;
}

.global-loader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(10, 14, 24, 0.45);
    backdrop-filter: blur(8px);
    z-index: 2000;
    color: #ffffff;
    font-weight: 700;
}

.global-loader-spinner, .loading-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner.small {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-color: rgba(194, 109, 132, 0.2);
    border-top-color: var(--accent);
}

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

#lumora-toast-stack {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.lumora-toast {
    width: min(380px, calc(100vw - 2.4rem));
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(20, 26, 38, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(14px);
    color: #f1f5f9;
    opacity: 0;
    transform: translateX(20px) scale(0.96);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.lumora-toast.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.lumora-toast.hide {
    opacity: 0;
    transform: translateX(20px) scale(0.96);
}

.lumora-toast.success {
    border-left: 4px solid #10b981;
}

.lumora-toast.error {
    border-left: 4px solid #ef4444;
}

/* ========================
   Interaction Bar (Like & Comments)
   ======================== */
.story-interaction-bar {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1.5rem;
    background: var(--surface-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
}

.btn-interaction {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-interaction:hover {
    background: var(--primary-soft);
    border-color: var(--accent);
}

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

.btn-interaction.liked {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

.btn-interaction .interaction-icon {
    font-size: 1.1rem;
}

.btn-interaction .interaction-count {
    font-weight: 600;
}

.btn-interaction .interaction-label {
    color: var(--muted);
}

/* ========================
   Comments Section
   ======================== */
.comments-section {
    background: var(--surface-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    padding: 1.5rem;
    margin-top: 1rem;
}

.comments-section.hidden {
    display: none;
}

.comments-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comment-input {
    width: 100%;
    padding: 0.875rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary);
}

.comment-input::placeholder {
    color: var(--muted);
}

.btn-submit-comment {
    align-self: flex-end;
    padding: 0.625rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-submit-comment:hover {
    background: var(--accent-strong);
}

.btn-submit-comment:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.no-comments {
    text-align: center;
    color: var(--muted);
    padding: 2rem;
    font-style: italic;
}

.comment-item {
    display: flex;
    gap: 0.875rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8b7c3 0%, #c26d84 50%, #3b82f6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.comment-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.comment-avatar:hover {
    transform: scale(1.06);
    box-shadow: 0 2px 10px rgba(194, 109, 132, 0.35);
}

.comment-content-wrap {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.375rem;
}

.comment-author {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.comment-author:hover {
    color: var(--accent-strong);
    text-decoration: underline;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--muted);
}

.comment-text {
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
    word-wrap: break-word;
}

.comment-at-label {
    color: var(--accent-strong);
    font-weight: 600;
    margin-right: 0.25rem;
    cursor: pointer;
    text-decoration: none;
}

.comment-at-label:hover {
    color: var(--accent);
    text-decoration: underline;
}

.btn-delete-comment {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete-comment:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

/* ========================
   Notification Bell & Badge
   ======================== */
.notif-bell {
    position: relative;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface-alt);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.notif-bell:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
    background: var(--primary-soft);
}

.notif-bell .bell-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.notif-bell:active .bell-icon {
    transform: rotate(-15deg) scale(0.9);
}

/* ========================
   Navbar Profile Avatar
   ======================== */
.nav-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--accent-gradient);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(194, 109, 132, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Sits in the .nav flex row (which already has gap), so it is placed between
   the notification bell and the menu button with no overlap. */
.nav-avatar:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(194, 109, 132, 0.32);
}

.nav-avatar .nav-avatar-initial {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
}

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

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.notif-badge.hidden {
    display: none;
}

.notif-bell.has-unread {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.08);
}

/* ========================
   Notification Drawer
   ======================== */
.notif-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: min(92vw, 380px);
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.15);
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 110;
    display: flex;
    flex-direction: column;
}

.notif-drawer.open {
    right: 0;
}

.notif-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 1.5rem 0.6rem;
}

.notif-drawer-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-deep);
    margin: 0;
}

.notif-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface-alt);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.notif-close:hover {
    background: var(--primary-soft);
    transform: rotate(90deg);
}

.notif-drawer hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 0 0 0.5rem;
}

.notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.notif-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-alt);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.notif-item:hover {
    background: var(--primary-soft);
    border-color: var(--card-border-hover);
    transform: translateY(-2px);
}

.notif-item.unread {
    background: rgba(194, 109, 132, 0.08);
    border-color: rgba(194, 109, 132, 0.25);
}

.notif-item.unread:hover {
    background: rgba(194, 109, 132, 0.14);
}

.notif-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: var(--accent-gradient, linear-gradient(135deg, #e8b7c3 0%, #c26d84 100%));
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    overflow: hidden;
}

.notif-icon.notif-avatar {
    background: transparent;
}

.notif-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.notif-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notif-message {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}

.notif-time {
    font-size: 0.76rem;
    color: var(--muted);
}

.notif-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background: #e8b7c3;
    margin-top: 4px;
    box-shadow: 0 0 0 3px rgba(194, 109, 132, 0.15);
}

.notif-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.notif-empty-icon {
    font-size: 2.4rem;
}

.notif-empty p {
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.notif-empty small {
    font-size: 0.8rem;
}

.notif-login-link {
    margin-top: 0.5rem;
    padding: 0.6rem 1.6rem;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff !important;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

.notif-login-link:hover {
    transform: translateY(-2px);
    background: var(--accent-strong);
}
/* ========================
   Comment Replies & Actions
   ======================== */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.btn-reply-comment {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reply-comment:hover {
    background: var(--primary-soft);
    border-color: var(--accent);
    color: var(--accent-strong);
}

.comment-replies {
    margin-top: 0.9rem;
    margin-left: 1.2rem;
    padding-left: 1.2rem;
    border-left: 2px solid rgba(194, 109, 132, 0.2);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.comment-reply {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem;
    background: var(--surface-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
}

.comment-reply .comment-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.comment-reply-form {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    animation: reply-slide-in 0.22s ease;
}

@keyframes reply-slide-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-reply-form .comment-input {
    min-height: 56px;
    background: var(--surface);
}

.reply-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-reply-cancel {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reply-cancel:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.highlight-comment {
    animation: comment-highlight 2.4s ease;
}

@keyframes comment-highlight {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(194, 109, 132, 0);
        border-color: var(--line);
    }
    20%, 70% {
        box-shadow: 0 0 0 4px rgba(194, 109, 132, 0.25);
        border-color: var(--accent);
        background: rgba(194, 109, 132, 0.06);
    }
}

/* ========================
   Mention Chips
   ======================== */
.mention-chip {
    background: rgba(194, 109, 132, 0.12);
    color: var(--accent-strong);
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.mention-chip:hover {
    background: rgba(194, 109, 132, 0.22);
    color: var(--accent);
}

.mention-chip.unknown {
    color: var(--muted);
    background: var(--surface-alt);
}

/* ========================
   Mention Autocomplete Dropdown
   ======================== */
.mention-dropdown {
    position: absolute;
    z-index: 120;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
    overflow: hidden;
    max-height: 260px;
    overflow-y: auto;
}

.comment-input-wrap {
    position: relative;
}

.mention-dropdown .mention-empty {
    padding: 0.9rem 1rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.mention-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.9rem;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mention-option:hover,
.mention-option.active {
    background: var(--primary-soft);
}

.mention-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-gradient, linear-gradient(135deg, #e8b7c3 0%, #c26d84 100%));
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.mention-name {
    font-weight: 600;
    font-size: 0.9rem;
}

body.dark-mode .mention-dropdown {
    border-color: rgba(255, 255, 255, 0.12);
}

/* ========================
   Notification Drawer (Dark mode tweaks)
   ======================== */
body.dark-mode .notif-item.unread {
    background: rgba(232, 183, 195, 0.16);
    border-color: rgba(232, 183, 195, 0.35);
}

body.dark-mode .mention-option:hover,
body.dark-mode .mention-option.active {
    background: rgba(194, 109, 132, 0.18);
}

@media (max-width: 600px) {
    /* ---- Mobile header: logo & utils on separate rows ---- */
    .header {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 0.4rem;
        padding: 0.5rem 0.75rem;
    }

    .logo {
        order: 1;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 0.45rem;
    }

    .logo img {
        width: 36px;
        height: 36px;
    }

    .logo_text h1 {
        font-size: 1.2rem;
    }

    .logo_text p {
        display: none;
    }

    /* Mobile "Home" link placed in the logo row, far right corner */
    .mobile-home {
        display: inline-flex !important;
        margin-left: auto;
    }

    .nav {
        order: 2;
        width: 100%;
        justify-content: flex-end;
        gap: 0.9rem;
        padding: 0.55rem 0.25rem 0;
        border-top: 1px solid var(--line);
    }

    /* Hide the redundant Home link that sits inside the utils row (.nav);
       the mobile Home button lives in the logo row instead. */
    .nav .nav_button {
        display: none;
    }

    .notif-drawer {
        width: 94vw;
        right: -96vw;
    }
    .comment-replies {
        margin-left: 0.5rem;
        padding-left: 0.75rem;
    }
}
.lumora-toast.warning {
    border-left: 4px solid #f59e0b;
}

.lumora-toast.info {
    border-left: 4px solid #d98fa0;
}

.lumora-toast-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.lumora-toast-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lumora-toast-body strong {
    font-size: 0.92rem;
}

.lumora-toast-body span {
    font-size: 0.82rem;
    color: rgba(241, 245, 249, 0.8);
    line-height: 1.4;
}

.lumora-toast-close {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
}

.lumora-modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 24, 0.5);
    backdrop-filter: blur(8px);
    z-index: 3100;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.lumora-modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.lumora-modal-backdrop.hide {
    opacity: 0;
    pointer-events: none;
}

.lumora-modal {
    width: min(440px, calc(100vw - 2rem));
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--line);
}

.lumora-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.8rem;
}

.lumora-modal-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: #ffffff;
    font-weight: 800;
}

.lumora-modal h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-deep);
}

.lumora-modal p {
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.lumora-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
}

.lumora-btn {
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
}

.lumora-btn-secondary {
    background: var(--surface-alt);
    color: var(--text);
}

.lumora-btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;


/* ===== LEGAL PAGES (Privacy Policy & Terms of Service) ===== */

.legal-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 24px 80px;
    line-height: 1.75;
}

.legal-page h1 {
    font-size: 2rem;
    margin-bottom: 4px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legal-updated {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 28px;
}

.legal-page h2 {
    font-size: 1.15rem;
    margin-top: 32px;
    margin-bottom: 8px;
    color: var(--text);
}

.legal-page p {
    margin-bottom: 12px;
    color: var(--text-secondary, var(--text));
}

.legal-page ul {
    margin: 8px 0 16px 24px;
    color: var(--text-secondary, var(--text));
}

.legal-page li {
    margin-bottom: 6px;
}

.legal-page a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-page a:hover {
    opacity: 0.8;
}

}
