/* ============================================
   PCW Social - Dark Theme Gradient Stylesheet
   ============================================ */

:root {
    --bg-primary: #0f0f1e;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1a2744;
    --bg-input: #0d1117;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-header: linear-gradient(135deg, #4c1d95 0%, #1e3a8a 100%);
    --gradient-button: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    --gradient-button-hover: linear-gradient(135deg, #6d28d9 0%, #1d4ed8 100%);
    --gradient-accent: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-white: #ffffff;
    --accent-purple: #a855f7;
    --accent-blue: #3b82f6;
    --accent-red: #ef4444;
    --accent-green: #22c55e;
    --border-color: rgba(148, 163, 184, 0.15);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --header-height: 56px;
    --bottom-nav-height: 64px;
    --font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

body {
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    background: var(--bg-primary);
}

img {
    max-width: 100%;
    display: block;
}

/* ============================================
   Loading Screen
   ============================================ */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s var(--ease-out);
}

.loading-screen.hide {
    opacity: 0;
    pointer-events: none;
}

.loading-logo {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--bg-card);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Auth Pages (Login / Register)
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(37, 99, 235, 0.15) 0%, transparent 50%);
    animation: float 8s ease-in-out infinite;
}

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

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

.auth-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 0.6rem 1rem;
    text-align: center;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    border: none;
    background: transparent;
}

.auth-tab.active {
    background: var(--gradient-button);
    color: var(--text-white);
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.4);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form.hidden {
    display: none;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-field {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-family);
    transition: all 0.2s var(--ease-out);
    outline: none;
}

.input-field:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.input-field::placeholder {
    color: var(--text-muted);
}

textarea.input-field {
    resize: vertical;
    min-height: 100px;
}

.btn-primary {
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: var(--gradient-button);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    background: var(--gradient-button-hover);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-purple);
}

.btn-secondary:active {
    transform: scale(0.97);
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    display: none;
}

.auth-error.show {
    display: block;
    animation: shake 0.4s var(--ease-out);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

/* ============================================
   Main App Layout
   ============================================ */
.app-page {
    display: none;
    flex-direction: column;
    min-height: 100vh;
}

.app-page.active {
    display: flex;
}

/* Header */
.app-header {
    height: var(--header-height);
    background: var(--gradient-header);
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.app-header h2 {
    color: var(--text-white);
    font-size: 1.1rem;
    font-weight: 600;
}

.header-btn {
    position: absolute;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.header-btn:active {
    transform: scale(0.92);
}

.header-btn-left {
    left: 12px;
}

.header-btn-right {
    right: 12px;
}

.header-btn svg {
    width: 20px;
    height: 20px;
}

/* Content Area */
.app-content {
    flex: 1;
    padding: 1rem;
    padding-bottom: calc(var(--bottom-nav-height) + 1rem);
    overflow-y: auto;
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--bottom-nav-height);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    border: none;
    background: transparent;
    font-family: var(--font-family);
    position: relative;
    padding: 8px 0;
}

.nav-item.active {
    color: var(--accent-purple);
}

.nav-item.active svg {
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.5));
}

.nav-item svg {
    width: 22px;
    height: 22px;
    transition: all 0.2s var(--ease-out);
}

.nav-item span {
    font-size: 0.65rem;
    font-weight: 500;
}

.nav-item:active {
    transform: scale(0.92);
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    margin-right: -16px;
    background: var(--accent-red);
    color: var(--text-white);
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ============================================
   Feed / Post Cards
   ============================================ */
.post-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s var(--ease-out);
}

.post-card:active {
    transform: scale(0.99);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.post-avatar img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.post-user-info {
    flex: 1;
    min-width: 0;
}

.post-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.post-body {
    padding: 0.8rem 1rem;
}

.post-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
}

.post-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.post-actions {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 0.8rem;
    gap: 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    border: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: 0.85rem;
}

.post-action:hover {
    color: var(--accent-purple);
}

.post-action.liked {
    color: var(--accent-red);
}

.post-action svg {
    width: 20px;
    height: 20px;
    transition: all 0.2s var(--ease-out);
}

.post-action:active svg {
    transform: scale(1.2);
}

.post-action-count {
    font-size: 0.85rem;
    font-weight: 500;
}

.post-delete-btn {
    margin-left: auto;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 4px;
    transition: all 0.2s var(--ease-out);
}

.post-delete-btn:hover {
    color: var(--accent-red);
}

.post-delete-btn svg {
    width: 18px;
    height: 18px;
}

/* Comment section */
.comment-section {
    padding: 0 1rem 0.8rem;
    border-top: 1px solid var(--border-color);
    display: none;
}

.comment-section.show {
    display: block;
}

.comment-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.comment-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
}

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

.comment-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    word-break: break-word;
}

.comment-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.comment-input-area {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.comment-input-area input {
    flex: 1;
    padding: 0.5rem 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-family);
    outline: none;
}

.comment-input-area input:focus {
    border-color: var(--accent-purple);
}

.comment-input-area button {
    padding: 0.5rem 1rem;
    background: var(--gradient-button);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.comment-input-area button:active {
    transform: scale(0.95);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ============================================
   Create Post Page
   ============================================ */
.create-post-page {
    display: none;
    flex-direction: column;
    min-height: 100vh;
}

.create-post-page.show {
    display: flex;
}

.create-post-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}

.create-post-user .post-avatar {
    width: 44px;
    height: 44px;
}

.create-post-user span {
    font-weight: 600;
    font-size: 0.95rem;
}

.create-post-textarea {
    margin: 0 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-family);
    min-height: 150px;
    resize: vertical;
    outline: none;
    transition: all 0.2s var(--ease-out);
}

.create-post-textarea:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.create-post-textarea::placeholder {
    color: var(--text-muted);
}

.create-post-image-preview {
    margin: 1rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    display: none;
}

.create-post-image-preview.show {
    display: block;
}

.create-post-image-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.create-post-image-preview .remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.create-post-actions {
    padding: 0 1rem;
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-select-image {
    padding: 0.6rem 1.2rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--accent-purple);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-select-image:hover {
    background: rgba(168, 85, 247, 0.2);
}

.btn-select-image:active {
    transform: scale(0.97);
}

.btn-select-image svg {
    width: 18px;
    height: 18px;
}

.btn-submit-post {
    margin-left: auto;
    padding: 0.6rem 1.5rem;
    background: var(--gradient-button);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    font-family: var(--font-family);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-submit-post:active {
    transform: scale(0.97);
}

.btn-submit-post:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Profile Page
   ============================================ */
.profile-header {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    margin: 0 auto 1rem;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 2rem;
    font-weight: 700;
    border: 3px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-username {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.profile-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.8rem;
    background: var(--gradient-button);
    color: var(--text-white);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

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

.profile-stat-num {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.profile-edit-section {
    padding: 1rem;
}

.profile-edit-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.edit-profile-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.avatar-upload-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-upload-avatar {
    padding: 0.5rem 1rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--accent-purple);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    font-family: var(--font-family);
}

.btn-upload-avatar:hover {
    background: rgba(168, 85, 247, 0.2);
}

.profile-posts {
    padding: 0 1rem 1rem;
}

.profile-posts h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* ============================================
   AI Chat Page
   ============================================ */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    display: flex;
    gap: 0.5rem;
    max-width: 85%;
    animation: fadeInUp 0.3s var(--ease-out);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.chat-message.ai .chat-message-avatar {
    background: var(--gradient-button);
}

.chat-message-bubble {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-message.user .chat-message-bubble {
    background: var(--gradient-button);
    color: var(--text-white);
    border-bottom-right-radius: 4px;
}

.chat-message.ai .chat-message-bubble {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.chat-typing {
    display: flex;
    gap: 4px;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    align-self: flex-start;
    margin-left: 42px;
}

.chat-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

.chat-input-area {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 0.7rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-family);
    outline: none;
    transition: all 0.2s var(--ease-out);
}

.chat-input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-button);
    color: var(--text-white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    flex-shrink: 0;
}

.chat-send-btn:active {
    transform: scale(0.92);
}

.chat-send-btn svg {
    width: 18px;
    height: 18px;
}

.chat-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-clear-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Notifications Page
   ============================================ */
.notification-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-purple);
    transition: all 0.2s var(--ease-out);
    cursor: pointer;
}

.notification-card.read {
    border-left-color: var(--text-muted);
    opacity: 0.7;
}

.notification-card:active {
    transform: scale(0.99);
}

.notification-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.notification-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.notification-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-purple);
    margin-right: 0.5rem;
}

/* Admin notification form */
.admin-section {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.admin-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent-purple);
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-form .input-field {
    background: var(--bg-input);
}

.btn-admin-send {
    background: var(--gradient-button);
    color: var(--text-white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    font-family: var(--font-family);
}

.btn-admin-send:active {
    transform: scale(0.97);
}

.btn-admin-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.admin-toggle-btn {
    width: 100%;
    padding: 0.7rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--accent-purple);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    font-family: var(--font-family);
    margin-bottom: 1rem;
}

.admin-toggle-btn:hover {
    background: rgba(168, 85, 247, 0.2);
}

.notification-delete-btn {
    float: right;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.notification-delete-btn svg {
    width: 14px;
    height: 14px;
}

.notification-delete-btn:active {
    transform: scale(0.9);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 1rem);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s var(--ease-out);
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--accent-green);
}

.toast.error {
    border-color: var(--accent-red);
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Utility
   ============================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

/* Image lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    cursor: pointer;
    animation: fadeIn 0.2s var(--ease-out);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-sm);
}
