/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Sections */
.section {
    max-width: 1320px;
    width: 100%;
    margin: 3rem auto;
    padding: 0 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.02em;
    position: relative;
    padding-left: 1.1rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
}

.view-all {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #a5b4fc;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.view-all:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    color: #c7d2fe;
    transform: translateX(2px);
}

/* Legal / static content pages */
.legal-page {
    position: relative;
    z-index: 1;
    max-width: 920px;
    margin: 0 auto;
    padding: 4rem 1.5rem 5rem;
}

.legal-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.legal-hero-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.35rem;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.legal-hero-icon svg {
    width: 34px;
    height: 34px;
}

.legal-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.04em;
    margin: 0 0 0.75rem;
}

.legal-hero h1 span {
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.legal-hero .meta {
    color: #94a3b8;
    font-size: 1.05rem;
    margin: 0;
}

.legal-card {
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: clamp(1.75rem, 4vw, 3rem);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    color: #cbd5e1;
    line-height: 1.8;
}

.legal-card h2 {
    font-size: 1.35rem;
    color: #fff;
    font-weight: 700;
    margin: 0 0 0.85rem;
}

.legal-card p {
    margin: 0 0 1.75rem;
}

.legal-card p:last-child {
    margin-bottom: 0;
}

.legal-card a {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-card ul {
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
}

.legal-card li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.65rem;
    color: #94a3b8;
}

.legal-card li svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.legal-notice {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 14px;
    padding: 1.15rem 1.35rem;
    margin-bottom: 2rem;
    color: #fca5a5;
    font-size: 0.95rem;
}

.legal-notice svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #f87171;
    margin-top: 0.1rem;
}

.pay-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
}

.pay-badge svg {
    width: 18px;
    height: 18px;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.check-row svg {
    width: 18px;
    height: 18px;
    color: #10b981;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

/* OriginRealm custom HTTP error pages */
.or-error {
    position: relative;
    isolation: isolate;
    min-height: min(68vh, 720px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.25rem 5rem;
    overflow: hidden;
}

.or-error-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(8px);
}

.or-error-glow-a {
    width: min(520px, 80vw);
    height: min(520px, 80vw);
    top: -12%;
    left: 50%;
    transform: translateX(-55%);
    background: radial-gradient(circle, var(--or-error-glow, rgba(96, 165, 250, 0.22)) 0%, transparent 68%);
    animation: or-error-pulse 7s ease-in-out infinite;
}

.or-error-glow-b {
    width: min(380px, 70vw);
    height: min(380px, 70vw);
    bottom: -8%;
    right: 8%;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.9) 0%, transparent 70%);
}

@keyframes or-error-pulse {
    0%, 100% { opacity: 0.75; transform: translateX(-55%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.06); }
}

.or-error-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    text-align: center;
    padding: 2.75rem 2rem 2.5rem;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(22, 32, 52, 0.92), rgba(10, 15, 28, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.02) inset,
        0 28px 60px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: or-error-rise 0.55s ease-out;
}

@keyframes or-error-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.or-error-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.35rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--or-error-accent, #60a5fa);
    background: color-mix(in srgb, var(--or-error-accent, #60a5fa) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--or-error-accent, #60a5fa) 40%, transparent);
    box-shadow: 0 0 28px var(--or-error-glow, rgba(96, 165, 250, 0.22));
}

.or-error-icon svg {
    width: 34px;
    height: 34px;
}

.or-error-code {
    margin: 0 0 0.65rem;
    font-size: clamp(3.5rem, 10vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 0.95;
    color: var(--or-error-accent, #60a5fa);
    text-shadow: 0 0 40px var(--or-error-glow, rgba(96, 165, 250, 0.35));
}

.or-error-title {
    margin: 0 0 0.85rem;
    font-size: clamp(1.55rem, 3.5vw, 2rem);
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.03em;
}

.or-error-message {
    margin: 0 auto 1.85rem;
    max-width: 38ch;
    color: #94a3b8;
    font-size: 1.05rem;
    line-height: 1.65;
}

.or-error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

.or-error-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.7rem 1.35rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.or-error-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.or-error-btn-primary {
    color: #0b1220;
    background: linear-gradient(135deg, #93c5fd, #3b82f6);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.28);
}

.or-error-btn-primary:hover {
    transform: translateY(-2px);
    color: #0b1220;
}

.or-error-btn-ghost {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

.or-error-btn-ghost:hover {
    color: #fff;
    border-color: color-mix(in srgb, var(--or-error-accent, #60a5fa) 55%, rgba(255,255,255,0.12));
    background: color-mix(in srgb, var(--or-error-accent, #60a5fa) 12%, transparent);
}

.or-error-extra {
    margin-top: 1.75rem;
    padding-top: 1.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.or-error-hint {
    margin: 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.55;
}

.or-error-hint a {
    color: var(--or-error-accent, #60a5fa);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.or-error-search {
    display: flex;
    gap: 0.55rem;
    max-width: 360px;
    margin: 0.85rem auto 0;
}

.or-error-search input {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 0.95rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
    color: #e2e8f0;
    font-size: 0.92rem;
    font-family: inherit;
}

.or-error-search input::placeholder {
    color: #64748b;
}

.or-error-search input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--or-error-accent, #60a5fa) 70%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--or-error-accent, #60a5fa) 18%, transparent);
}

.or-error-search button {
    width: 46px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    color: #0b1220;
    background: linear-gradient(135deg, #93c5fd, #3b82f6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.or-error-search button svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 560px) {
    .or-error {
        padding: 2.5rem 1rem 3.5rem;
        min-height: auto;
    }

    .or-error-panel {
        padding: 2.1rem 1.25rem 1.85rem;
    }

    .or-error-actions {
        flex-direction: column;
    }

    .or-error-btn {
        width: 100%;
    }
}

/* User Profile */
.profile-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.profile-header {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Thread Detail */
.thread-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.thread-content {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.thread-author {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-item {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.reply-form {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.reply-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    resize: vertical;
    margin-bottom: 1rem;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid var(--bg-card);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notifications */
.notification {
    position: fixed;
    top: 80px;
    right: 2rem;
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

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

.notification.success {
    border-left: 4px solid #27ae60;
}

.notification.error {
    border-left: 4px solid var(--accent);
}

/* Breadcrumb */
.breadcrumb {
    max-width: 1280px;
    width: 100%;
    margin: 1rem auto;
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.page-btn {
    padding: 0.6rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.page-btn:hover, .page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Go Back Button */
.go-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    margin-bottom: 1.5rem;
}

.go-back-btn:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.go-back-btn i {
    font-size: 1.2rem;
}

/* Statistics Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-box {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #6366f1;
    transition: all 0.3s;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.stat-box h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.stat-box .value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #6366f1;
}

.stat-box .label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Modal/Overlay Close */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--accent-secondary);
    transform: rotate(90deg);
}

/* Detail Page Container with Close */
.detail-container {
    position: relative;
    padding-top: 60px;
}

.detail-container .close-btn {
    position: fixed;
}

/* Promoted CTA */
.promote-your-series-cta {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px dashed rgba(255, 215, 0, 0.3);
}

.btn-promote {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: 15px 40px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-promote:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, #FFA500 0%, #FFD700 100%);
}

.promote-info {
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Light Black / Midnight Slate Component Overrides */
[data-theme="light"] .section-title {
    color: #ffffff !important;
}

[data-theme="light"] .view-all {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: #a5b4fc !important;
}

[data-theme="light"] .view-all:hover {
    background: rgba(99, 102, 241, 0.28) !important;
    color: #ffffff !important;
}

[data-theme="light"] .glass-form-container,
[data-theme="light"] .glass-form-card,
[data-theme="light"] .profile-header,
[data-theme="light"] .channel-banner {
    background: rgba(28, 38, 56, 0.94) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="light"] .profile-header-details h1,
[data-theme="light"] .channel-name,
[data-theme="light"] .glass-card-header,
[data-theme="light"] .tab-header-title {
    color: #ffffff !important;
}

[data-theme="light"] .profile-email,
[data-theme="light"] .channel-owner,
[data-theme="light"] .channel-description,
[data-theme="light"] .stat-label {
    color: #94a3b8 !important;
}

[data-theme="light"] .stat-item {
    background: #1c2638 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .tabs {
    background: rgba(28, 38, 56, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .tab-btn {
    color: #94a3b8 !important;
}

[data-theme="light"] .tab-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

[data-theme="light"] .tab-btn.active {
    color: #ffffff !important;
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

[data-theme="light"] .form-group input:not([type="checkbox"]):not([type="file"]):not([type="radio"]),
[data-theme="light"] .form-group textarea,
[data-theme="light"] .form-group select {
    background: #1c2638 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .form-group label {
    color: #cbd5e1 !important;
}

[data-theme="light"] .file-dropzone {
    background: #1c2638 !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

[data-theme="light"] .lib-pill {
    background: #1c2638 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}

[data-theme="light"] .lib-pill-count {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
}

[data-theme="light"] .lib-pill:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #a5b4fc !important;
}

[data-theme="light"] .lib-pill-active {
    background: rgba(99, 102, 241, 0.25) !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
    color: #ffffff !important;
}



