/* ==========================================
   CYOA Maker - Main Application Styles
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Crimson+Text:wght@400;600;700&display=swap');

/* CSS Custom Properties */
:root {
    --primary: #3d72ef;
    --primary-dark: #809fdc;
    --primary-light: #6fa8ff;
    --accent: #d4882c;
    --accent-light: #f0a04b;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #1a1a1a;
    --text-light: #666;
    --text-white: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
    --max-width: 1200px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ==========================================
   Navbar
   ========================================== */
.navbar {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 0.75rem 2rem;
    min-height: 95px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #3b3b3b;
    background: linear-gradient(145deg, #ffffff, #ffffff);
    padding: 6px;
}

/*    background: linear-gradient(145deg, #cac9c9, #fefefe); */

.nav-brand-text a {
    color: #fff;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.nav-brand-text {
    font-size: 2.0rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.nav-tagline {
    font-size: 0.75rem;
    color: rgba(255, 255, 255);
    letter-spacing: 0.04em;
}

.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav-links a { color: rgba(255,255,255,0.9); font-size: 0.95rem; font-weight: 500; text-decoration: none; }
.nav-links a:hover { color: #fff; }

.sub-nav,
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.sub-nav a,
.breadcrumb a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.sub-nav a:hover,
.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--text-light);
}

.breadcrumb a::after {
    content: '\203A';
    margin-left: 0.5rem;
    color: var(--text-light);
    font-weight: 400;
}

.nav-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.nav-right-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.95);
    font-size: 0.95rem;
    font-weight: 600;
}

.nav-user-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.nav-user-links a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-weight: 500;
}

.nav-user-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.nav-divider {
    color: rgba(255,255,255,0.35);
    user-select: none;
}

.nav-user-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    border: 2.5px solid rgba(255,255,255,0.5);
    flex-shrink: 0;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nav-user-avatar .avatar-fallback {
    font-size: 1.4rem;
    color: rgba(255,255,255,0.7);
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
    box-sizing: border-box;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); color: #fff; }

.btn-outline { background: transparent; border: 2px solid rgba(255,255,255,0.7); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,0.1); color: #fff; }

.btn-play { background: var(--primary); color: #fff; }
.btn-play:hover { background: var(--primary-light); color: #fff; }

.btn-edit { background: var(--accent); color: #fff; }
.btn-edit:hover { background: var(--accent-light); color: #fff; }

.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; color: #fff; }

.btn-secondary { background: #6c757d; color: #fff; }
.btn-secondary:hover { background: #5a6268; color: #fff; }

.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1.1rem; }

/* ==========================================
   Layout
   ========================================== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 2rem; }

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    text-align: center;
    padding: 2rem 0 1.5rem;
}

.hero h1 {
    font-family: 'Inter', sans-serif;
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin: 0 auto;
}

/* ==========================================
   Filter Bar
   ========================================== */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    background: var(--card-bg);
    border: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ==========================================
   Story Gallery → see cards.css
   Auth/Forms   → see forms.css
   Editor       → see editor.css
   Account      → see account.css
   ========================================== */

/* ==========================================
   Alerts
   ========================================== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

/* ==========================================
   Modal
   ========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius);
    width: 95%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h3 { margin: 0; font-size: 1.2rem; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* Spinner */
.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================
   Footer
   ========================================== */
footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 2rem;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
    .navbar { padding: 0.75rem 1rem; }
    .nav-brand a { font-size: 1.1rem; }
    .container { padding: 1rem; }
    .hero h1 { font-size: 1.8rem; }
}
