/* Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Warm, inviting color palette */
    --primary: #ff6b6b;
    --primary-hover: #ee5a5a;
    --primary-light: #ff8a8a;
    --secondary: #feca57;
    --accent-coral: #ff9f7f;
    --accent-peach: #ffb8a8;
    --accent-rose: #f8a5c2;

    /* Warm dark backgrounds */
    --background: #1a1518;
    --background-warm: #201a1d;
    --surface: #2d2528;
    --surface-hover: #3a3235;
    --surface-light: #453c40;

    /* Text colors */
    --text-primary: #fff5f3;
    --text-secondary: #c9b8b5;
    --text-muted: #8a7d7a;

    /* Borders */
    --border: #4a3f42;
    --border-light: #5a4f52;

    /* Status colors */
    --success: #5dd39e;
    --error: #ff6b6b;

    /* Type accents */
    --anime-accent: #ff8a8a;
    --realistic-accent: #feca57;

    /* Effects */
    --warm-glow: rgba(255, 107, 107, 0.15);
    --card-gradient: linear-gradient(145deg, #2d2528 0%, #231f21 100%);
    --hero-gradient: radial-gradient(ellipse at 30% 20%, rgba(255, 107, 107, 0.12) 0%, transparent 50%),
                     radial-gradient(ellipse at 70% 80%, rgba(254, 202, 87, 0.08) 0%, transparent 40%),
                     radial-gradient(ellipse at 50% 50%, rgba(255, 159, 127, 0.06) 0%, transparent 60%);
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 1rem;
    background: var(--background);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--surface);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-section {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.nav-item:hover, .nav-item.active {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.nav-icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.logout-btn {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent-coral));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.25);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.35);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
}

/* Auth Container */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--error);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.error-message svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-danger-outline {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.btn-danger-outline:hover {
    background: var(--error);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.25);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Conversation List */
.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.conversation-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    transition: all 0.3s;
    position: relative;
}

.conversation-card:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.conversation-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    flex: 1;
    cursor: pointer;
    transition: all 0.3s;
}

.conversation-main:hover {
    transform: translateX(4px);
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 1rem;
    margin-right: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    opacity: 0;
}

.conversation-card:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: var(--error);
    background: rgba(255, 107, 107, 0.1);
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent-coral));
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

.avatar-placeholder.small {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

.avatar-placeholder.large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.avatar-placeholder.xlarge {
    width: 100%;
    height: 200px;
    font-size: 3rem;
    border-radius: 0;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.last-message {
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-meta {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Character Grid */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.character-grid.large {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.character-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.character-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.character-card.detailed {
    text-align: left;
    padding: 0;
    overflow: hidden;
}

.character-avatar {
    width: 90px;
    height: 90px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border);
    transition: border-color 0.3s;
}

.character-card:hover .character-avatar {
    border-color: var(--primary);
}

.character-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.character-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nsfw-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--error);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.character-details {
    padding: 1.25rem;
}

.character-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.character-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.character-type {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.character-type.realistic {
    background: rgba(254, 202, 87, 0.2);
    color: var(--secondary);
}

.character-type.anime {
    background: rgba(255, 138, 138, 0.2);
    color: var(--anime-accent);
}

.personality {
    margin: 0.75rem 0;
    line-height: 1.5;
}

.greeting {
    font-style: italic;
    opacity: 0.8;
}

.character-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.character-actions button {
    flex: 1;
    padding: 0.5rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 100;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2rem;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    width: 100%;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.confirm-modal {
    max-width: 400px;
    text-align: center;
}

.confirm-modal p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-actions button {
    min-width: 100px;
}

.btn-danger {
    background: linear-gradient(135deg, var(--error), #cc5555);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.25);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.35);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Chat Page */
.chat-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 4rem);
    margin: -2rem;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.back-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary);
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-title {
    flex: 1;
}

.chat-title h2 {
    font-size: 1rem;
    font-weight: 600;
}

.status {
    font-size: 0.75rem;
    color: var(--success);
}

.image-btn {
    background: var(--surface-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.image-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(255, 107, 107, 0.1);
}

.image-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Messages */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--background-warm);
}

.message {
    display: flex;
    gap: 0.75rem;
    max-width: 75%;
}

.message.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    background: var(--surface);
    padding: 0.875rem 1.125rem;
    border-radius: 1.25rem;
    border: 1px solid var(--border);
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary), var(--accent-coral));
    border-color: transparent;
}

.message-content p {
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.message.user .message-time {
    color: rgba(255, 255, 255, 0.7);
}

.message-image {
    max-width: 300px;
    border-radius: 0.75rem;
    margin-top: 0.5rem;
}

.typing-cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.generating {
    color: var(--text-secondary);
    font-style: italic;
}

/* Input Container */
.input-container {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.input-container textarea {
    flex: 1;
    padding: 0.875rem 1.25rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    resize: none;
    font-family: inherit;
    transition: all 0.2s;
}

.input-container textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.send-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent-coral));
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.6rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.tab:hover, .tab.active {
    background: linear-gradient(135deg, var(--primary), var(--accent-coral));
    border-color: transparent;
    color: white;
}

/* Create Character Page */
.create-character-page {
    max-width: 700px;
    margin: 0 auto;
}

.character-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option input {
    display: none;
}

.radio-option.selected {
    border-color: var(--primary);
    background: rgba(255, 107, 107, 0.1);
}

.checkbox-group {
    margin-top: 0.5rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-option input {
    width: auto;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Error UI */
#blazor-error-ui {
    background: var(--error);
    color: white;
    padding: 0.75rem 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    display: none;
}

#blazor-error-ui .reload, #blazor-error-ui .dismiss {
    color: white;
    margin-left: 1rem;
}

/* ============================================
   LANDING PAGE STYLES - Warm & Inviting
   ============================================ */

.landing-page {
    min-height: 100vh;
    background: var(--background);
    overflow-x: hidden;
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding: 4rem;
    min-height: 100vh;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--hero-gradient);
    animation: drift 30s ease-in-out infinite;
    z-index: 0;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, -2%) rotate(1deg); }
    50% { transform: translate(-1%, 1%) rotate(-1deg); }
    75% { transform: translate(1%, 2%) rotate(0.5deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(254, 202, 87, 0.1));
    border: 1px solid rgba(255, 107, 107, 0.25);
    border-radius: 2rem;
    color: var(--primary-light);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out;
    backdrop-filter: blur(10px);
}

.hero-badge::before {
    content: '✨';
}

.hero-title {
    font-size: 3.75rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out 0.1s both;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent-coral) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 2.5rem;
    max-width: 520px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.stat-item {
    text-align: center;
    position: relative;
}

.stat-item::after {
    content: '';
    position: absolute;
    right: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, transparent, var(--border), transparent);
}

.stat-item:last-child::after {
    display: none;
}

.stat-number {
    display: block;
    font-size: 2.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth Section */
.auth-section {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.auth-section .auth-card {
    background: linear-gradient(145deg, rgba(45, 37, 40, 0.95), rgba(35, 31, 33, 0.98));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(74, 63, 66, 0.6);
    border-radius: 1.75rem;
    padding: 2.75rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5),
                0 0 50px -15px rgba(255, 107, 107, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--accent-coral));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.auth-icon svg {
    width: 30px;
    height: 30px;
    color: white;
}

.auth-title {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.input-wrapper input {
    width: 100%;
    padding: 0.95rem 1rem 0.95rem 3rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.875rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.12);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-large svg {
    width: 20px;
    height: 20px;
}

.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.75rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-footer .btn-secondary {
    width: 100%;
}

/* Character Preview Section */
.characters-preview {
    padding: 6rem 4rem;
    background: linear-gradient(180deg, var(--background) 0%, var(--background-warm) 50%, var(--background) 100%);
    text-align: center;
    position: relative;
}

.characters-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 107, 0.3), transparent);
}

.section-title {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.15rem;
    margin-bottom: 3.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.character-showcase {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
    max-width: 1280px;
    margin: 0 auto;
}

.preview-card {
    background: var(--card-gradient);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 0;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
}

.preview-card.anime::before {
    background: linear-gradient(90deg, var(--primary), var(--accent-rose));
}

.preview-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 107, 107, 0.4);
    box-shadow: 0 25px 50px -15px rgba(255, 107, 107, 0.2),
                0 0 30px -10px rgba(255, 107, 107, 0.1);
}

.preview-card.anime:hover {
    border-color: rgba(248, 165, 194, 0.5);
    box-shadow: 0 25px 50px -15px rgba(248, 165, 194, 0.2),
                0 0 30px -10px rgba(248, 165, 194, 0.1);
}

.preview-avatar {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    background: var(--surface-light);
}

.preview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.preview-card:hover .preview-avatar img {
    transform: scale(1.08);
}

.avatar-letter {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    z-index: 1;
}

.preview-card.anime .avatar-letter {
    background: linear-gradient(135deg, var(--primary), var(--accent-rose));
}

.preview-info {
    padding: 1.5rem;
}

.preview-info h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.preview-type {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
    background: rgba(254, 202, 87, 0.15);
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-card.anime .preview-type {
    background: rgba(255, 138, 138, 0.15);
    color: var(--anime-accent);
}

.preview-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.preview-quote {
    margin: 0;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.25);
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(74, 63, 66, 0.5);
}

/* Features Section */
.features-section {
    padding: 6rem 4rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

.feature-card {
    background: var(--card-gradient);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 2.25rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 107, 107, 0.35);
    box-shadow: 0 15px 35px -10px rgba(255, 107, 107, 0.15);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(254, 202, 87, 0.1));
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.feature-card:hover .feature-icon {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.25), rgba(254, 202, 87, 0.2));
    transform: scale(1.05);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary-light);
}

.feature-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
}

/* Landing Footer */
.landing-footer {
    padding: 2.5rem;
    text-align: center;
    border-top: 1px solid rgba(74, 63, 66, 0.4);
    color: var(--text-muted);
    font-size: 0.9rem;
    background: linear-gradient(180deg, transparent, rgba(45, 37, 40, 0.3));
}

.landing-footer p {
    opacity: 0.85;
}

/* LLM Status Indicator */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.llm-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.llm-status.online {
    background: rgba(93, 211, 158, 0.15);
    color: var(--success);
    border: 1px solid rgba(93, 211, 158, 0.3);
}

.llm-status.offline {
    background: rgba(255, 107, 107, 0.15);
    color: var(--error);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

.status-dot.warning {
    background: var(--secondary);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Character offline state */
.character-card.offline {
    opacity: 0.7;
}

.character-card.offline .character-image img.grayscale {
    filter: grayscale(70%);
}

.status-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
}

.status-badge.offline {
    background: rgba(255, 107, 107, 0.9);
    color: white;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.4);
}

.character-image {
    position: relative;
}

/* Responsive */
@media (max-width: 1200px) {
    .character-showcase {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-section {
        grid-template-columns: 1fr;
        padding: 2rem;
        gap: 3rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-stats {
        justify-content: center;
    }

    .character-showcase {
        grid-template-columns: 1fr;
    }

    .features-section {
        grid-template-columns: 1fr;
        padding: 3rem 2rem;
    }

    .characters-preview {
        padding: 3rem 2rem;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 50;
        height: 100vh;
        transition: left 0.3s;
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        padding: 1rem;
    }

    .character-grid, .character-grid.large {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .message {
        max-width: 90%;
    }
}
