:root {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-surface-transparent: rgba(30, 41, 59, 0.7);
    --color-text: #f8fafc;
    --color-text-muted: #94a3b8;
    --color-primary: #06b6d4;
    --color-primary-hover: #0891b2;
    --color-secondary: #8b5cf6;
    --color-border: #334155;
    --color-accent: #ec4899;
    --gradient-primary: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    --gradient-glow: 0 0 20px rgba(6, 182, 212, 0.5);
    --font-serif: 'Merriweather', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --max-width: 1024px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;
    --radius: 16px;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%), 
        radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.15), transparent 25%);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    gap: 0;
}

/* Sidebar */
.sidebar {
    width: 25%;
    background: var(--color-surface-transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: var(--glass-border);
    overflow-y: auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Main Content */
.main-content {
    flex: 1;
    width: 75%;
    overflow-y: auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    position: relative;
    padding-bottom: var(--spacing-lg);
    border-bottom: var(--glass-border);
}

header h1 {
    font-family: var(--font-sans);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Story Section */
.story-section {
    background: var(--color-surface-transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.story-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
}

.story-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.story-title {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

.story-topic {
    color: var(--color-primary);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
}

.story-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
}

/* Story Content */
.story-content {
    /*font-family: var(--font-serif);*/
    font-family: var(--font-sans);
    font-size: 1.15rem;
    line-height: 1.8;
    color: #e2e8f0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-content: start;
}

.sentence {
    margin-bottom: 0;
    padding: var(--spacing-md);
    border-radius: 8px;
    transition: background-color 0.2s ease;
    border-left: 2px solid transparent;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
}

.sentence:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-left-color: var(--color-primary);
}

.sentence-content {
    margin-bottom: var(--spacing-sm);
}

.sentence-attribution {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.6rem;
    color: var(--color-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: right;
}

.sentence-image-container {
    margin-bottom: var(--spacing-md);
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.sentence-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sentence:hover .sentence-image {
    transform: scale(1.02);
}

.empty-story {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    padding: var(--spacing-xl);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
}

/* Story Actions */
.story-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.sentence-count {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-family: var(--font-sans);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

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

.btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(6, 182, 212, 0.05);
}

/* New Story Form */
.new-story-section {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: var(--spacing-md);
    margin-bottom: 0;
}

.new-story-section h3 {
    font-family: var(--font-sans);
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.story-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-group label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
    padding: 1rem;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Stories List */
.stories-list-section {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: var(--spacing-md);
    /*margin-top: auto;*/
}

.stories-list-section h3 {
    font-family: var(--font-sans);
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.stories-list {
    list-style: none;
}

.story-item {
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s ease;
}

.story-item:last-child {
    border-bottom: none;
}

.story-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.story-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    text-decoration: none;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
    border-radius: 8px;
}

.story-link:hover {
    color: var(--color-primary);
    background: rgba(6, 182, 212, 0.1);
}

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

.story-item-meta {
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    color: var(--color-text-muted);
}

.badge {
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.3);
}

/* No Story */
.no-story {
    text-align: center;
    padding: var(--spacing-xl);
    background: var(--color-surface);
    border: var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-lg);
    color: var(--color-text-muted);
}

/* Footer */
footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: auto;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--color-border);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast.visible {
    transform: translateY(0);
    opacity: 1;
}

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

.toast.success {
    border-left: 4px solid #22c55e;
}

.hidden {
    display: none;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: var(--glass-border);
        max-height: 50vh;
    }

    .main-content {
        width: 100%;
    }

    .story-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .sidebar,
    .main-content {
        padding: var(--spacing-md);
    }

    header h1 {
        font-size: 1.5rem;
    }

    .story-title {
        font-size: 1.3rem;
    }

    .story-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }
}