/* ===============================================
   AI Story Club - Design System V3
   Modern, playful UI for young creators
   Inspired by Wattpad but more contemporary
   =============================================== */

/* ========== DESIGN TOKENS ========== */
:root {
    /* Core palette - warm coral + cool teal */
    --coral: #FF6B4A;
    --coral-light: #FF8A6B;
    --coral-dark: #E5523A;
    --teal: #2EC4B6;
    --teal-light: #3EDDD0;
    --sunny: #FFD166;
    --purple: #9B5DE5;
    --pink: #F15BB5;

    /* Neutrals with warmth */
    --gray-50: #FEF9F5;
    --gray-100: #FDF2EB;
    --gray-200: #F5E6D8;
    --gray-300: #E8D5C4;
    --gray-400: #C4B0A0;
    --gray-500: #8A7A6B;
    --gray-600: #5C5045;
    --gray-700: #3D3430;
    --gray-800: #2A2320;
    --gray-900: #1A1512;

    /* Semantic */
    --bg: var(--gray-50);
    --text: var(--gray-800);
    --text-secondary: var(--gray-500);
    --accent: var(--coral);
    --accent-alt: var(--teal);

    /* Typography */
    --font-display: 'Space Grotesk', 'Noto Sans SC', sans-serif;
    --font-body: 'Noto Sans SC', sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
    --shadow-coral: 0 4px 20px rgba(255, 107, 74, 0.3);
    --shadow-coral-hover: 0 8px 30px rgba(255, 107, 74, 0.4);
}

[data-theme="dark"] {
    /* 暗色主题 - 不是简单反色，而是精心设计的暗色配色 */
    --bg: #1A1512;
    --text: #E8E8E8;
    --text-secondary: #A0A0B0;
    
    /* 暗色版本的灰度 */
    --gray-50: #2A2320;
    --gray-100: #3D3430;
    --gray-200: #5C5045;
    --gray-300: #8A7A6B;
    --gray-400: #C4B0A0;
    --gray-500: #A0A0B0;
    --gray-600: #8A7A6B;
    --gray-700: #5C5045;
    --gray-800: #3D3430;
    --gray-900: #1A1512;
    
    /* 暗色下的主色调调整 */
    --coral: #FF8A6B;
    --coral-light: #FFAA8B;
    --coral-dark: #FF6B4A;
    --teal: #3EDDD0;
    --teal-light: #5EDDE0;
    --sunny: #FFD166;
    --purple: #B77DE5;
    --pink: #F15BB5;
    
    /* 暗色阴影 */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.4);
    --shadow-coral: 0 4px 20px rgba(255, 138, 107, 0.3);
    --shadow-coral-hover: 0 8px 30px rgba(255, 138, 107, 0.4);
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* ========== LAYOUT ========== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.main-content {
    min-height: calc(100vh - 200px);
    padding-top: 80px;
}

/* ========== NAVIGATION ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 0;
    transition: all 0.3s var(--ease-out);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(254, 249, 245, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--gray-200);
    padding: 10px 0;
}

[data-theme="dark"] .navbar.scrolled {
    background: rgba(26, 21, 18, 0.95);
    box-shadow: 0 1px 0 var(--gray-700);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--coral);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.3s var(--ease-spring);
}

.nav-logo:hover .nav-logo-icon {
    transform: rotate(-10deg) scale(1.1);
}

.nav-logo span:last-child {
    color: var(--coral);
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
    padding: 8px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--coral);
    transition: width 0.3s var(--ease-out);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

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

.nav-highlight {
    background: var(--coral) !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
}

.nav-highlight::after {
    display: none !important;
}

.nav-highlight:hover {
    background: var(--coral-dark) !important;
    transform: translateY(-2px);
}

/* Nav Right */
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme Toggle */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 2px solid var(--gray-200);
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.theme-toggle:hover {
    border-color: var(--coral);
}

/* User Menu */
.nav-user-menu {
    position: relative;
}

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    background: var(--bg);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
}

.nav-user-btn:hover {
    border-color: var(--coral);
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--coral);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.nav-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.nav-user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    padding: 8px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s var(--ease-out);
}

[data-theme="dark"] .nav-dropdown {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.nav-user-menu:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-dropdown-item:hover {
    background: var(--gray-100);
    color: var(--coral);
}

[data-theme="dark"] .nav-dropdown-item:hover {
    background: var(--gray-700);
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

[data-theme="dark"] .nav-dropdown-divider {
    background: var(--gray-700);
}

.nav-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 2px solid var(--gray-200);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    position: relative;
    transition: all 0.2s;
}

.nav-icon-btn:hover {
    border-color: var(--coral);
    transform: translateY(-2px);
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--coral);
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-badge-accent {
    background: var(--teal);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 14px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.4s var(--ease-out);
    line-height: 1.2;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s var(--ease-out);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--coral);
    color: white;
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s var(--ease-out);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: var(--coral-dark);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.5);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--gray-300);
}

.btn-outline:hover {
    border-color: var(--coral);
    color: var(--coral);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 10px 20px;
}

.btn-ghost:hover {
    color: var(--coral);
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* ========== HERO ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 120px 24px 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background:
        radial-gradient(circle, rgba(255, 107, 74, 0.08) 0%, transparent 70%),
        radial-gradient(circle at 30% 70%, rgba(46, 196, 182, 0.05) 0%, transparent 50%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatBubble 20s ease-in-out infinite;
}

@keyframes floatBubble {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(46, 196, 182, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatBubble 25s ease-in-out infinite reverse;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--coral);
    color: white;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    animation: fadeInUp 0.6s var(--ease-out);
}

.hero h1 {
    font-size: clamp(4rem, 8vw, 7rem);
    font-weight: 900;
    color: var(--text);
    margin-bottom: 32px;
    animation: fadeInUp 0.6s 0.1s var(--ease-out) both;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.hero h1 .accent {
    color: var(--coral);
    position: relative;
    display: inline-block;
}

.hero h1 .accent::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: -4px;
    right: -4px;
    height: 12px;
    background: rgba(255, 107, 74, 0.15);
    border-radius: 6px;
    z-index: -1;
}

.hero-sub {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 40px;
    max-width: 600px;
    animation: fadeInUp 0.6s 0.2s var(--ease-out) both;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s 0.3s var(--ease-out) both;
}

/* Hero Stats */
.hero-stats {
    padding: 80px 24px;
    background: linear-gradient(135deg, var(--coral) 0%, #ff8a65 100%);
    margin-top: -1px;
    position: relative;
    overflow: hidden;
}

.hero-stats::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatBubble 30s ease-in-out infinite;
}

.stats-flex-center {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
    position: relative;
    z-index: 1;
}

.stat-number-primary,
.stat-number-accent,
.stat-number-success {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 12px;
    color: white;
    letter-spacing: -0.02em;
}

.text-center {
    text-align: center;
    color: white;
}

.text-muted {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* ========== SECTION ========== */
.section {
    padding: 120px 24px;
}

.section-header {
    margin-bottom: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}

.section-header-centered {
    text-align: center;
    flex-direction: column;
    justify-content: center;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--coral);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    letter-spacing: -0.02em;
}

.section-title-icon {
    font-size: 1em;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
}

.section-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--coral);
    text-decoration: none;
    transition: all 0.2s;
}

.section-link:hover {
    color: var(--coral-dark);
    gap: 4px;
}

/* ========== STORIES GRID ========== */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
}

.story-card {
    background: var(--bg);
    border-radius: 24px;
    overflow: hidden;
    border: 2px solid var(--gray-200);
    transition: all 0.5s var(--ease-out);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

[data-theme="dark"] .story-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.story-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--coral), var(--teal));
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}

.story-card:hover::before {
    opacity: 1;
}

.story-card-cover {
    height: 180px;
    position: relative;
    overflow: hidden;
}

.story-card-cover.scifi {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.story-card-cover.fantasy {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.story-card-cover.mystery {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.story-card-cover.romance {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
}

.story-card-cover.horror {
    background: linear-gradient(135deg, #434343 0%, #000000 100%);
}

.story-card-cover.comedy {
    background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
}

.story-card-cover-default {
    background: linear-gradient(135deg, #FF6B4A 0%, #2EC4B6 100%);
}

.story-card-cover-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

[data-theme="dark"] .story-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.story-card:hover {
    transform: translateY(-12px);
    border-color: var(--coral);
    box-shadow: 0 30px 80px rgba(255, 107, 74, 0.2);
}

/* Staggered animation for story cards */
.story-card.animate-on-scroll:nth-child(1) { animation-delay: 0s; }
.story-card.animate-on-scroll:nth-child(2) { animation-delay: 0.1s; }
.story-card.animate-on-scroll:nth-child(3) { animation-delay: 0.2s; }
.story-card.animate-on-scroll:nth-child(4) { animation-delay: 0.3s; }
.story-card.animate-on-scroll:nth-child(5) { animation-delay: 0.4s; }
.story-card.animate-on-scroll:nth-child(6) { animation-delay: 0.5s; }

.story-card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-category {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--coral);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(46, 196, 182, 0.1);
    color: var(--teal);
    border-radius: 4px;
    font-weight: 600;
}

.card-body {
    padding: 0 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.story-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.3;
}

.story-title a {
    color: inherit;
    text-decoration: none;
}

.story-title a:hover {
    color: var(--coral);
}

.story-summary {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
}

.story-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

[data-theme="dark"] .story-card-footer {
    border-color: var(--gray-700);
}

.story-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--coral);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.story-author-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.story-stats {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ========== CATEGORIES ========== */
.categories-section {
    background: var(--gray-100);
}

.categories-tags {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.category-tag-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    background: white;
    border-radius: 16px;
    border: 2px solid var(--gray-200);
    text-decoration: none;
    transition: all 0.3s var(--ease-out);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

[data-theme="dark"] .category-tag-link {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.category-tag-link:hover {
    border-color: var(--coral);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.12);
    color: var(--coral);
}

.category-count-badge {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ========== FEATURES ========== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
}

.feature-card {
    padding: 32px;
    background: white;
    border-radius: 20px;
    border: 2px solid var(--gray-200);
    transition: all 0.4s var(--ease-out);
}

[data-theme="dark"] .feature-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.feature-card:hover {
    border-color: var(--teal);
    transform: translateY(-4px);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.feature-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--gray-800);
    color: var(--gray-300);
    padding: var(--space-lg) 24px var(--space-md);
    margin-top: auto;
}

[data-theme="dark"] .footer {
    background: var(--gray-900);
}

.footer .container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: var(--space-lg);
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.footer-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: var(--gray-400);
}

.footer-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--coral);
}

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid var(--gray-700);
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* ========== AUTH PAGES ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 60px;
    background: var(--gray-50);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 107, 74, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: white;
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--gray-200);
    transition: all 0.4s var(--ease-out);
}

[data-theme="dark"] .auth-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--coral);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

[data-theme="dark"] .auth-footer {
    border-color: var(--gray-700);
}

.auth-footer a {
    color: var(--coral);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: var(--coral-dark);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.1);
}

[data-theme="dark"] .form-control {
    background: var(--gray-900);
    border-color: var(--gray-700);
}

.password-wrapper {
    position: relative;
}

.password-input-pr {
    padding-right: 50px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    transition: transform 0.2s;
}

.password-toggle-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-accent {
    width: 18px;
    height: 18px;
    accent-color: var(--coral);
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.mb-24 {
    margin-bottom: 24px;
}

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

/* ========== BACK TO TOP ========== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--coral);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: var(--shadow-coral);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s var(--ease-out);
    z-index: 50;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    background: var(--coral-dark);
}

/* ========== ALERTS ========== */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 0.95rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(46, 196, 182, 0.1);
    color: var(--teal);
    border: 2px solid rgba(46, 196, 182, 0.2);
}

.alert-error {
    background: rgba(255, 107, 74, 0.1);
    color: var(--coral);
    border: 2px solid rgba(255, 107, 74, 0.2);
}

.alert-warning {
    background: rgba(255, 209, 102, 0.1);
    color: #B8860B;
    border: 2px solid rgba(255, 209, 102, 0.2);
}

.alert-info {
    background: rgba(155, 93, 229, 0.1);
    color: var(--purple);
    border: 2px solid rgba(155, 93, 229, 0.2);
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.empty-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ========== CTA ========== */
.cta-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.cta-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

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

/* ========== BG TERTIARY ========== */
.bg-tertiary {
    background: var(--gray-100);
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s var(--ease-out);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: 100px 20px 60px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .stats-flex-center {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .stories-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding-top: 70px;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-buttons {
        flex-direction: column;
    }

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

/* ========== UTILITIES ========== */
.mt-20 {
    margin-top: 20px;
}

.fs-14 {
    font-size: 0.875rem;
}

/* ========== FONTS ========== */
/* ========== STATS BANNER ========== */
.stats-banner { background: var(--coral); padding: 48px 24px; margin-top: -1px; }
.stats-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.stat-item { text-align: center; color: white; }
.stat-number { font-family: var(--font-display); font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 700; line-height: 1; margin-bottom: 8px; }
.stat-label { font-size: 1.1rem; opacity: 0.9; }

/* ========== GENERATE PAGE ========== */
.gen-container { max-width: 900px; margin: 0 auto; padding: 120px 24px 80px; }
.gen-title { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; color: var(--text); margin-bottom: 12px; }
.gen-subtitle { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 32px; }
.gen-form-section { background: var(--bg); border: 2px solid var(--gray-200); border-radius: 20px; padding: 32px; margin-bottom: 32px; transition: all 0.3s var(--ease-out); }
[data-theme="dark"] .gen-form-section { background: var(--gray-800); border-color: var(--gray-700); }
.gen-form-section:hover { border-color: var(--coral); box-shadow: 0 8px 32px rgba(255,107,74,0.08); }
.gen-form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.gen-form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.gen-textarea { width: 100%; padding: 16px; border: 2px solid var(--gray-300); border-radius: 12px; font-family: var(--font-body); font-size: 1rem; color: var(--text); background: var(--bg); resize: vertical; transition: border-color 0.2s; }
.gen-textarea:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(255,107,74,0.1); }
[data-theme="dark"] .gen-textarea { background: var(--gray-900); border-color: var(--gray-700); }
.gen-input { width: 100%; padding: 14px 16px; border: 2px solid var(--gray-300); border-radius: 12px; font-size: 1rem; font-family: var(--font-body); color: var(--text); background: var(--bg); transition: border-color 0.2s; }
.gen-input:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(255,107,74,0.1); }
[data-theme="dark"] .gen-input { background: var(--gray-900); border-color: var(--gray-700); }
.gen-btn-group { display: flex; gap: 16px; flex-wrap: wrap; }
.field-label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.input-full { width: 100%; padding: 14px 16px; border: 2px solid var(--gray-300); border-radius: 12px; font-size: 1rem; font-family: var(--font-body); color: var(--text); background: var(--bg); transition: border-color 0.2s; }
.input-full:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(255,107,74,0.1); }
[data-theme="dark"] .input-full { background: var(--gray-900); border-color: var(--gray-700); }
select.input-full { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; cursor: pointer; }
.w-full { width: 100%; }

/* ========== STORY PAGE ========== */
.story-page { padding: 120px 24px 80px; max-width: 900px; margin: 0 auto; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 32px; }
.breadcrumb-sep { color: var(--gray-400); }
.link-muted { color: var(--text-secondary); text-decoration: none; transition: color 0.2s; }
.link-muted:hover { color: var(--coral); }
.text-current { color: var(--text); font-weight: 500; }
.story-detail { margin-bottom: 48px; }
.story-header { margin-bottom: 32px; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 100px; font-size: 0.85rem; font-weight: 600; }
.category-badge { background: rgba(255,107,74,0.1); color: var(--coral); }
.badge-ai { background: rgba(46,196,182,0.1); color: var(--teal); }
.badge-progress { background: rgba(155,93,229,0.1); color: var(--purple); }
.story-title { font-family: var(--font-display); font-size: clamp(2rem,4vw,3rem); font-weight: 700; color: var(--text); line-height: 1.2; margin-bottom: 20px; }
.author-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.author-info { display: flex; align-items: center; gap: 14px; }
.avatar-lg { width: 48px; height: 48px; border-radius: 14px; background: var(--coral); color: white; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700; flex-shrink: 0; }
.avatar-link { text-decoration: none; }
.author-meta { display: flex; flex-direction: column; gap: 2px; }
.author-name { font-weight: 600; color: var(--text); text-decoration: none; font-size: 1rem; }
.author-name:hover { color: var(--coral); }
.author-stats { font-size: 0.85rem; color: var(--text-secondary); }
.story-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s var(--ease-out); font-family: var(--font-display); }
.btn-secondary { background: var(--gray-100); color: var(--text); border: 2px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); transform: translateY(-2px); }
[data-theme="dark"] .btn-secondary { background: var(--gray-700); border-color: var(--gray-600); color: var(--gray-100); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: none; padding: 8px 12px; }
.btn-ghost:hover { color: var(--coral); }
.story-content { font-size: 1.1rem; line-height: 1.85; color: var(--text); margin-bottom: 40px; }
.story-content h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin: 2em 0 0.8em; color: var(--text); }
.story-content h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; margin: 1.5em 0 0.6em; color: var(--text); }
.story-content p { margin-bottom: 1.2em; }
.story-content blockquote { border-left: 4px solid var(--coral); padding: 16px 20px; margin: 1.5em 0; background: rgba(255,107,74,0.05); border-radius: 0 12px 12px 0; color: var(--text-secondary); }
.story-content code { background: var(--gray-100); padding: 2px 8px; border-radius: 6px; font-size: 0.9em; }
[data-theme="dark"] .story-content code { background: var(--gray-700); }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.tag-item { display: inline-block; padding: 6px 14px; background: var(--gray-100); border-radius: 100px; font-size: 0.85rem; color: var(--text-secondary); text-decoration: none; transition: all 0.2s; }
.tag-item:hover { background: var(--coral); color: white; }
[data-theme="dark"] .tag-item { background: var(--gray-700); }
.action-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 24px 0; border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); }
[data-theme="dark"] .action-bar { border-color: var(--gray-700); }
.action-bar-left { display: flex; gap: 12px; flex-wrap: wrap; }
.action-bar-right { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.action-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px; border: 2px solid var(--gray-200); background: var(--bg); cursor: pointer; font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); transition: all 0.2s var(--ease-out); }
.action-btn:hover { border-color: var(--coral); color: var(--coral); transform: translateY(-2px); }
.action-btn.active { background: rgba(255,107,74,0.08); border-color: var(--coral); color: var(--coral); }
.action-label { font-size: 0.85rem; }
.like-icon, .fav-icon { font-size: 1.1rem; }

/* Comments */
.comment-form { margin-bottom: 32px; }
.comment-form-inner { display: flex; gap: 16px; align-items: flex-start; }
.comment-form-body { flex: 1; }
.textarea-lg { width: 100%; padding: 14px 16px; border: 2px solid var(--gray-300); border-radius: 12px; font-family: var(--font-body); font-size: 1rem; color: var(--text); background: var(--bg); resize: vertical; min-height: 80px; transition: border-color 0.2s; }
.textarea-lg:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(255,107,74,0.1); }
[data-theme="dark"] .textarea-lg { background: var(--gray-900); border-color: var(--gray-700); }
.comment-form-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.fs-12 { font-size: 0.75rem; }
.comment-list { display: flex; flex-direction: column; gap: 20px; }
.comment-item { padding: 20px; background: var(--bg); border: 1px solid var(--gray-200); border-radius: 16px; transition: all 0.2s; }
[data-theme="dark"] .comment-item { background: var(--gray-800); border-color: var(--gray-700); }
.comment-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.comment-inner { display: flex; gap: 14px; }
.comment-body { flex: 1; }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-username { font-weight: 600; color: var(--text); text-decoration: none; font-size: 0.95rem; }
.comment-username:hover { color: var(--coral); }
.comment-text { font-size: 0.95rem; color: var(--text); line-height: 1.6; }
.comment-actions { display: flex; gap: 12px; margin-top: 10px; }
.reply-toggle-btn { background: none; border: none; cursor: pointer; font-size: 0.85rem; color: var(--text-secondary); padding: 4px 0; transition: color 0.2s; }
.reply-toggle-btn:hover { color: var(--coral); }
.comment-delete-btn { background: none; border: none; cursor: pointer; font-size: 0.85rem; color: var(--danger, #ef4444); padding: 4px 0; transition: opacity 0.2s; }
.d-inline { display: inline; }
.reply-form { display: none; margin-top: 12px; padding: 16px; background: var(--gray-50); border-radius: 12px; }
[data-theme="dark"] .reply-form { background: var(--gray-700); }
.reply-form[style*="block"] { display: block !important; }
.reply-to-label { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px; }
.textarea-reply { width: 100%; padding: 10px 14px; border: 2px solid var(--gray-300); border-radius: 10px; font-family: var(--font-body); font-size: 0.9rem; color: var(--text); background: var(--bg); resize: vertical; min-height: 60px; transition: border-color 0.2s; }
.textarea-reply:focus { outline: none; border-color: var(--coral); }
.reply-actions { display: flex; gap: 8px; margin-top: 10px; }
.comment-replies { margin-top: 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.reply-item { padding: 12px 16px; background: var(--gray-50); border-radius: 12px; }
[data-theme="dark"] .reply-item { background: var(--gray-700); }
.reply-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.reply-username { font-weight: 600; color: var(--text); text-decoration: none; font-size: 0.9rem; }
.reply-username:hover { color: var(--coral); }
.reply-sep { color: var(--gray-400); font-size: 0.85rem; }
.reply-to { color: var(--coral); text-decoration: none; font-size: 0.85rem; }
.reply-meta { color: var(--text-secondary); font-size: 0.8rem; }
.reply-text { font-size: 0.9rem; color: var(--text); line-height: 1.5; }
.mt-8 { margin-top: 8px; }
.empty-state-sm { text-align: center; padding: 32px 20px; color: var(--text-secondary); font-size: 0.95rem; }

/* Share Modal */
.share-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.share-modal[style*="flex"] { display: flex !important; }
.share-modal-content { background: var(--bg); border-radius: 20px; padding: 32px; max-width: 420px; width: 90%; text-align: center; }
.share-modal-content h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: 20px; }
.share-url-box { display: flex; gap: 8px; margin-bottom: 20px; }
.share-url-box input { flex: 1; padding: 10px 14px; border: 2px solid var(--gray-300); border-radius: 10px; font-size: 0.85rem; background: var(--gray-50); color: var(--text-secondary); }
.share-platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.share-platform-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border: 2px solid var(--gray-200); border-radius: 14px; background: var(--bg); cursor: pointer; font-size: 1.5rem; color: var(--text); transition: all 0.2s; }
.share-platform-btn span { font-size: 0.75rem; color: var(--text-secondary); }
.share-platform-btn:hover { border-color: var(--coral); transform: translateY(-2px); }

/* Reading Settings */
.reading-save-btn { position: fixed; bottom: 32px; left: 32px; padding: 10px 18px; border-radius: 12px; border: 2px solid var(--gray-200); background: var(--bg); cursor: pointer; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); box-shadow: var(--shadow-sm); transition: all 0.2s; z-index: 50; }
.reading-save-btn:hover { border-color: var(--coral); color: var(--coral); }
.reading-settings-toggle { position: fixed; bottom: 32px; left: 32px; width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--gray-200); background: var(--bg); cursor: pointer; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); transition: all 0.2s; z-index: 50; }
.reading-settings-toggle:hover { border-color: var(--coral); }
.reading-settings-panel { position: fixed; bottom: 90px; left: 32px; width: 280px; background: var(--bg); border: 2px solid var(--gray-200); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-lg); z-index: 51; display: none; }
[data-theme="dark"] .reading-settings-panel { background: var(--gray-800); border-color: var(--gray-700); }
.reading-settings-panel[style*="block"] { display: block !important; }
.reading-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.reading-panel-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--text); }
.reading-panel-close { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text-secondary); }
.reading-panel-section { margin-bottom: 20px; }
.reading-panel-section .field-label-lg { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.font-size-btn, .lh-btn { padding: 8px 14px; border: 2px solid var(--gray-200); border-radius: 10px; background: var(--bg); cursor: pointer; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); transition: all 0.2s; }
.font-size-btn:hover, .lh-btn:hover { border-color: var(--coral); }
.font-size-btn.active, .lh-btn.active { background: var(--coral); border-color: var(--coral); color: white; }
.bg-color-picker { display: flex; gap: 10px; }
.bg-btn { width: 36px; height: 36px; border-radius: 10px; border: 2px solid var(--gray-300); cursor: pointer; transition: all 0.2s; }
.bg-btn:hover { transform: scale(1.1); }
.bg-btn.active { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(255,107,74,0.2); }
.bg-btn[data-color="default"] { background: #ffffff; }
.bg-btn[data-color="sepia"] { background: #f5e6c8; }
.bg-btn[data-color="dark"] { background: #1a1a2e; }
.bg-btn[data-color="green"] { background: #c7edcc; }
.bg-btn[data-color="pink"] { background: #ffe4e1; }
.reading-font-select { width: 100%; padding: 10px 14px; border: 2px solid var(--gray-300); border-radius: 10px; font-size: 0.9rem; color: var(--text); background: var(--bg); cursor: pointer; }
.reading-reset-btn { width: 100%; padding: 10px; border: 2px solid var(--gray-200); border-radius: 10px; background: transparent; cursor: pointer; font-size: 0.85rem; color: var(--text-secondary); transition: all 0.2s; }
.reading-reset-btn:hover { border-color: var(--coral); color: var(--coral); }

/* Author stories */
.author-stories-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.author-story-link { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--bg); border: 1px solid var(--gray-200); border-radius: 12px; text-decoration: none; transition: all 0.2s; }
[data-theme="dark"] .author-story-link { background: var(--gray-800); border-color: var(--gray-700); }
.author-story-link:hover { border-color: var(--coral); transform: translateX(4px); }
.author-story-title { font-weight: 500; color: var(--text); font-size: 0.95rem; }
.author-story-link .fs-13 { font-size: 0.85rem; color: var(--text-secondary); }

/* ========== SEARCH PAGE ========== */
.search-title { font-family: var(--font-display); font-size: clamp(2rem,4vw,3rem); font-weight: 700; color: var(--text); margin-bottom: 24px; }
.search-form-flex { display: flex; gap: 12px; margin-bottom: 32px; }
.form-control-flex { flex: 1; }
.px-28 { padding-left: 28px; padding-right: 28px; }
.py-14 { padding-top: 14px; padding-bottom: 14px; }
.filters-bar { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 32px; padding: 20px; background: var(--bg); border: 2px solid var(--gray-200); border-radius: 16px; }
[data-theme="dark"] .filters-bar { background: var(--gray-800); border-color: var(--gray-700); }
.filter-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.select-min-140 { min-width: 140px; }
.hidden { display: none !important; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.pagination a, .pagination .page-current { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px; font-size: 0.9rem; font-weight: 500; text-decoration: none; transition: all 0.2s; }
.pagination a { border: 2px solid var(--gray-200); color: var(--text-secondary); background: var(--bg); }
.pagination a:hover { border-color: var(--coral); color: var(--coral); }
.pagination .page-current { background: var(--coral); color: white; border: 2px solid var(--coral); font-weight: 700; }

/* ========== PROFILE PAGE ========== */
.profile-container { max-width: 1000px; margin: 0 auto; padding: 120px 24px 80px; }
.profile-header { display: flex; gap: 32px; align-items: flex-start; margin-bottom: 48px; padding: 32px; background: var(--bg); border: 2px solid var(--gray-200); border-radius: 20px; }
[data-theme="dark"] .profile-header { background: var(--gray-800); border-color: var(--gray-700); }
.profile-avatar { flex-shrink: 0; }
.avatar-placeholder-lg { width: 96px; height: 96px; border-radius: 20px; background: var(--coral); color: white; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; font-weight: 700; }
.profile-info { flex: 1; }
.profile-username { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.profile-bio { font-size: 1rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }
.profile-stats { display: flex; gap: 32px; margin-bottom: 20px; }
.profile-stats .stat-item { text-align: left; color: var(--text); }
.profile-stats .stat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--text); display: block; }
.profile-stats .stat-label { font-size: 0.85rem; color: var(--text-secondary); opacity: 1; }
.profile-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.profile-stories { margin-top: 0; }
.profile-stories h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 24px; }
.stories-list { display: flex; flex-direction: column; gap: 12px; }
.story-list-item { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; background: var(--bg); border: 1px solid var(--gray-200); border-radius: 14px; transition: all 0.2s; }
[data-theme="dark"] .story-list-item { background: var(--gray-800); border-color: var(--gray-700); }
.story-list-item:hover { border-color: var(--coral); box-shadow: 0 4px 16px rgba(255,107,74,0.08); }
.story-list-content { flex: 1; }
.story-list-title { margin-bottom: 6px; }
.story-list-title a { font-weight: 600; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.story-list-title a:hover { color: var(--coral); }
.story-list-summary { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.5; }
.story-list-meta { display: flex; gap: 16px; font-size: 0.85rem; color: var(--text-secondary); }
.ai-badge-sm { display: inline-block; padding: 2px 8px; background: rgba(46,196,182,0.1); color: var(--teal); border-radius: 4px; font-size: 0.75rem; font-weight: 600; margin-left: 8px; }

/* ========== MY STORIES PAGE ========== */
.my-stories-container { max-width: 1000px; margin: 0 auto; padding: 120px 24px 80px; }
.page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 32px; }
.page-header h1 { font-family: var(--font-display); font-size: clamp(2rem,4vw,3rem); font-weight: 700; color: var(--text); }
.my-stories-container .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.my-stories-container .stat-card { background: var(--bg); border: 2px solid var(--gray-200); border-radius: 16px; padding: 24px; display: flex; align-items: center; gap: 16px; transition: all 0.3s var(--ease-out); }
[data-theme="dark"] .my-stories-container .stat-card { background: var(--gray-800); border-color: var(--gray-700); }
.my-stories-container .stat-card:hover { border-color: var(--coral); transform: translateY(-4px); box-shadow: 0 12px 40px rgba(255,107,74,0.12); }
.my-stories-container .stat-icon { font-size: 2rem; flex-shrink: 0; }
.my-stories-container .stat-body { flex: 1; }
.my-stories-container .stat-number { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; color: var(--coral); line-height: 1.1; }
.my-stories-container .stat-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }
.status-tabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 2px solid var(--gray-200); padding-bottom: 0; flex-wrap: wrap; }
[data-theme="dark"] .status-tabs { border-color: var(--gray-700); }
.status-tabs a { padding: 10px 20px; color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; }
.status-tabs a:hover { color: var(--coral); }
.status-tabs a.active { color: var(--coral); border-bottom-color: var(--coral); font-weight: 600; }
.stories-manage-list { display: flex; flex-direction: column; gap: 12px; }
.story-manage-item { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; background: var(--bg); border: 1px solid var(--gray-200); border-radius: 14px; gap: 20px; transition: all 0.2s; }
[data-theme="dark"] .story-manage-item { background: var(--gray-800); border-color: var(--gray-700); }
.story-manage-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.story-manage-content { flex: 1; }
.story-manage-title { margin-bottom: 8px; }
.story-manage-title a { font-weight: 600; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.story-manage-title a:hover { color: var(--coral); }
.story-manage-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; color: var(--text-secondary); }
.story-manage-meta .meta-item { display: flex; align-items: center; gap: 4px; }
.status-published { color: var(--teal); font-weight: 600; }
.status-draft { color: var(--warning, #f59e0b); font-weight: 600; }
.status-archived { color: var(--danger, #ef4444); font-weight: 600; }
.story-manage-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-danger { padding: 8px 16px; border-radius: 10px; border: 2px solid var(--danger, #ef4444); background: transparent; color: var(--danger, #ef4444); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: var(--font-display); }
.btn-danger:hover { background: var(--danger, #ef4444); color: white; }

/* ========== SETTINGS PAGE ========== */
.settings-container { max-width: 1000px; margin: 0 auto; padding: 120px 24px 80px; }
.settings-container > h1 { font-family: var(--font-display); font-size: clamp(2rem,4vw,3rem); font-weight: 700; color: var(--text); margin-bottom: 32px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 24px; }
.settings-card { background: var(--bg); border: 2px solid var(--gray-200); border-radius: 20px; padding: 32px; transition: all 0.3s var(--ease-out); }
[data-theme="dark"] .settings-card { background: var(--gray-800); border-color: var(--gray-700); }
.settings-card h2 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid var(--coral); display: inline-block; }
.settings-form .form-group { margin-bottom: 20px; }
.settings-form label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; color: var(--text); }
.settings-form input[type="text"], .settings-form input[type="email"], .settings-form input[type="password"], .settings-form textarea { width: 100%; padding: 12px 14px; border: 2px solid var(--gray-300); border-radius: 10px; font-size: 0.95rem; font-family: var(--font-body); color: var(--text); background: var(--bg); transition: border-color 0.2s; }
.settings-form input:focus, .settings-form textarea:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(255,107,74,0.1); }
[data-theme="dark"] .settings-form input, [data-theme="dark"] .settings-form textarea { background: var(--gray-900); border-color: var(--gray-700); }
.form-hint { display: block; margin-top: 6px; font-size: 0.8rem; color: var(--text-secondary); }
.avatar-review { text-align: center; margin-bottom: 20px; }
.avatar-lg-img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gray-200); }
.avatar-placeholder-lg { width: 120px; height: 120px; border-radius: 50%; background: var(--coral); color: white; display: inline-flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 700; }
.avatar-form .form-group { margin-bottom: 16px; }
.avatar-form input[type="file"] { width: 100%; padding: 10px 14px; border: 2px dashed var(--gray-300); border-radius: 10px; font-size: 0.9rem; color: var(--text-secondary); background: var(--gray-50); cursor: pointer; }
[data-theme="dark"] .avatar-form input[type="file"] { background: var(--gray-700); border-color: var(--gray-600); }
.danger-card { border-color: rgba(239,68,68,0.3) !important; }
.danger-card h2 { border-bottom-color: var(--danger, #ef4444) !important; color: var(--danger, #ef4444) !important; }
.danger-text { color: var(--text-secondary); margin-bottom: 20px; line-height: 1.6; font-size: 0.95rem; }

/* ========== MESSAGES PAGE ========== */
.msgs-container { max-width: 800px; margin: 0 auto; padding: 120px 24px 80px; }
.msgs-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }
.msgs-title { font-family: var(--font-display); font-size: clamp(2rem,4vw,3rem); font-weight: 700; color: var(--text); }
.msgs-unread-badge { padding: 6px 14px; background: var(--coral); color: white; border-radius: 100px; font-size: 0.85rem; font-weight: 600; }
.msgs-list { display: flex; flex-direction: column; gap: 12px; }
.msgs-item { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--bg); border: 2px solid var(--gray-200); border-radius: 16px; text-decoration: none; transition: all 0.2s var(--ease-out); }
[data-theme="dark"] .msgs-item { background: var(--gray-800); border-color: var(--gray-700); }
.msgs-item:hover { border-color: var(--coral); transform: translateX(4px); }
.msgs-item-avatar { width: 48px; height: 48px; border-radius: 14px; background: var(--coral); color: white; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700; flex-shrink: 0; }
.msgs-item-content { flex: 1; min-width: 0; }
.msgs-item-name-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.msgs-item-name { font-weight: 600; color: var(--text); font-size: 1rem; }
.msgs-item-name-row .fs-12 { font-size: 0.8rem; color: var(--text-secondary); }
.msgs-item-preview { font-size: 0.9rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msgs-unread-dot { min-width: 22px; height: 22px; padding: 0 6px; background: var(--coral); color: white; border-radius: 11px; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ========== NOTIFICATIONS PAGE ========== */
.notifications-container { max-width: 800px; margin: 0 auto; padding: 120px 24px 80px; }
.notifications-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }
.notifications-header h1 { font-family: var(--font-display); font-size: clamp(2rem,4vw,3rem); font-weight: 700; color: var(--text); }
.notifications-actions { display: flex; gap: 8px; }
.notifications-list { display: flex; flex-direction: column; gap: 12px; }
.notification-item { display: flex; gap: 14px; padding: 16px 20px; background: var(--bg); border: 1px solid var(--gray-200); border-radius: 14px; transition: all 0.2s; align-items: flex-start; }
[data-theme="dark"] .notification-item { background: var(--gray-800); border-color: var(--gray-700); }
.notification-item.unread { background: rgba(255,107,74,0.04); border-left: 3px solid var(--coral); }
.notification-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.notification-icon { font-size: 1.5rem; flex-shrink: 0; padding-top: 2px; }
.notification-content { flex: 1; min-width: 0; }
.notification-text { font-size: 0.95rem; color: var(--text); line-height: 1.5; margin-bottom: 8px; }
.notif-user { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; font-weight: 600; }
.notif-user:hover { color: var(--coral); }
.notif-avatar { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; }
.notif-avatar-placeholder { width: 24px; height: 24px; border-radius: 6px; background: var(--coral); color: white; display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; }
.notif-content-text { color: var(--text-secondary); }
.notif-link { color: var(--coral); text-decoration: none; font-weight: 500; margin-left: 4px; }
.notif-link:hover { text-decoration: underline; }
.notification-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; }
.notif-time { color: var(--text-secondary); }
.notif-delete { color: var(--danger, #ef4444); text-decoration: none; font-size: 0.8rem; transition: opacity 0.2s; }
.notif-delete:hover { opacity: 0.7; }

/* ========== FAVORITES / READING HISTORY ========== */
.favorites-container, .reading-history-container { max-width: 1000px; margin: 0 auto; padding: 120px 24px 80px; }
.favorites-container h1, .reading-history-container h1 { font-family: var(--font-display); font-size: clamp(2rem,4vw,3rem); font-weight: 700; color: var(--text); margin-bottom: 32px; }

/* ========== RESPONSIVE: PAGE-SPECIFIC ========== */
@media (max-width: 768px) {
    .gen-form-grid-2, .gen-form-grid-3 { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .profile-stats { justify-content: center; }
    .profile-actions { justify-content: center; }
    .my-stories-container .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .settings-grid { grid-template-columns: 1fr; }
    .story-manage-item { flex-direction: column; align-items: flex-start; }
    .story-manage-actions { width: 100%; justify-content: flex-end; }
    .author-bar { flex-direction: column; align-items: flex-start; }
    .action-bar { flex-direction: column; align-items: flex-start; }
    .status-tabs { flex-wrap: wrap; }
    .filters-bar { flex-direction: column; }
}
@media (max-width: 480px) {
    .my-stories-container .stats-grid { grid-template-columns: 1fr; }
    .pagination { gap: 4px; }
    .pagination a, .pagination .page-current { min-width: 34px; height: 34px; font-size: 0.8rem; padding: 0 8px; }
}

/* ========== UTILITIES (additional) ========== */
.gap-8 { gap: 8px; }
.p-40 { padding: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-32 { margin-bottom: 32px; }
.mb-40 { margin-bottom: 40px; }
.mt-8 { margin-top: 8px; }
.fs-13 { font-size: 0.85rem; }
/* ========== ADMIN PAGES ========== */
.admin-container { max-width: 1400px; margin: 0 auto; padding: 120px 24px 80px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 32px; }
.admin-header h1 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; color: var(--text); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--bg); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-table th { padding: 14px 16px; text-align: left; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); background: var(--gray-50); border-bottom: 2px solid var(--gray-200); }
[data-theme="dark"] .admin-table th { background: var(--gray-700); }
.admin-table td { padding: 14px 16px; font-size: 0.9rem; color: var(--text); border-bottom: 1px solid var(--gray-200); }
[data-theme="dark"] .admin-table td { border-color: var(--gray-700); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-50); }
[data-theme="dark"] .admin-table tr:hover td { background: var(--gray-700); }
.admin-actions { display: flex; gap: 8px; }
.admin-btn { padding: 6px 12px; border-radius: 8px; border: none; cursor: pointer; font-size: 0.85rem; font-weight: 500; text-decoration: none; transition: all 0.2s; }
.admin-btn-primary { background: var(--coral); color: white; }
.admin-btn-primary:hover { background: var(--coral-dark); }
.admin-btn-secondary { background: var(--gray-100); color: var(--text); border: 1px solid var(--gray-200); }
.admin-btn-secondary:hover { background: var(--gray-200); }
.admin-btn-danger { background: var(--danger, #ef4444); color: white; }
.admin-btn-danger:hover { opacity: 0.85; }
.admin-badge { display: inline-block; padding: 4px 10px; border-radius: 100px; font-size: 0.8rem; font-weight: 600; }
.bg-success { background: rgba(46,196,182,0.1); color: var(--teal); }
.bg-warning { background: rgba(245,158,11,0.1); color: #b8860b; }
.bg-danger { background: rgba(239,68,68,0.1); color: var(--danger, #ef4444); }

/* ========== RECOMMEND PAGE ========== */
.page-recommend {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 24px 80px;
    animation: fadeInUp 0.6s var(--ease-out);
}

.page-header {
    text-align: center;
    margin-bottom: 80px;
}

.page-title-recommend {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--coral), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle-recommend {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 100px 24px;
    animation: fadeInUp 0.6s var(--ease-out);
}

.empty-icon-lg {
    font-size: 6rem;
    margin-bottom: 24px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.empty-state p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.empty-state .text-primary {
    color: var(--coral);
    font-weight: 600;
    transition: color 0.2s;
}

.empty-state .text-primary:hover {
    color: var(--coral-dark);
}

/* Story Grid for Recommend Page */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 40px;
    animation: fadeInUp 0.6s 0.2s var(--ease-out) both;
}

/* ========== EDIT STORY PAGE ========== */
.edit-container { max-width: 900px; margin: 0 auto; padding: 120px 24px 80px; }
.edit-container h1 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; color: var(--text); margin-bottom: 32px; }
.edit-form-section { background: var(--bg); border: 2px solid var(--gray-200); border-radius: 20px; padding: 32px; margin-bottom: 32px; }
[data-theme="dark"] .edit-form-section { background: var(--gray-800); border-color: var(--gray-700); }
.edit-form-section h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid var(--gray-200); }
[data-theme="dark"] .edit-form-section h2 { border-color: var(--gray-700); }

/* ========== DELETE ACCOUNT PAGE ========== */
.delete-account-container { max-width: 600px; margin: 0 auto; padding: 120px 24px 80px; }
.delete-account-card { background: var(--bg); border: 2px solid var(--danger, #ef4444); border-radius: 20px; padding: 48px 40px; text-align: center; }
.delete-account-card h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--danger, #ef4444); margin-bottom: 16px; }
.delete-account-card p { font-size: 1.05rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 32px; }
.delete-account-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ========== DIAGNOSE SESSION PAGE ========== */
.diagnose-container { max-width: 900px; margin: 0 auto; padding: 120px 24px 80px; }
.diagnose-container pre { background: var(--gray-50); border: 2px solid var(--gray-200); border-radius: 12px; padding: 20px; font-size: 0.85rem; overflow: auto; margin-top: 20px; }
[data-theme="dark"] .diagnose-container pre { background: var(--gray-800); border-color: var(--gray-700); }

/* ========== SEND NOTIFICATION (ADMIN) ========== */
.send-notif-container { max-width: 700px; margin: 0 auto; padding: 120px 24px 80px; }
.send-notif-container h1 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; color: var(--text); margin-bottom: 32px; }

/* ========== LOGS PAGE (ADMIN) ========== */
.logs-container { max-width: 1400px; margin: 0 auto; padding: 120px 24px 80px; }
.logs-table { font-size: 0.85rem; }
.logs-pre { background: var(--gray-50); border: 2px solid var(--gray-200); border-radius: 12px; padding: 16px; font-size: 0.8rem; max-height: 400px; overflow: auto; }
[data-theme="dark"] .logs-pre { background: var(--gray-800); border-color: var(--gray-700); }

/* ========== VIEWS PAGE (ADMIN) ========== */
.views-container { max-width: 1400px; margin: 0 auto; padding: 120px 24px 80px; }
.views-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.view-stat-card { background: var(--bg); border: 2px solid var(--gray-200); border-radius: 16px; padding: 24px; text-align: center; }
[data-theme="dark"] .view-stat-card { background: var(--gray-800); border-color: var(--gray-700); }
.view-stat-number { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; color: var(--coral); }
.view-stat-label { font-size: 0.9rem; color: var(--text-secondary); margin-top: 4px; }

/* ========== STORY DETAIL PAGE (Optimized with impeccable principles) ========== */
.story-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    animation: fadeInUp 0.6s var(--ease-out);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

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

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

.breadcrumb-sep {
    color: var(--gray-400);
}

.text-current {
    color: var(--text);
    font-weight: 500;
}

/* Story Header */
.story-detail {
    margin-bottom: 48px;
}

.story-header {
    margin-bottom: 40px;
}

/* Badges */
.badge-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    animation: fadeInUp 0.4s var(--ease-out);
}

.category-badge {
    background: rgba(255, 107, 74, 0.1);
    color: var(--coral);
}

.badge-ai {
    background: rgba(46, 196, 182, 0.1);
    color: var(--teal);
}

.badge-progress {
    background: rgba(255, 209, 102, 0.15);
    color: #b8860b;
}

/* Story Title */
.story-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--text);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text) 0%, var(--coral) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .story-title {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--coral-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Author Bar */
.author-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 24px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    transition: all 0.3s var(--ease-out);
}

[data-theme="dark"] .author-bar {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.author-bar:hover {
    border-color: var(--coral);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.1);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-link {
    text-decoration: none;
    color: inherit;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--coral), var(--teal));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease-spring);
}

.avatar-link:hover .avatar-lg {
    transform: scale(1.1) rotate(-5deg);
}

.author-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.author-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.author-name:hover {
    color: var(--coral);
}

.author-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Story Actions */
.story-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Story Content */
.story-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
    margin: 40px 0;
    padding: 40px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    position: relative;
}

[data-theme="dark"] .story-content {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.story-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--coral), var(--teal), var(--sunny));
    border-radius: 20px 20px 0 0;
}

/* Markdown Styling */
.story-content h1,
.story-content h2,
.story-content h3 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text);
    margin-top: 2em;
    margin-bottom: 0.8em;
    line-height: 1.2;
}

.story-content h1 { font-size: 2rem; }
.story-content h2 { font-size: 1.6rem; }
.story-content h3 { font-size: 1.3rem; }

.story-content p {
    margin-bottom: 1.5em;
}

.story-content a {
    color: var(--coral);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.story-content a:hover {
    color: var(--coral-dark);
}

.story-content blockquote {
    border-left: 4px solid var(--coral);
    padding: 16px 24px;
    margin: 24px 0;
    background: rgba(255, 107, 74, 0.05);
    border-radius: 0 12px 12px 0;
    font-style: italic;
}

.story-content code {
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.9em;
}

[data-theme="dark"] .story-content code {
    background: var(--gray-700);
}

.story-content pre {
    background: var(--gray-900);
    color: #e5e7eb;
    padding: 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 24px 0;
}

.story-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Tags */
.tag-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.tag-item {
    display: inline-block;
    padding: 6px 16px;
    background: var(--gray-100);
    color: var(--text-secondary);
    border-radius: 100px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}

[data-theme="dark"] .tag-item {
    background: var(--gray-700);
}

.tag-item:hover {
    background: var(--coral);
    color: white;
    transform: translateY(-2px);
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 24px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    margin-bottom: 48px;
}

[data-theme="dark"] .action-bar {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.action-bar-left {
    display: flex;
    gap: 12px;
    align-items: center;
}

.action-bar-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Action Buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid var(--gray-200);
    border-radius: 14px;
    background: var(--bg);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s var(--ease-out);
}

[data-theme="dark"] .action-btn {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.action-btn:hover {
    border-color: var(--coral);
    color: var(--coral);
    transform: translateY(-2px);
}

.action-btn.active {
    background: var(--coral);
    border-color: var(--coral);
    color: white;
}

.action-btn.active .like-icon,
.action-btn.active .fav-icon {
    animation: heartBeat 0.6s var(--ease-spring);
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1); }
}

/* Comments Section */
.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Comment Form */
.comment-form {
    margin-bottom: 40px;
}

.comment-form-inner {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.comment-form-body {
    flex: 1;
}

.textarea-lg {
    width: 100%;
    min-height: 120px;
    padding: 16px 18px;
    border: 2px solid var(--gray-300);
    border-radius: 14px;
    font-size: 1rem;
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    resize: vertical;
    transition: border-color 0.2s;
}

[data-theme="dark"] .textarea-lg {
    background: var(--gray-900);
    border-color: var(--gray-700);
}

.textarea-lg:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.12);
}

.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

/* Comment List */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    padding: 20px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    transition: all 0.3s var(--ease-out);
    animation: fadeInUp 0.4s var(--ease-out) both;
}

[data-theme="dark"] .comment-item {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.comment-item:hover {
    border-color: var(--coral);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.08);
}

.comment-inner {
    display: flex;
    gap: 16px;
}

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

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-username {
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.comment-username:hover {
    color: var(--coral);
}

.comment-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 12px;
}

.comment-actions {
    display: flex;
    gap: 16px;
}

.reply-toggle-btn,
.comment-delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
}

.reply-toggle-btn:hover,
.comment-delete-btn:hover {
    color: var(--coral);
}

/* Reply Form */
.reply-form {
    margin-top: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
    display: none;
}

[data-theme="dark"] .reply-form {
    background: var(--gray-700);
}

.reply-to-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.textarea-reply {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    resize: vertical;
    margin-bottom: 12px;
}

.reply-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Replies */
.comment-replies {
    margin-top: 16px;
    padding-left: 20px;
    border-left: 2px solid var(--gray-200);
}

[data-theme="dark"] .comment-replies {
    border-color: var(--gray-700);
}

.reply-item {
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: 12px;
    margin-top: 12px;
}

[data-theme="dark"] .reply-item {
    background: var(--gray-700);
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.reply-username {
    font-weight: 600;
    color: var(--coral);
    text-decoration: none;
}

.reply-sep {
    color: var(--text-secondary);
}

.reply-to {
    color: var(--text-secondary);
    text-decoration: none;
}

.reply-meta {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.reply-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
}

/* Share Modal */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s var(--ease-out);
}

.share-modal.active {
    display: flex;
}

.share-modal-content {
    background: var(--bg);
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    animation: scaleIn 0.4s var(--ease-spring);
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.share-modal-content h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 24px;
    text-align: center;
}

.share-url-box {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.share-url-box input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--gray-50);
}

.share-platforms {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.share-platform-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    background: var(--bg);
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s var(--ease-out);
}

.share-platform-btn span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.share-platform-btn:hover {
    border-color: var(--coral);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.15);
}

/* Reading Settings Panel */
.reading-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 360px;
    height: 100vh;
    background: var(--bg);
    border-left: 2px solid var(--gray-200);
    padding: 32px 24px;
    z-index: 1000;
    transition: right 0.4s var(--ease-out);
    overflow-y: auto;
}

[data-theme="dark"] .reading-panel {
    border-color: var(--gray-700);
}

.reading-panel.active {
    right: 0;
}

.reading-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.reading-panel-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}

.reading-panel-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

[data-theme="dark"] .reading-panel-close {
    background: var(--gray-700);
}

.reading-panel-close:hover {
    background: var(--coral);
    color: white;
}

.reading-panel-section {
    margin-bottom: 28px;
}

.field-label-lg {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 12px;
}

/* Font Size Buttons */
.d-flex {
    display: flex;
}

.font-size-btn,
.lh-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--gray-200);
    background: var(--bg);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

[data-theme="dark"] .font-size-btn,
[data-theme="dark"] .lh-btn {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.font-size-btn:first-child,
.lh-btn:first-child {
    border-radius: 12px 0 0 12px;
}

.font-size-btn:last-child,
.lh-btn:last-child {
    border-radius: 0 12px 12px 0;
}

.font-size-btn.active,
.lh-btn.active {
    background: var(--coral);
    border-color: var(--coral);
    color: white;
}

/* Background Color Picker */
.bg-color-picker {
    display: flex;
    gap: 12px;
}

.bg-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 3px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.2s;
}

.bg-btn.active {
    border-color: var(--coral);
    transform: scale(1.1);
}

.bg-btn[data-color="default"] {
    background: #ffffff;
}

.bg-btn[data-color="sepia"] {
    background: #f5e6d3;
}

.bg-btn[data-color="dark"] {
    background: #1a1512;
}

.bg-btn[data-color="green"] {
    background: #c7edcc;
}

.bg-btn[data-color="pink"] {
    background: #ffe4e1;
}

/* Reading Toggle Button */
.reading-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--coral);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.4);
    transition: all 0.3s var(--ease-out);
    z-index: 999;
}

.reading-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.5);
}

/* Reading Save Button */
.reading-save-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    padding: 12px 24px;
    border-radius: 14px;
    background: var(--teal);
    color: white;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(46, 196, 182, 0.4);
    transition: all 0.3s var(--ease-out);
    z-index: 999;
}

.reading-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(46, 196, 182, 0.5);
}

/* Author's Other Stories */
.author-stories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.author-story-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.3s var(--ease-out);
}

[data-theme="dark"] .author-story-link {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.author-story-link:hover {
    border-color: var(--coral);
    transform: translateX(4px);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.1);
}

.author-story-title {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

.author-story-link .fs-13 {
    color: var(--text-secondary);
}

/* Empty State Small */
.empty-state-sm {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Card Padded */
.card-padded {
    padding: 24px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    text-align: center;
}

[data-theme="dark"] .card-padded {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

/* ========== END OF STORY DETAIL PAGE ========== */

/* ========== USER PROFILE PAGE (Optimized with impeccable principles) ========== */
.profile-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 120px 24px 80px;
    animation: fadeInUp 0.6s var(--ease-out);
}

/* Profile Header */
.profile-header {
    display: flex;
    gap: 48px;
    align-items: center;
    margin-bottom: 80px;
    padding: 48px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--ease-out);
}

[data-theme="dark"] .profile-header {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--coral), var(--teal), var(--sunny));
}

.profile-header:hover {
    border-color: var(--coral);
    box-shadow: 0 20px 60px rgba(255, 107, 74, 0.12);
    transform: translateY(-4px);
}

/* Profile Avatar */
.profile-avatar {
    flex-shrink: 0;
    position: relative;
}

.avatar-lg {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--gray-200);
    transition: all 0.4s var(--ease-spring);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .avatar-lg {
    border-color: var(--gray-700);
}

.avatar-placeholder-lg {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--coral), var(--teal));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 700;
    border: 4px solid var(--gray-200);
    transition: all 0.4s var(--ease-spring);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.2);
}

[data-theme="dark"] .avatar-placeholder-lg {
    border-color: var(--gray-700);
}

.profile-avatar:hover .avatar-lg,
.profile-avatar:hover .avatar-placeholder-lg {
    transform: scale(1.05) rotate(-3deg);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.3);
}

/* Profile Info */
.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-username {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text) 0%, var(--coral) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .profile-username {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--coral-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Profile Bio */
.profile-bio {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 600px;
}

/* Profile Stats */
.profile-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 32px;
    padding: 20px 0;
    border-top: 2px solid var(--gray-200);
    border-bottom: 2px solid var(--gray-200);
}

[data-theme="dark"] .profile-stats {
    border-color: var(--gray-700);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: default;
    transition: transform 0.2s var(--ease-out);
}

.stat-item:hover {
    transform: translateY(-4px);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--coral);
    line-height: 1;
}

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

/* Profile Actions */
.profile-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Profile Stories */
.profile-stories {
    animation: fadeInUp 0.6s 0.2s var(--ease-out) both;
}

.profile-stories h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Story List */
.stories-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.story-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 18px;
    transition: all 0.4s var(--ease-out);
    gap: 20px;
}

[data-theme="dark"] .story-list-item {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.story-list-item:hover {
    border-color: var(--coral);
    transform: translateX(8px);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.1);
}

.story-list-content {
    flex: 1;
    min-width: 0;
}

.story-list-title {
    margin-bottom: 8px;
}

.story-list-title a {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.story-list-title a:hover {
    color: var(--coral);
}

.story-list-summary {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.story-list-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.story-list-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* AI Badge Small */
.ai-badge-sm {
    padding: 4px 12px;
    background: rgba(46, 196, 182, 0.1);
    color: var(--teal);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    animation: fadeInUp 0.6s var(--ease-out);
}

.empty-state p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* ========== END OF USER PROFILE PAGE ========== */

/* ========== MY STORIES PAGE (Optimized with impeccable principles) ========== */
.my-stories-container {
    animation: fadeInUp 0.6s var(--ease-out);
}

.my-stories-container .page-header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--coral), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.my-stories-container .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 48px;
    animation: fadeInUp 0.6s 0.1s var(--ease-out) both;
}

.my-stories-container .stat-card {
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.my-stories-container .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--coral), var(--teal));
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}

.my-stories-container .stat-card:hover::before {
    opacity: 1;
}

.my-stories-container .stat-card:hover {
    border-color: var(--coral);
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(255, 107, 74, 0.15);
}

.my-stories-container .stat-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 107, 74, 0.1);
    border-radius: 18px;
    transition: transform 0.3s var(--ease-spring);
}

.my-stories-container .stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-5deg);
}

.my-stories-container .stat-number {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--coral);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.my-stories-container .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Status Tabs */
.status-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s 0.15s var(--ease-out) both;
}

[data-theme="dark"] .status-tabs {
    border-color: var(--gray-700);
}

.status-tabs a {
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s var(--ease-out);
    position: relative;
}

.status-tabs a:hover {
    color: var(--coral);
}

.status-tabs a.active {
    color: var(--coral);
    border-bottom-color: var(--coral);
}

/* Story Manage List */
.stories-manage-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeInUp 0.6s 0.2s var(--ease-out) both;
}

.story-manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 18px;
    gap: 24px;
    transition: all 0.4s var(--ease-out);
}

[data-theme="dark"] .story-manage-item {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.story-manage-item:hover {
    border-color: var(--coral);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.12);
    transform: translateX(8px);
}

.story-manage-content {
    flex: 1;
    min-width: 0;
}

.story-manage-title a {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.story-manage-title a:hover {
    color: var(--coral);
}

.story-manage-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.story-manage-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* ========== SETTINGS PAGE (Optimized with impeccable principles) ========== */
.settings-container {
    animation: fadeInUp 0.6s var(--ease-out);
}

.settings-container > h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--coral), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    margin-bottom: 48px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
}

.settings-card {
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 24px;
    padding: 36px;
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .settings-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.settings-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--coral), var(--teal));
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}

.settings-card:hover::before {
    opacity: 1;
}

.settings-card:hover {
    border-color: var(--coral);
    box-shadow: 0 20px 60px rgba(255, 107, 74, 0.12);
    transform: translateY(-4px);
}

.settings-card h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--coral);
    display: inline-block;
}

/* Avatar Preview */
.avatar-review {
    text-align: center;
    margin-bottom: 28px;
    padding: 32px;
    background: var(--gray-50);
    border-radius: 20px;
    transition: all 0.3s var(--ease-out);
}

[data-theme="dark"] .avatar-review {
    background: var(--gray-700);
}

.avatar-review:hover {
    background: rgba(255, 107, 74, 0.05);
}

.avatar-lg-img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--coral);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.3);
    transition: all 0.4s var(--ease-spring);
}

.avatar-review:hover .avatar-lg-img {
    transform: scale(1.05) rotate(-3deg);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.4);
}

.avatar-placeholder-lg {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--coral), var(--teal));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: 700;
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.3);
    transition: all 0.4s var(--ease-spring);
}

.avatar-review:hover .avatar-placeholder-lg {
    transform: scale(1.05) rotate(-3deg);
}

/* Danger Card */
.danger-card {
    border-color: rgba(239, 68, 68, 0.4) !important;
    background: rgba(239, 68, 68, 0.02) !important;
}

.danger-card h2 {
    border-bottom-color: var(--danger, #ef4444) !important;
    color: var(--danger, #ef4444) !important;
}

.danger-card::before {
    background: linear-gradient(90deg, var(--danger, #ef4444), #f59e0b) !important;
}

.danger-text {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.7;
    font-size: 0.95rem;
}

/* ========== MESSAGES & NOTIFICATIONS PAGES (Optimized) ========== */
.msgs-container,
.notifications-container {
    animation: fadeInUp 0.6s var(--ease-out);
}

.msgs-header,
.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 40px;
}

.msgs-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.03em;
}

.msgs-unread-badge {
    padding: 8px 18px;
    background: var(--coral);
    color: white;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(255, 107, 74, 0.3);
}

/* Messages List */
.msgs-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeInUp 0.6s 0.1s var(--ease-out) both;
}

.msgs-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 18px;
    text-decoration: none;
    transition: all 0.4s var(--ease-out);
}

[data-theme="dark"] .msgs-item {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.msgs-item:hover {
    border-color: var(--coral);
    transform: translateX(8px);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.1);
}

.msgs-item-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--coral), var(--teal));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease-spring);
}

.msgs-item:hover .msgs-item-avatar {
    transform: scale(1.1) rotate(-5deg);
}

.msgs-item-content {
    flex: 1;
    min-width: 0;
}

.msgs-item-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.msgs-item-name {
    font-weight: 700;
    color: var(--text);
    font-size: 1.05rem;
    transition: color 0.2s;
}

.msgs-item:hover .msgs-item-name {
    color: var(--coral);
}

.msgs-item-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msgs-unread-dot {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--coral);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Notifications List */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeInUp 0.6s 0.1s var(--ease-out) both;
}

.notification-item {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    transition: all 0.3s var(--ease-out);
    align-items: flex-start;
}

[data-theme="dark"] .notification-item {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.notification-item.unread {
    background: rgba(255, 107, 74, 0.04);
    border-left: 4px solid var(--coral);
}

.notification-item:hover {
    border-color: var(--coral);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.08);
    transform: translateX(4px);
}

.notification-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    padding-top: 2px;
}

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

.notification-text {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 8px;
}

.notif-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.notif-user:hover {
    color: var(--coral);
}

.notif-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ========== SEARCH & RECOMMEND PAGES (Optimized) ========== */
.search-page,
.page-recommend {
    animation: fadeInUp 0.6s var(--ease-out);
}

.search-title,
.page-title-recommend {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

/* Search Form */
.search-form-flex {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    animation: fadeInUp 0.6s 0.1s var(--ease-out) both;
}

.search-form-flex input[type="text"] {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--gray-300);
    border-radius: 14px;
    font-size: 1rem;
    transition: all 0.3s var(--ease-out);
}

.search-form-flex input[type="text"]:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.12);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding: 20px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    animation: fadeInUp 0.6s 0.15s var(--ease-out) both;
}

[data-theme="dark"] .filters-bar {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.filters-bar select {
    padding: 10px 16px;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    cursor: pointer;
    transition: border-color 0.2s;
}

.filters-bar select:focus {
    outline: none;
    border-color: var(--coral);
}

/* ========== AUTH PAGES (Optimized with impeccable principles) ========== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 80px;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 107, 74, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatBubble 25s ease-in-out infinite;
}

.auth-container::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(46, 196, 182, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatBubble 30s ease-in-out infinite reverse;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 28px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s var(--ease-out);
}

[data-theme="dark"] .auth-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--coral), var(--teal), var(--sunny));
    border-radius: 28px 28px 0 0;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    font-size: 3.5rem;
    margin-bottom: 16px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

.auth-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.auth-form label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    letter-spacing: 0.01em;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--gray-300);
    border-radius: 14px;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    transition: all 0.3s var(--ease-out);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.12);
}

[data-theme="dark"] .auth-form input {
    background: var(--gray-900);
    border-color: var(--gray-700);
}

.auth-form button[type="submit"] {
    width: 100%;
    padding: 18px 32px;
    border-radius: 14px;
    border: none;
    background: var(--coral);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.4s var(--ease-out);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.4);
    position: relative;
    overflow: hidden;
}

.auth-form button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s var(--ease-out);
}

.auth-form button[type="submit"]:hover::before {
    left: 100%;
}

.auth-form button[type="submit"]:hover {
    background: var(--coral-dark);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.5);
}

.auth-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--gray-200);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

[data-theme="dark"] .auth-footer {
    border-color: var(--gray-700);
}

.auth-footer a {
    color: var(--coral);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: var(--coral-dark);
    text-decoration: underline;
}

/* ========== GENERATE & EDIT STORY PAGES (Optimized) ========== */
.gen-container,
.edit-container {
    animation: fadeInUp 0.6s var(--ease-out);
}

.gen-title,
.edit-container h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--coral), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gen-subtitle,
.edit-container > p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 48px;
}

/* Generate Form */
.gen-form-section {
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 24px;
    padding: 36px;
    margin-bottom: 32px;
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .gen-form-section {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.gen-form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--coral), var(--teal));
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}

.gen-form-section:hover::before {
    opacity: 1;
}

.gen-form-section:hover {
    border-color: var(--coral);
    box-shadow: 0 20px 60px rgba(255, 107, 74, 0.1);
}

.gen-form-section h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.gen-form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.gen-form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ========== ADMIN PAGES (Optimized) ========== */
.admin-container {
    animation: fadeInUp 0.6s var(--ease-out);
}

.admin-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.03em;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    animation: fadeInUp 0.6s 0.1s var(--ease-out) both;
}

.admin-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--gray-50);
    border-bottom: 3px solid var(--gray-200);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

[data-theme="dark"] .admin-table th {
    background: var(--gray-700);
}

.admin-table td {
    padding: 16px 20px;
    font-size: 0.9rem;
    color: var(--text);
    border-bottom: 1px solid var(--gray-200);
}

[data-theme="dark"] .admin-table td {
    border-color: var(--gray-700);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: rgba(255, 107, 74, 0.03);
}

.admin-actions {
    display: flex;
    gap: 8px;
}

.admin-btn {
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s var(--ease-out);
}

.admin-btn-primary {
    background: var(--coral);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 74, 0.3);
}

.admin-btn-primary:hover {
    background: var(--coral-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 74, 0.4);
}

.admin-btn-secondary {
    background: var(--gray-100);
    color: var(--text);
    border: 1px solid var(--gray-200);
}

[data-theme="dark"] .admin-btn-secondary {
    background: var(--gray-700);
    border-color: var(--gray-600);
}

.admin-btn-secondary:hover {
    background: var(--gray-200);
}

[data-theme="dark"] .admin-btn-secondary:hover {
    background: var(--gray-600);
}

.admin-btn-danger {
    background: var(--danger, #ef4444);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.admin-btn-danger:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

/* ========== END OF ALL PAGES OPTIMIZATION ========== */
/* ========== DELETE ACCOUNT PAGE ========== */
.delete-account-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 120px 24px 80px;
    animation: fadeInUp 0.6s var(--ease-out);
}

.danger-card {
    background: var(--bg);
    border: 2px solid #ef4444;
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 20px 60px rgba(239, 68, 68, 0.15);
    animation: fadeInUp 0.6s 0.1s var(--ease-out) both;
}

[data-theme="dark"] .danger-card {
    background: var(--gray-800);
    box-shadow: 0 20px 60px rgba(239, 68, 68, 0.25);
}

.danger-card h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #ef4444;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

.warning-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.03));
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 40px;
}

[data-theme="dark"] .warning-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.08));
    border-color: rgba(239, 68, 68, 0.3);
}

.warning-box h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 16px;
}

.warning-box ul {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.warning-box li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
}

.warning-box li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #ef4444;
    font-weight: 700;
}

.danger-text {
    color: #ef4444;
    font-weight: 600;
    font-size: 1.05rem;
}

.delete-form {
    margin-top: 32px;
}

.delete-form .form-group {
    margin-bottom: 24px;
}

.delete-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.delete-form input[type="password"],
.delete-form input[type="text"] {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #ef4444;
    border-radius: 14px;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    transition: all 0.3s var(--ease-out);
}

.delete-form input:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.form-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--gray-200);
}

[data-theme="dark"] .form-actions {
    border-color: var(--gray-700);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(239, 68, 68, 0.5);
    color: white;
}

/* ========== FAVORITES PAGE ========== */
.page-favorites {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 24px 80px;
    animation: fadeInUp 0.6s var(--ease-out);
}

/* ========== READING HISTORY PAGE ========== */
.page-padded-lg {
    max-width: 900px;
    margin: 0 auto;
    padding: 120px 24px 80px;
    animation: fadeInUp 0.6s var(--ease-out);
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.rh-form-inline {
    display: inline-block;
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeInUp 0.6s 0.2s var(--ease-out) both;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    transition: all 0.4s var(--ease-out);
}

[data-theme="dark"] .history-item {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.history-item:hover {
    border-color: var(--coral);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.1);
    transform: translateY(-4px);
}

/* Progress Circle */
.history-progress-circle {
    flex-shrink: 0;
}

.progress-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(
        var(--coral) calc(var(--completion, 0) * 3.6deg),
        var(--gray-200) 0deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-ring::before {
    content: '';
    position: absolute;
    width: 48px;
    height: 48px;
    background: var(--bg);
    border-radius: 50%;
}

[data-theme="dark"] .progress-ring::before {
    background: var(--gray-800);
}

.progress-ring-inner {
    position: relative;
    z-index: 1;
    color: var(--coral);
}

/* History Content */
.history-content {
    flex: 1;
    min-width: 0;
}

.history-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.link-muted {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.link-muted:hover {
    color: var(--coral);
}

.history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 12px;
}

.history-action-row {
    margin-top: 16px;
}

.history-delete {
    flex-shrink: 0;
    align-self: center;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: var(--gray-100);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s var(--ease-out);
}

[data-theme="dark"] .icon-btn {
    background: var(--gray-700);
}

.icon-btn-danger {
    color: #ef4444;
}

.icon-btn-danger:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

/* ========== ALERTS ========== */
.alert {
    padding: 16px 20px;
    border-radius: 14px;
    margin-bottom: 24px;
    font-weight: 500;
    animation: fadeInUp 0.4s var(--ease-out);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

/* ========== BADGE ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--coral), var(--teal));
    color: white;
}

/* ========== TEXT UTILITIES ========== */
.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-secondary);
    opacity: 0.8;
}

.text-success {
    color: #10b981;
}

.text-primary {
    color: var(--coral);
}

.fs-13 {
    font-size: 0.8rem;
}

.fs-14 {
    font-size: 0.9rem;
}

.fs-17 {
    font-size: 1.1rem;
}

.fs-22 {
    font-size: 1.4rem;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-12 {
    margin-bottom: 12px;
}

.mb-24 {
    margin-bottom: 24px;
}

.lh-15 {
    line-height: 1.5;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 10px;
}
/* ========== STATS PAGE ========== */
.page-stats {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 24px 80px;
    animation: fadeInUp 0.6s var(--ease-out);
}

.chart-container {
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 24px;
    padding: 48px;
    margin-top: 60px;
    animation: fadeInUp 0.6s 0.3s var(--ease-out) both;
}

[data-theme="dark"] .chart-container {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.chart-container .section-title {
    margin-bottom: 32px;
    font-size: 1.5rem;
}

#monthlyChart {
    width: 100% !important;
    height: 400px !important;
}

/* ========== EDIT STORY PAGE ========== */
.edit-story-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 120px 24px 80px;
    animation: fadeInUp 0.6s var(--ease-out);
}

.edit-story-container h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 40px;
    letter-spacing: -0.02em;
}

.edit-story-form {
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 24px;
    padding: 48px;
    animation: fadeInUp 0.6s 0.1s var(--ease-out) both;
}

[data-theme="dark"] .edit-story-form {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* TinyMCE Overrides */
.tox-tinymce {
    border-radius: 14px !important;
    border: 2px solid var(--gray-300) !important;
    overflow: hidden;
}

.tox-tinymce:focus-within {
    border-color: var(--coral) !important;
    box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.12);
}

.tox-toolbar__primary {
    background: var(--gray-50) !important;
}

[data-theme="dark"] .tox-toolbar__primary {
    background: var(--gray-800) !important;
}

.tox-edit-area__iframe {
    background: var(--bg) !important;
}

[data-theme="dark"] .tox-edit-area__iframe {
    background: var(--gray-900) !important;
}

/* ========== PUSH SETTINGS PAGE ========== */
.push-settings-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 120px 24px 80px;
    animation: fadeInUp 0.6s var(--ease-out);
}

.push-settings-container h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 40px;
    letter-spacing: -0.02em;
}

.push-setting-card {
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    transition: all 0.3s var(--ease-out);
}

[data-theme="dark"] .push-setting-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.push-setting-card:hover {
    border-color: var(--coral);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.1);
}

.push-setting-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.push-setting-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    border-radius: 28px;
    transition: all 0.3s var(--ease-out);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s var(--ease-out);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--coral);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* ========== MESSAGE PAGE ========== */
.message-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 120px 24px 80px;
    animation: fadeInUp 0.6s var(--ease-out);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.message-back {
    width: 44px;
    height: 44px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s var(--ease-out);
}

.message-back:hover {
    border-color: var(--coral);
    background: var(--coral);
    color: white;
}

.message-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.message-thread {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.message-bubble {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: 20px;
    animation: fadeInUp 0.4s var(--ease-out);
}

.message-bubble.sent {
    align-self: flex-end;
    background: var(--coral);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.received {
    align-self: flex-start;
    background: var(--gray-100);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

[data-theme="dark"] .message-bubble.received {
    background: var(--gray-700);
}

.message-bubble .msg-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 8px;
    text-align: right;
}

.message-reply-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.message-reply-form textarea {
    flex: 1;
    resize: vertical;
    min-height: 60px;
}

/* ========== RESPONSIVE IMPROVEMENTS ========== */
@media (max-width: 768px) {
    .delete-account-container,
    .page-favorites,
    .page-padded-lg,
    .page-stats,
    .edit-story-container,
    .push-settings-container,
    .message-container {
        padding: 100px 16px 60px;
    }

    .danger-card,
    .edit-story-form {
        padding: 32px 24px;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-progress-circle {
        align-self: center;
    }

    .message-bubble {
        max-width: 85%;
    }

    .chart-container {
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        text-align: center;
    }
}
/* ========== ADMIN PAGES - ENHANCED ========== */
/* Enhanced by impeccable principles: bold, unique, memorable */

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px 24px 80px;
    animation: fadeInUp 0.6s var(--ease-out);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 60px;
    padding-bottom: 32px;
    border-bottom: 2px solid var(--gray-200);
}

[data-theme="dark"] .admin-header {
    border-color: var(--gray-700);
}

.admin-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.1;
    position: relative;
}

.admin-header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--coral), var(--teal));
    border-radius: 2px;
}

/* Admin Quick Actions */
.admin-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-quick-actions .btn {
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* ========== ADMIN STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.stat-card {
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s var(--ease-out) both;
}

[data-theme="dark"] .stat-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--coral), var(--teal));
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(255, 107, 74, 0.15);
    border-color: var(--coral);
}

.stat-icon-lg {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--coral), var(--teal));
    color: white;
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.3);
}

.stat-info {
    flex: 1;
}

.stat-number-lg {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 900;
    color: var(--text);
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.stat-label-lg {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========== ADMIN TABLES ========== */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    animation: fadeInUp 0.6s 0.2s var(--ease-out) both;
}

[data-theme="dark"] .admin-table {
    background: var(--gray-800);
    border-color: var(--gray-700);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.admin-table thead {
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
}

[data-theme="dark"] .admin-table thead {
    background: linear-gradient(135deg, var(--gray-800), var(--gray-700));
}

.admin-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
}

[data-theme="dark"] .admin-table th {
    border-color: var(--gray-700);
}

.admin-table td {
    padding: 16px 20px;
    font-size: 0.95rem;
    color: var(--text);
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.2s var(--ease-out);
}

[data-theme="dark"] .admin-table td {
    border-color: var(--gray-700);
}

.admin-table tbody tr {
    transition: all 0.2s var(--ease-out);
}

.admin-table tbody tr:hover {
    background: rgba(255, 107, 74, 0.04);
}

[data-theme="dark"] .admin-table tbody tr:hover {
    background: rgba(255, 107, 74, 0.08);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* ========== ADMIN BUTTONS ========== */
.admin-actions {
    display: flex;
    gap: 8px;
}

.admin-btn {
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s var(--ease-out);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.01em;
}

.admin-btn-primary {
    background: var(--coral);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 74, 0.3);
}

.admin-btn-primary:hover {
    background: var(--coral-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 74, 0.4);
    color: white;
}

.admin-btn-secondary {
    background: var(--gray-100);
    color: var(--text);
    border: 1px solid var(--gray-200);
}

[data-theme="dark"] .admin-btn-secondary {
    background: var(--gray-700);
    border-color: var(--gray-600);
    color: var(--gray-300);
}

.admin-btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--coral);
}

[data-theme="dark"] .admin-btn-secondary:hover {
    background: var(--gray-600);
}

.admin-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.admin-btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
    color: white;
}

/* ========== ADMIN BADGES ========== */
.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.bg-success {
    background: rgba(46, 196, 182, 0.12);
    color: var(--teal);
    border: 1px solid rgba(46, 196, 182, 0.2);
}

.bg-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #b8860b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.bg-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ========== ADMIN CARDS ========== */
.admin-card {
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    padding: 32px;
    animation: fadeInUp 0.6s var(--ease-out) both;
    transition: all 0.3s var(--ease-out);
}

[data-theme="dark"] .admin-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.admin-card:hover {
    border-color: var(--coral);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.1);
}

.admin-card-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
    letter-spacing: -0.01em;
}

[data-theme="dark"] .admin-card-title {
    border-color: var(--gray-700);
}

/* ========== ADMIN CHARTS ========== */
.admin-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.admin-chart-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding: 20px 0;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar-user,
.chart-bar-story {
    width: 100%;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s var(--ease-out);
    min-height: 4px;
}

.chart-bar-user {
    background: linear-gradient(180deg, var(--coral), var(--coral-dark));
    box-shadow: 0 4px 15px rgba(255, 107, 74, 0.3);
}

.chart-bar-story {
    background: linear-gradient(180deg, var(--teal), #0d9488);
    box-shadow: 0 4px 15px rgba(46, 196, 182, 0.3);
}

.chart-bar-user:hover,
.chart-bar-story:hover {
    opacity: 0.85;
    transform: scaleY(1.05);
    transform-origin: bottom;
}

/* ========== ADMIN GRID LAYOUTS ========== */
.admin-2col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.admin-3col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

/* ========== ADMIN SECONDARY STATS ========== */
.admin-stats-secondary {
    display: flex;
    gap: 24px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.stat-card-secondary {
    flex: 1;
    min-width: 200px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s var(--ease-out);
}

[data-theme="dark"] .stat-card-secondary {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.stat-card-secondary:hover {
    border-color: var(--coral);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.1);
}

.stat-number-success {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: var(--teal);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-number-warning {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: #f59e0b;
    line-height: 1;
    margin-bottom: 8px;
}

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

/* ========== SETTINGS ROW ========== */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
}

[data-theme="dark"] .settings-row {
    border-color: var(--gray-700);
}

.settings-row:last-child {
    border-bottom: none;
}

/* ========== CATEGORY BAR ========== */
.category-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.progress-bar-track {
    height: 8px;
    background: var(--gray-100);
    border-radius: 100px;
    overflow: hidden;
}

[data-theme="dark"] .progress-bar-track {
    background: var(--gray-700);
}

.category-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--coral), var(--teal));
    border-radius: 100px;
    transition: width 0.6s var(--ease-out);
    width: var(--cat-percent, 0%);
}

/* ========== META TEXT ========== */
.meta-sm {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.text-muted-sm {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.mt-2 {
    margin-top: 8px;
}

.d-inline {
    display: inline;
}

/* ========== LINKS ========== */
.link-primary {
    color: var(--coral);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.link-primary:hover {
    color: var(--coral-dark);
}

.link-muted {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.link-muted:hover {
    color: var(--coral);
}

/* ========== TABLE RESPONSIVE ========== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.td-muted {
    color: var(--text-secondary);
}

/* ========== ADMIN RESPONSIVE ========== */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-quick-actions {
        width: 100%;
    }

    .admin-quick-actions .btn {
        flex: 1;
        text-align: center;
        font-size: 0.85rem;
        padding: 10px 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-2col-grid,
    .admin-3col-grid {
        grid-template-columns: 1fr;
    }

    .admin-charts-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 24px;
    }

    .admin-table {
        font-size: 0.85rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 12px 14px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-header h1 {
        font-size: 2rem;
    }

    .stat-number-lg {
        font-size: 1.8rem;
    }
}
/* ========== MICRO-INTERACTIONS ENHANCEMENT ========== */
/* Following impeccable principles: bold, unique, memorable */

/* ======= - Scroll-Driven Animations ======= */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ======= - Staggered Children Animation ======= */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerFadeIn 0.5s var(--ease-out) forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.5s; }

@keyframes staggerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======= - Enhanced Button Micro-Interactions ======= */
.btn {
    position: relative;
    overflow: hidden;
}

/* Ripple effect on click */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple 0.6s var(--ease-out);
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ======= - Enhanced Card Hover Effects ======= */
.story-card {
    position: relative;
    transition: all 0.5s var(--ease-out);
}

.story-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    box-shadow: 0 0 0 0 rgba(255, 107, 74, 0);
    transition: box-shadow 0.5s var(--ease-out);
    pointer-events: none;
}

.story-card:hover::after {
    box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.1);
}

/* ======= - Enhanced Input Focus Effects ======= */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    transform: translateY(-2px);
    transition: all 0.3s var(--ease-out);
}

/* ======= - Enhanced Checkbox & Radio ======= */
input[type="checkbox"],
input[type="radio"] {
    position: relative;
    cursor: pointer;
}

input[type="checkbox"]:checked::after,
input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--coral);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: checkPop 0.3s var(--ease-out) forwards;
}

@keyframes checkPop {
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ======= - Enhanced Alert Animations ======= */
.alert {
    animation: slideInDown 0.4s var(--ease-out);
}

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

/* ======= - Enhanced Badge Pulse ======= */
.badge {
    position: relative;
}

.badge::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--coral);
    border-radius: 50%;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.7; }
}

/* ======= - Enhanced Loading States ======= */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ======= - Enhanced Avatar Hover ======= */
.avatar,
.avatar-sm,
.avatar-lg {
    transition: all 0.3s var(--ease-out);
}

.avatar:hover,
.avatar-sm:hover,
.avatar-lg:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.3);
}

/* ======= - Enhanced Nav Link Hover ======= */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--coral);
    transition: all 0.3s var(--ease-out);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* ======= - Enhanced Footer Link Hover ======= */
.footer a {
    position: relative;
    display: inline-block;
    transition: all 0.3s var(--ease-out);
}

.footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--coral);
    transition: width 0.3s var(--ease-out);
}

.footer a:hover::after {
    width: 100%;
}

/* ======= - Enhanced Scrollbar ======= */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--gray-800);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--coral), var(--teal));
    border-radius: 10px;
    border: 2px solid var(--gray-100);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    border-color: var(--gray-800);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--coral-dark), #0d9488);
}

/* ======= - Enhanced Selection ======= */
::selection {
    background: rgba(255, 107, 74, 0.2);
    color: var(--text);
}

/* ======= - Enhanced Focus Visible ======= */
:focus-visible {
    outline: 3px solid rgba(255, 107, 74, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ======= - Enhanced Toast Notifications ======= */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: toastSlideIn 0.4s var(--ease-out);
    font-weight: 500;
}

[data-theme="dark"] .toast {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.toast-success {
    border-color: var(--teal);
    color: var(--teal);
}

.toast-error {
    border-color: #ef4444;
    color: #ef4444;
}

.toast-info {
    border-color: var(--coral);
    color: var(--coral);
}

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

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

/* ======= - Enhanced Skeleton Loading ======= */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-700) 25%,
        var(--gray-600) 50%,
        var(--gray-700) 75%
    );
    background-size: 200% 100%;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ======= - Enhanced Print Styles ======= */
@media print {
    .navbar,
    .footer,
    .theme-toggle,
    .btn,
    .admin-quick-actions {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* ======= - Enhanced High Contrast Mode ======= */
@media (prefers-contrast: high) {
    :root {
        --gray-200: #000000;
        --gray-700: #ffffff;
    }
    
    .btn-primary {
        background: #000000;
        color: #ffffff;
        border: 2px solid #000000;
    }
}

/* ======= - Enhanced Reduced Motion ======= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ======= - Final Polish - Unique Decorative Elements ======= */

/* Coral accent dot on page titles */
.page-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--coral);
    border-radius: 50%;
    margin-right: 12px;
    vertical-align: middle;
    animation: float 3s ease-in-out infinite;
}

/* Teal accent line on section titles */
.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--teal), var(--coral));
    border-radius: 2px;
    margin-top: 12px;
}

.text-center .section-title::after,
.section-header.text-center .section-title::after {
    margin-left: auto;
    margin-right: auto;
}

/* Unique hover effect for links */
a:not(.btn):not(.nav-link):not(.avatar):hover {
    transition: color 0.2s var(--ease-out);
}

/* Subtle pattern overlay for hero sections */
.hero::before {
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 107, 74, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(46, 196, 182, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(255, 209, 102, 0.04) 0%, transparent 50%);
}

/* Enhanced focus styles for form elements */
input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.12), 0 4px 20px rgba(255, 107, 74, 0.1);
}

/* Unique active state for buttons */
.btn:active {
    transform: translateY(0) scale(0.98);
    transition: transform 0.1s;
}

/* Enhanced card selected state */
.story-card.selected {
    border-color: var(--coral);
    box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.1);
}

/* Unique tooltip styles */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    padding: 8px 12px;
    background: var(--gray-900);
    color: white;
    font-size: 0.85rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s var(--ease-out);
    z-index: 1000;
}

[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-theme="dark"] [data-tooltip]::before {
    background: var(--gray-100);
    color: var(--text);
}

/* ======= - Performance Optimizations ======= */
.story-card,
.admin-card,
.stat-card {
    will-change: transform, box-shadow;
}

.animate-on-scroll {
    will-change: opacity, transform;
}

/* GPU acceleration for animations */
.btn::before,
.story-card::before,
.stat-card::before {
    will-change: left, opacity;
}

/* ======= - Accessibility Improvements ======= */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--coral);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* ======= - Final Touch - Brand Consistency ======= */

/* Ensure consistent spacing for all major sections */
.section,
.page-recommend,
.page-favorites,
.page-padded-lg,
.page-stats,
.admin-container,
.edit-story-container,
.push-settings-container,
.message-container {
    scroll-margin-top: 80px;
}

/* Consistent border radius for all cards */
.story-card,
.admin-card,
.stat-card,
.stat-card-secondary,
.danger-card,
.edit-story-form,
.warning-box,
.alert {
    border-radius: 20px;
}

/* Consistent box shadow for elevated elements */
.story-card:hover,
.admin-card:hover,
.stat-card:hover,
.btn-primary:hover,
.btn-danger:hover {
    box-shadow: 0 20px 60px rgba(255, 107, 74, 0.15);
}

[data-theme="dark"] .story-card:hover,
[data-theme="dark"] .admin-card:hover,
[data-theme="dark"] .stat-card:hover {
    box-shadow: 0 20px 60px rgba(255, 107, 74, 0.25);
}
/* ========== ENHANCED FOOTER ========== */
.footer {
    background: linear-gradient(135deg, var(--gray-900) 0%, #1a1a2e 100%);
    color: var(--gray-300);
    padding: 80px 24px 40px;
    margin-top: 120px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--coral), var(--teal), var(--sunny));
}

.footer::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 107, 74, 0.03) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    position: relative;
    z-index: 1;
}

.footer-section {
    animation: fadeInUp 0.6s var(--ease-out) both;
}

.footer-section:nth-child(1) { animation-delay: 0s; }
.footer-section:nth-child(2) { animation-delay: 0.1s; }
.footer-section:nth-child(3) { animation-delay: 0.2s; }
.footer-section:nth-child(4) { animation-delay: 0.3s; }

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.footer-desc {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--gray-400);
    max-width: 300px;
}

.footer-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    letter-spacing: 0.01em;
    position: relative;
    padding-bottom: 12px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background: var(--coral);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s var(--ease-out);
    display: inline-block;
    position: relative;
    padding-left: 0;
}

.footer-links a::before {
    content: '→';
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: all 0.3s var(--ease-out);
    color: var(--coral);
}

.footer-links a:hover {
    color: var(--coral);
    padding-left: 20px;
}

.footer-links a:hover::before {
    opacity: 1;
    left: 0;
}

.footer-bottom {
    max-width: 1200px;
    margin: 60px auto 0;
    padding-top: 30px;
    border-top: 1px solid var(--gray-700);
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-500);
    position: relative;
    z-index: 1;
}

.footer-bottom p {
    margin: 0;
}

/* ========== BACK TO TOP BUTTON (ENHANCED) ========== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--coral);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s var(--ease-out);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.3);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--coral-dark);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.4);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* ========== RESPONSIVE FOOTER ========== */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 60px 20px 30px;
        margin-top: 80px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-brand {
        font-size: 1.5rem;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 40px 16px 20px;
    }
    
    .footer-content {
        gap: 30px;
    }
    
    .footer-title {
        font-size: 1rem;
    }
    
    .footer-links a {
        font-size: 0.85rem;
    }
}
/* ========== ADDITIONAL VISUAL ENHANCEMENTS ========== */
/* These enhancements follow impeccable principles: bold, distinctive, memorable */

/* ========== STORY CARD ENHANCEMENTS ========== */
.story-card-cover-default {
    background: linear-gradient(135deg, #FF6B4A 0%, #FF8A65 50%, #FFAB91 100%);
}

.story-card-cover-scifi {
    background: linear-gradient(135deg, #2EC4B6 0%, #4DD0E1 50%, #80DEEA 100%);
}

.story-card-cover-fantasy {
    background: linear-gradient(135deg, #7C4DFF 0%, #B388FF 50%, #EA80FC 100%);
}

.story-card-cover-mytery {
    background: linear-gradient(135deg, #424242 0%, #757575 50%, #BDBDBD 100%);
}

.story-card-cover-romance {
    background: linear-gradient(135deg, #FF4081 0%, #F48FB1 50%, #FFCDD2 100%);
}

.story-card-cover-horror {
    background: linear-gradient(135deg, #1a1a1a 0%, #424242 50%, #757575 100%);
}

.story-card-cover-inner {
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.1); }
}

/* ========== PAGE LOADING ANIMATION ========== */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeOut 0.5s 0.5s ease-out forwards;
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--coral);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== ENHANCED FORM INTERACTIONS ========== */
.form-group {
    position: relative;
}

.form-group input:focus + label,
.form-group textarea:focus + label {
    color: var(--coral);
    transform: translateY(-2px);
}

/* Floating label effect */
.form-group.floating-label {
    position: relative;
}

.form-group.floating-label input,
.form-group.floating-label textarea {
    padding-top: 24px;
    padding-bottom: 8px;
}

.form-group.floating-label label {
    position: absolute;
    top: 16px;
    left: 18px;
    font-size: 1rem;
    color: var(--gray-400);
    transition: all 0.3s var(--ease-out);
    pointer-events: none;
    margin: 0;
}

.form-group.floating-label input:focus ~ label,
.form-group.floating-label input:not(:placeholder-shown) ~ label,
.form-group.floating-label textarea:focus ~ label,
.form-group.floating-label textarea:not(:placeholder-shown) ~ label {
    top: 4px;
    font-size: 0.75rem;
    color: var(--coral);
    font-weight: 600;
}

/* ========== ENHANCED BUTTON VARIANTS ========== */
.btn-ghost {
    background: transparent;
    color: var(--coral);
    border: 2px solid var(--coral);
    padding: 14px 28px;
    border-radius: 14px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn-ghost:hover {
    background: var(--coral);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.3);
}

.btn-ghost::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s var(--ease-out);
}

.btn-ghost:hover::before {
    left: 100%;
}

/* ========== ENHANCED CARD HOVER EFFECTS ========== */
.story-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 74, 0.05) 0%, rgba(46, 196, 182, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
    pointer-events: none;
    border-radius: 24px;
}

.story-card:hover::after {
    opacity: 1;
}

/* ========== ENHANCED SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 5px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--gray-800);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--coral) 0%, var(--teal) 100%);
    border-radius: 5px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--coral-dark) 0%, var(--teal-dark) 100%);
}

/* ========== ENHANCED SELECTION ========== */
::selection {
    background: rgba(255, 107, 74, 0.2);
    color: var(--text);
}

/* ========== ENHANCED FOCUS VISIBLE ========== */
:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========== ENHANCED TOAST NOTIFICATIONS ========== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-900);
    color: white;
    padding: 16px 24px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s var(--ease-out);
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast-info {
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
}

/* ========== ENHANCED SKELETON LOADING ========== */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, var(--gray-700) 25%, var(--gray-800) 50%, var(--gray-700) 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 400px;
    border-radius: 24px;
}

.skeleton-text {
    height: 20px;
    margin-bottom: 12px;
}

.skeleton-text-short {
    width: 60%;
}

.skeleton-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

/* ========== ENHANCED STATS DISPLAY ========== */
.stat-item {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg);
    border-radius: 20px;
    border: 2px solid var(--gray-200);
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .stat-item {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--coral), var(--teal));
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    border-color: var(--coral);
}

.stat-number {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    color: var(--coral);
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== ENHANCED TAG/BADGE SYSTEM ========== */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s var(--ease-out);
    cursor: pointer;
}

.tag-coral {
    background: rgba(255, 107, 74, 0.1);
    color: var(--coral);
    border: 1px solid rgba(255, 107, 74, 0.2);
}

.tag-coral:hover {
    background: var(--coral);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 74, 0.3);
}

.tag-teal {
    background: rgba(46, 196, 182, 0.1);
    color: var(--teal);
    border: 1px solid rgba(46, 196, 182, 0.2);
}

.tag-teal:hover {
    background: var(--teal);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 196, 182, 0.3);
}

.tag-sunny {
    background: rgba(255, 209, 102, 0.1);
    color: #F59E0B;
    border: 1px solid rgba(255, 209, 102, 0.2);
}

.tag-sunny:hover {
    background: #F59E0B;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

/* ========== ENHANCED TOOLTIP ========== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--gray-900);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease-out);
    pointer-events: none;
    z-index: 1000;
}

.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border: 6px solid transparent;
    border-top-color: var(--gray-900);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease-out);
    pointer-events: none;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ========== ENHANCED PROGRESS BAR ========== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

[data-theme="dark"] .progress-bar {
    background: var(--gray-700);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--coral), var(--teal));
    border-radius: 4px;
    transition: width 0.6s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

/* ========== ENHANCED DROPDOWN ========== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s var(--ease-out);
    z-index: 1000;
}

[data-theme="dark"] .dropdown-menu {
    background: var(--gray-800);
    border-color: var(--gray-700);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    text-decoration: none;
}

.dropdown-item:hover {
    background: rgba(255, 107, 74, 0.1);
    color: var(--coral);
}

/* ========== PRINT STYLES (ENHANCED) ========== */
@media print {
    .navbar,
    .footer,
    .back-to-top,
    .btn,
    script,
    style {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .story-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ========== HIGH CONTRAST MODE (ENHANCED) ========== */
@media (prefers-contrast: high) {
    :root {
        --gray-200: #000000;
        --gray-300: #000000;
        --gray-400: #000000;
        --gray-500: #000000;
        --gray-600: #000000;
        --gray-700: #000000;
        --text-secondary: #000000;
    }
    
    .story-card,
    .btn,
    input,
    textarea,
    select {
        border-width: 3px !important;
    }
}

/* ========== REDUCED MOTION (ENHANCED) ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== DARK MODE ENHANCEMENTS ========== */
[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] img {
    opacity: 0.9;
    transition: opacity 0.3s;
}

[data-theme="dark"] img:hover {
    opacity: 1;
}

/* ========== ACCESSIBILITY ENHANCEMENTS ========== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-nav {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--coral);
    color: white;
    padding: 12px 24px;
    border-radius: 0 0 14px 14px;
    font-weight: 700;
    text-decoration: none;
    z-index: 10000;
    transition: top 0.3s var(--ease-out);
}

.skip-nav:focus {
    top: 0;
}

/* ========== PERFORMANCE OPTIMIZATIONS ========== */
.story-card,
.stat-item,
.btn,
.form-group input,
.tag {
    will-change: transform, box-shadow;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ========== GRAIN TEXTURE OVERLAY (SUBTLE) ========== */
.body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

[data-theme="dark"] body::before {
    opacity: 0.05;
}
/* ========== FINAL ENHANCEMENTS ========== */
/* These final enhancements follow impeccable principles: bold, distinctive, memorable */

/* ========== HERO SECTION ENHANCEMENTS ========== */
.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background:
        radial-gradient(circle, rgba(255, 107, 74, 0.08) 0%, transparent 70%),
        radial-gradient(circle at 30% 70%, rgba(46, 196, 182, 0.05) 0%, transparent 50%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatBubble 20s ease-in-out infinite;
}

@keyframes floatBubble {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(46, 196, 182, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatBubble 25s ease-in-out infinite reverse;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 107, 74, 0.1);
    border: 1px solid rgba(255, 107, 74, 0.2);
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--coral);
    margin-bottom: 24px;
    animation: fadeInUp 0.6s 0.1s var(--ease-out) both;
    transition: all 0.3s var(--ease-out);
}

.hero-badge:hover {
    background: rgba(255, 107, 74, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 74, 0.2);
}

/* ========== STORY CARD ENHANCEMENTS ========== */
.story-card {
    background: var(--bg);
    border-radius: 24px;
    overflow: hidden;
    border: 2px solid var(--gray-200);
    transition: all 0.5s var(--ease-out);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

[data-theme="dark"] .story-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.story-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--coral), var(--teal));
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}

.story-card:hover::before {
    opacity: 1;
}

.story-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 74, 0.05) 0%, rgba(46, 196, 182, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
    pointer-events: none;
    border-radius: 24px;
}

.story-card:hover::after {
    opacity: 1;
}

.story-card:hover {
    transform: translateY(-12px);
    border-color: var(--coral);
    box-shadow: 0 30px 80px rgba(255, 107, 74, 0.2);
}

/* Staggered animation for story cards */
.story-card.animate-on-scroll:nth-child(1) { animation-delay: 0s; }
.story-card.animate-on-scroll:nth-child(2) { animation-delay: 0.1s; }
.story-card.animate-on-scroll:nth-child(3) { animation-delay: 0.2s; }
.story-card.animate-on-scroll:nth-child(4) { animation-delay: 0.3s; }
.story-card.animate-on-scroll:nth-child(5) { animation-delay: 0.4s; }
.story-card.animate-on-scroll:nth-child(6) { animation-delay: 0.5s; }

/* ========== BUTTON ENHANCEMENTS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 14px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.4s var(--ease-out);
    line-height: 1.2;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s var(--ease-out);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--coral);
    color: white;
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.4);
}

.btn-primary:hover {
    background: var(--coral-dark);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.5);
    color: white;
}

/* ========== FORM ENHANCEMENTS ========== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--gray-300);
    border-radius: 14px;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    transition: all 0.3s var(--ease-out);
    line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.12);
    background: var(--bg);
}

/* ========== NAVBAR ENHANCEMENTS ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    transition: all 0.4s var(--ease-out);
}

[data-theme="dark"] .navbar {
    background: rgba(15, 15, 26, 0.9);
    border-bottom-color: var(--gray-700);
}

.navbar.scrolled {
    box-shadow: 0 4px 30px rgba(0,0,0,0.08);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s var(--ease-out);
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-logo-icon {
    font-size: 1.8rem;
    transition: transform 0.3s var(--ease-out);
}

.nav-logo:hover .nav-logo-icon {
    transform: rotate(15deg) scale(1.1);
}

.nav-link {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s var(--ease-out);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--coral);
    border-radius: 1px;
    transition: all 0.3s var(--ease-out);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link:hover {
    color: var(--coral);
    background: rgba(255, 107, 74, 0.05);
}

.nav-link.active {
    color: var(--coral);
    background: rgba(255, 107, 74, 0.08);
}

/* ========== FOOTER ENHANCEMENTS ========== */
.footer {
    background: linear-gradient(135deg, var(--gray-900) 0%, #1a1a2e 100%);
    color: var(--gray-300);
    padding: 80px 24px 40px;
    margin-top: 120px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--coral), var(--teal), var(--sunny));
}

.footer::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 107, 74, 0.03) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s var(--ease-out);
    display: inline-block;
    position: relative;
    padding-left: 0;
}

.footer-links a::before {
    content: '→';
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: all 0.3s var(--ease-out);
    color: var(--coral);
}

.footer-links a:hover {
    color: var(--coral);
    padding-left: 20px;
}

.footer-links a:hover::before {
    opacity: 1;
    left: 0;
}

/* ========== BACK TO TOP ENHANCEMENTS ========== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--coral);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s var(--ease-out);
    box-shadow: 0 8px 30px rgba(255, 107, 74, 0.3);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--coral-dark);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(255, 107, 74, 0.4);
}

/* ========== SCROLL ANIMATIONS ========== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s var(--ease-out);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== RESPONSIVE ENHANCEMENTS ========== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }
    
    .section {
        padding: 80px 20px;
    }
    
    .story-card {
        border-radius: 20px;
    }
    
    .btn {
        padding: 14px 24px;
        font-size: 0.95rem;
    }
    
    .footer {
        padding: 60px 20px 30px;
        margin-top: 80px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    
    .section {
        padding: 60px 16px;
    }
    
    .story-card {
        border-radius: 16px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 40px 16px 20px;
        margin-top: 60px;
    }
}

/* ========== DARK MODE ENHANCEMENTS ========== */
[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] img {
    opacity: 0.9;
    transition: opacity 0.3s;
}

[data-theme="dark"] img:hover {
    opacity: 1;
}

/* ========== ACCESSIBILITY ENHANCEMENTS ========== */
:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 2px;
    border-radius: 4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========== PERFORMANCE OPTIMIZATIONS ========== */
.story-card,
.btn,
.nav-link,
.footer-links a {
    will-change: transform, box-shadow;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ========== DARK THEME FROM IMPROVEMENTS.CSS ========== */
/* Integrated from improvements.css to avoid conflicts */

[data-theme="dark"] .form-input:focus,

[data-theme="dark"] .form-textarea:focus,

[data-theme="dark"] .form-select:focus {
    box-shadow: 0 4px 12px rgba(255, 138, 107, 0.2);
}

[data-theme="dark"] .btn-ripple::after {
    background-image: radial-gradient(circle, rgba(255,255,255,0.2) 10%, transparent 10%);
}

[data-theme="dark"] .story-card:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

[data-theme="dark"] .ranking-item {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

[data-theme="dark"] .author-stat-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

[data-theme="dark"] .font-size-control {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

[data-theme="dark"] .theme-toggle {
    background: var(--gray-800);
    border-color: var(--gray-700);
    color: var(--text);
}

[data-theme="dark"] .challenge-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

[data-theme="dark"] .challenge-section {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

[data-theme="dark"] .entry-card {
    background: var(--gray-700);
}

[data-theme="dark"] .sidebar-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

[data-theme="dark"] .nav-points-display {
    background: linear-gradient(135deg, #B8860B, #DAA520);
    color: white;
}

[data-theme="dark"] .points-action-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

[data-theme="dark"] .points-transactions {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

[data-theme="dark"] .transaction-item:hover {
    background: var(--gray-700);
}

[data-theme="dark"] .gift-item {
    background: var(--gray-700);
    border-color: var(--gray-600);
}

