:root {
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --secondary-color: #ec4899;
    --background: #0f172a;
    --surface: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -2px rgba(0,0,0,0.2);
    --radius: 12px;
    --radius-sm: 8px;
}

[data-theme="light"] body {
    background: #f8fafc;
}
[data-theme="light"] body::before {
    display: none !important;
}
[data-theme="light"] .shooting-star,
[data-theme="light"] .twinkle-star {
    display: none !important;
}

[data-theme="light"] .page-content {
    background: var(--surface);
    border: none;
    box-shadow: var(--shadow);
    backdrop-filter: none;
}
[data-theme="light"] .dream-card {
    background: var(--surface);
    border: none;
    box-shadow: var(--shadow);
    backdrop-filter: none;
}
[data-theme="light"] .search-form {
    background: var(--surface);
    border: none;
    box-shadow: var(--shadow);
    backdrop-filter: none;
}
[data-theme="light"] .search-input {
    background: var(--background);
    color: var(--text-primary);
    border-color: var(--border-color);
}
[data-theme="light"] .header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: none;
}
[data-theme="light"] .footer {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    backdrop-filter: none;
}
[data-theme="light"] .dropdown-content {
    background: var(--surface);
    border-color: var(--border-color);
    backdrop-filter: none;
}
[data-theme="light"] .auth-form {
    background: var(--surface);
    border: none;
    box-shadow: var(--shadow-lg);
    backdrop-filter: none;
}
[data-theme="light"] .admin-content,
[data-theme="light"] .tab-content {
    background: var(--surface);
    border: none;
    backdrop-filter: none;
}
[data-theme="light"] .dream-ai-sidebar {
    background: var(--surface);
    border-color: var(--border-color);
    backdrop-filter: none;
}
[data-theme="light"] .dream-ai-header {
    background: var(--surface);
    border-color: var(--border-color);
    backdrop-filter: none;
}
[data-theme="light"] .dream-ai-chat {
    background: var(--surface);
    border-color: var(--border-color);
}
[data-theme="light"] .dream-ai-input-area {
    background: var(--surface);
    border-color: var(--border-color);
    backdrop-filter: none;
}
[data-theme="light"] .dream-ai-input-wrapper {
    background: var(--background);
    border-color: var(--border-color);
}
[data-theme="light"] .dream-ai-input-wrapper textarea {
    color: var(--text-primary);
}
[data-theme="light"] .dream-content,
[data-theme="light"] .dream-yozumu,
[data-theme="light"] .premium-features,
[data-theme="light"] .profile-header,
[data-theme="light"] .tarot-result,
[data-theme="light"] .tarot-info-box,
[data-theme="light"] .json-result,
[data-theme="light"] .tarot-premium,
[data-theme="light"] .bank-info,
[data-theme="light"] .ad-item,
[data-theme="light"] .conv-item,
[data-theme="light"] .chat-box,
[data-theme="light"] .tarot-info-bar,
[data-theme="light"] .dream-ai-sidebar-header,
[data-theme="light"] .empty-results,
[data-theme="light"] .dreams-section.with-style {
    background: var(--surface);
    border-color: var(--border-color);
    backdrop-filter: none;
    box-shadow: var(--shadow);
}
[data-theme="light"] .admin-form input,
[data-theme="light"] .admin-form textarea,
[data-theme="light"] .admin-form select,
[data-theme="light"] .comment-form textarea,
[data-theme="light"] .auth-form input {
    background: var(--background);
    color: var(--text-primary);
    border-color: var(--border-color);
}
[data-theme="light"] .theme-toggle {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
}
[data-theme="light"] .welcome-info {
    background: var(--background);
    border: none;
}
[data-theme="light"] .message-text,
[data-theme="light"] .ai-message .message-text {
    background: var(--background);
}
[data-theme="light"] .chat-input-row {
    background: var(--surface);
    border-color: var(--border-color);
}
[data-theme="light"] .dream-ai-attempts {
    background: #d1fae5;
    color: #065f46;
}
[data-theme="light"] .dream-ai-welcome h3 {
    color: var(--text-primary);
}
[data-theme="light"] .dream-ai-welcome > p {
    color: var(--text-secondary);
}
[data-theme="light"] .dreams-section h2 {
    color: var(--text-primary);
}
[data-theme="light"] .logo {
    color: var(--text-primary);
}
[data-theme="light"] .dream-actions {
    background: var(--surface);
    border: 1px solid var(--border-color);
    backdrop-filter: none;
}
[data-theme="light"] .admin-table th {
    background: #e2e8f0;
    color: #1e293b;
}
[data-theme="light"] .tarot-interpretation {
    background: rgba(255,255,255,0.2);
}
[data-theme="light"] .tarot-interpretation .advice {
    background: rgba(0,0,0,0.2);
}
[data-theme="light"] .az-letters a {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] {
    --background: #0f172a;
    --surface: rgba(30, 41, 59, 0.35);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .dream-card,
[data-theme="dark"] .ad-item,
[data-theme="dark"] .dream-content,
[data-theme="dark"] .dream-yozumu,
[data-theme="dark"] .premium-features,
[data-theme="dark"] .profile-header,
[data-theme="dark"] .tarot-result,
[data-theme="dark"] .tarot-info-box,
[data-theme="dark"] .tarot-premium,
[data-theme="dark"] .bank-info,
[data-theme="dark"] .conv-item,
[data-theme="dark"] .chat-box,
[data-theme="dark"] .tarot-info-bar,
[data-theme="dark"] .dream-ai-sidebar,
[data-theme="dark"] .dream-ai-chat,
[data-theme="dark"] .admin-content,
[data-theme="dark"] .tab-content,
[data-theme="dark"] .empty-results,
[data-theme="dark"] .dreams-section.with-style,
[data-theme="dark"] .auth-form,
[data-theme="dark"] .dropdown-content,
[data-theme="dark"] .footer {
    background: var(--surface);
}

[data-theme="dark"] .page-content {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

[data-theme="dark"] .search-form {
    background: rgba(30, 41, 59, 0.15);
    backdrop-filter: blur(24px);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .card-link {
    background: transparent;
}

[data-theme="dark"] .dream-ai-link-dream {
    background: linear-gradient(160deg, rgba(26, 10, 46, 0.15) 0%, rgba(45, 27, 78, 0.15) 50%, rgba(26, 10, 46, 0.15) 100%);
    backdrop-filter: blur(20px);
}

[data-theme="dark"] .dream-ai-link-fal {
    background: linear-gradient(160deg, rgba(15, 12, 41, 0.15) 0%, rgba(48, 43, 99, 0.15) 50%, rgba(36, 36, 62, 0.15) 100%);
    backdrop-filter: blur(20px);
}

[data-theme="light"] {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

html {
    overflow-y: auto;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(160deg, #0a0e27 0%, #1a1040 40%, #0d1b2a 100%);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* Twinkling stars background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(1px 1px at 20px 30px, #fff, transparent),
        radial-gradient(1px 1px at 40px 70px, #fff, transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, #fff, transparent),
        radial-gradient(1px 1px at 160px 30px, #fff, transparent),
        radial-gradient(1px 1px at 200px 60px, #fff, transparent),
        radial-gradient(1px 1px at 50px 120px, #fff, transparent),
        radial-gradient(1px 1px at 250px 20px, #fff, transparent),
        radial-gradient(1px 1px at 300px 90px, #fff, transparent),
        radial-gradient(1px 1px at 350px 50px, #fff, transparent),
        radial-gradient(1px 1px at 420px 110px, #fff, transparent),
        radial-gradient(1px 1px at 500px 30px, #fff, transparent),
        radial-gradient(1px 1px at 550px 70px, #fff, transparent),
        radial-gradient(1px 1px at 600px 130px, #fff, transparent),
        radial-gradient(1px 1px at 680px 40px, #fff, transparent),
        radial-gradient(1px 1px at 750px 100px, #fff, transparent),
        radial-gradient(1px 1px at 820px 60px, #fff, transparent),
        radial-gradient(1px 1px at 900px 20px, #fff, transparent),
        radial-gradient(1px 1px at 960px 120px, #fff, transparent),
        radial-gradient(1px 1px at 1050px 80px, #fff, transparent),
        radial-gradient(1px 1px at 1120px 40px, #fff, transparent),
        radial-gradient(1px 1px at 1180px 110px, #fff, transparent),
        radial-gradient(1px 1px at 60px 200px, #fff, transparent),
        radial-gradient(1px 1px at 180px 250px, #fff, transparent),
        radial-gradient(1px 1px at 320px 300px, #fff, transparent),
        radial-gradient(1px 1px at 450px 200px, #fff, transparent),
        radial-gradient(1px 1px at 580px 280px, #fff, transparent),
        radial-gradient(1px 1px at 700px 350px, #fff, transparent),
        radial-gradient(1px 1px at 850px 220px, #fff, transparent),
        radial-gradient(1px 1px at 1000px 380px, #fff, transparent),
        radial-gradient(1px 1px at 150px 380px, #fff, transparent),
        radial-gradient(1px 1px at 400px 100px, #fff, transparent),
        radial-gradient(1px 1px at 650px 150px, #fff, transparent),
        radial-gradient(1px 1px at 900px 50px, #fff, transparent),
        radial-gradient(1px 1px at 1100px 300px, #fff, transparent),
        radial-gradient(1px 1px at 200px 150px, #fff, transparent),
        radial-gradient(1px 1px at 500px 350px, #fff, transparent),
        radial-gradient(1px 1px at 800px 180px, #fff, transparent),
        radial-gradient(1px 1px at 100px 300px, #fff, transparent);
    background-size: 400px 400px;
}

/* Shooting stars */
@keyframes shootingStar {
    0% { transform: translateX(0) translateY(0); opacity: 1; }
    70% { opacity: 1; }
    100% { transform: translateX(-300px) translateY(300px); opacity: 0; }
}

.shooting-star {
    position: fixed;
    width: 1px;
    height: 1px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 3px 1px rgba(255,255,255,0.5);
    animation: shootingStar 3s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.shooting-star:nth-child(1) { top: 10%; left: 80%; animation-delay: 0s; animation-duration: 2.5s; }
.shooting-star:nth-child(2) { top: 30%; left: 90%; animation-delay: 5s; animation-duration: 3s; }
.shooting-star:nth-child(3) { top: 50%; left: 85%; animation-delay: 10s; animation-duration: 2.8s; }
.shooting-star:nth-child(4) { top: 15%; left: 75%; animation-delay: 15s; animation-duration: 3.2s; }
.shooting-star:nth-child(5) { top: 60%; left: 95%; animation-delay: 20s; animation-duration: 2.7s; }

@keyframes twinkleStar {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    20% { opacity: 1; transform: scale(1.2); }
    40% { opacity: 0.6; transform: scale(0.8); }
    60% { opacity: 1; transform: scale(1); }
    80% { opacity: 0.3; transform: scale(0.6); }
}

.twinkle-star {
    position: fixed;
    border-radius: 50%;
    background: #fff;
    pointer-events: none;
    z-index: 0;
    animation: twinkleStar var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
    box-shadow: 0 0 2px 0.5px rgba(255,255,255,0.3);
}

main {
    flex: 1;
}

.page-content {
    background: rgba(30, 41, 59, 0.4);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    margin: 20px auto;
    max-width: 1500px;
    width: 100%;
    box-sizing: border-box;
    align-self: center;
    position: relative;
    z-index: 1;
}

.page-content .container {
    max-width: none;
    padding: 0;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
}

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

a:hover {
    color: var(--primary-hover);
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
}

.logo-icon {
    font-size: 1.8rem;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.nav a:hover {
    background: var(--background);
    color: var(--primary-color);
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
}

.btn-liked {
    background: var(--secondary-color);
}

.btn-liked:hover {
    background: #db2777;
}

/* Tarot Styles */
.tarot-section {
    text-align: center;
}

.tarot-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.tarot-card {
    width: 80px;
    height: 120px;
    background: linear-gradient(145deg, #667eea, #764ba2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.tarot-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.tarot-result {
    animation: fadeIn 0.5s ease-in;
    margin-top: 20px;
    padding: 15px;
    box-sizing: border-box;
    background: rgba(30, 41, 59, 0.9);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    text-align: center;
   max-width: 1400px;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.tarot-cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tarot-cards-container > div {
    flex: 1 1 0;
    max-width: 1400px;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .tarot-cards-container {
        flex-direction: column;
    }

    .tarot-cards-container > div {
        max-width: 100%;
    }
}

.tarot-result h2 {
    margin-bottom: 20px;
}

.tarot-interpretation {
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    margin-top: 20px;
    font-size: 1.1rem;
}

.tarot-interpretation .advice {
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-style: italic;
}

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

#tarot-info {
    text-align: left !important;
}

#tarot-info h4 {
    text-align: center !important;
}

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

.btn-outline:hover {
    background: var(--background);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Header Message Icon */
.header-icon-link {
    position: relative;
    color: var(--text-secondary);
    font-size: 1.2rem;
    text-decoration: none;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon-link:hover {
    color: var(--primary-color);
    background: var(--surface);
}

.header-icon-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;

}

.emoji-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--background);
    font-size: 1.2rem;
    line-height: 1;
}

.comment-avatar.emoji-avatar {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    min-width: 180px;
    display: none;
    z-index: 1000;
    backdrop-filter: blur(30px);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 12px 16px;
    color: var(--text-primary);
}

.dropdown-content a:hover {
    background: var(--background);
}

.search-section {
    padding: 30px 0;
}

.search-form {
    display: flex;
    gap: 10px;
    background: rgba(30, 41, 59, 0.35);
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: rgba(15, 23, 42, 0.6);
    color: #f1f5f9;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Search Loading */
.search-loading {
    text-align: center;
    padding: 40px 20px;
}

.search-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

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

.search-loading p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Search Stage Badge */
.search-stage-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 12px;
    margin-top: 8px;
}

.search-not-found {
    color: white !important;
    font-size: 1.1rem;
    font-weight: 500;
}

.search-error {
    text-align: center;
    color: #ef4444;
    padding: 20px;
}

.ads-section {
    margin-bottom: 30px;
}

.ads-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.ad-item {
    background: rgba(30, 41, 59, 0.85);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.2s;
    border: 1px solid rgba(255,255,255,0.06);
}

.ad-item:hover {
    transform: translateY(-2px);
}

.ad-item img {
    width: 100%;
    height: 60px;

    display: block;
}

.ad-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    background: var(--primary-color);
    color: white;
    font-size: 1.5rem;
}

.ad-icon i {
    font-size: 1.8rem;
}

.ad-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ad-link:hover {
    opacity: 0.9;
}

.ad-item span {
    display: block;
    padding: 8px;
    font-size: 0.85rem;
    text-align: center;
    background: var(--surface);
}

.ad-free-btn {
    display: block;
    width: 100%;
    padding: 8px;
    font-size: 0.8rem;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.ad-free-btn:hover {
    background: var(--primary-hover);
}

.ad-free-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

.ad-badge {
    display: block;
    padding: 8px;
    font-size: 0.8rem;
    text-align: center;
    background: #d1fae5;
    color: #065f46;
    font-weight: 600;
}

.ad-clicked {
    opacity: 0.7;
}

.viewed-badge {
    position: absolute;
    top: 0px;
    right: -2px;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 0px 10px 0px 10px;
}

.dream-card.viewed {
    border: 2px solid var(--primary-color);
}

.dreams-section {
    margin-bottom: 40px;
}

.dreams-section h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #f1f5f9;
}

.dreams-section h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.dreams-section h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.dreams-section p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.dreams-section.with-style {
    padding: 25px;
    background: rgba(30, 41, 59, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.dreams-section.with-style h2 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.dreams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.dream-card {
    background: rgba(30, 41, 59, 0.85);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
}

.dream-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-link {
    display: block;
    padding: 20px;
    color: var(--text-primary);
}

.card-link h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    line-height: 1.4;
}

.card-link .excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.load-more-container {
    text-align: center;
    margin-top: 30px;
}

.sidebar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.sidebar-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-primary);
}

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

.dream-list li {
    border-bottom: 1px solid var(--border-color);
}

.dream-list li:last-child {
    border-bottom: none;
}

.dream-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    color: var(--text-primary);
}

.dream-list a:hover {
    color: var(--primary-color);
}

.list-title {
    flex: 1;
    margin-right: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.header {
    position: relative;
    z-index: 100;
}

.footer {
    background: rgba(15, 23, 42, 0.9);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 30px 0;
    margin-top: 10px;
    text-align: center;
    color: var(--text-secondary);
    backdrop-filter: blur(30px);
    position: relative;
    z-index: 1;
}

.dream-page {
}

.dream-header {
    text-align: center;
    margin-bottom: 30px;
}

.dream-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.dream-content {
    background: rgba(30, 41, 59, 0.9);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    line-height: 1.8;
    font-size: 1.1rem;
}

.dream-stats {
    display: flex;
    gap: 30px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    justify-content: flex-end;
}

.dream-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    background: rgba(30, 41, 59, 0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.05);
}

.comments-section {
    margin-top: 40px;
}

.comments-section h3 {
    margin-bottom: 20px;
}

.comment-form {
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.6);
    color: #f1f5f9;
    resize: vertical;
    min-height: 100px;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.6);
    color: #f1f5f9;
}

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

.comment-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;

}

.comment-content {
    flex: 1;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.comment-author {
    font-weight: 600;
}

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

.comment-text {
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
}

.comment-actions a {
    color: var(--text-secondary);
}

.comment-actions a:hover {
    color: var(--primary-color);
}

.replies {
    margin-left: 55px;
    margin-top: 10px;
}

.search-results {
}

.search-info {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

[data-theme="dark"] .search-info {
    background: rgba(30, 41, 59, 0.2);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.empty-results {
    text-align: center;
    padding: 60px 20px;
    background: rgba(30, 41, 59, 0.9);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.06);
}

.empty-results h3 {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.suggested-section {
    margin-top: 30px;
}

.suggested-section h4 {
    margin-bottom: 15px;
}

.profile-section {
    margin-bottom: 40px;
}

.profile-section h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.profile-section h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.profile-section h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(30, 41, 59, 0.9);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.06);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;

}

.profile-info h2 {
    margin-bottom: 5px;
}

.profile-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.profile-tab {
    padding: 10px 20px;
    cursor: pointer;
    color: var(--text-secondary);
}

.profile-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.tarot-section {
    padding: 30px 0;
    text-align: center;
}



.tarot-cards {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.tarot-card {
    width: 80px;
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.tarot-card:hover {
    transform: scale(1.1);
}

.tarot-result h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.tarot-history {
    margin-top: 40px;
}

.tarot-history h4 {
    margin-bottom: 15px;
}

.tarot-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}

.admin-section {
}

.profile-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.profile-section h4 {
    color: var(--text-primary);
    margin: 20px 0 10px 0;
    font-size: 1.1rem;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.admin-content {
    background: rgba(30, 41, 59, 0.9);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
}

.admin-content.mb-30 {
    margin-bottom: 30px;
}

.tab-content {
    display: none;
    padding: 25px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    margin-bottom: 40px;
    backdrop-filter: blur(20px);
}

.tab-content.active {
    display: block;
}

.tab-content.dreams-section.with-style {
    padding: 25px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.footer-hits {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.admin-form {
    max-width: 600px;
}

.admin-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.6);
    color: #f1f5f9;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.admin-form input[type="file"] {
    padding: 8px 15px;
    background: var(--surface);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: rgba(15, 23, 42, 0.8);
    font-weight: 600;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        z-index: 99;
    }

    .nav.active {
        display: flex;
    }

    .nav a {
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
    }
}

.auth-section {
    padding: 60px 0;
}

.auth-form {
    max-width: 400px;
    margin: 0 auto;
    background: rgba(30, 41, 59, 0.9);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
backdrop-filter: blur(20px)
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text-primary);
}

.auth-form .btn {
    width: 100%;
    margin-top: 10px;
}

.az-list {
}

.az-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.az-letters a {
    display: inline-block;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.06);
}

.az-letters a:hover,
.az-letters a.active {
    background: var(--primary-color);
    color: white;
}

.alert {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

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

.dream-card {
    animation: fadeIn 0.3s ease-out;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.95);
    color: #fbbf24;
    border: 2px solid rgba(255,255,255,0.15);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    font-size: 1.5rem;
    z-index: 9999;
    backdrop-filter: blur(30px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}
.theme-toggle:hover {
    transform: scale(1.15);
    background: rgba(99, 102, 241, 0.9);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.4);
}

@media (max-width: 768px) {
    .header-flex {
        flex-wrap: wrap;
    }

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

    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .dream-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .dream-stats {
        flex-direction: row;
        gap: 15px;
        flex: none;
    }
}

.notification-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    margin-left: 10px;
    background: #ff4757;
    color: white;
    border-radius: 15px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background 0.3s;
}

.notification-badge:hover {
    background: #e84118;
}

.notification-badge .badge {
    margin-left: 5px;
    background: #fff;
    color: #ff4757;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.7rem;
}

.premium-features {
    background: rgba(30, 41, 59, 0.9);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid rgba(255,255,255,0.08);
}

.premium-features h4 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.premium-features ul {
    margin-left: 20px;
    line-height: 1.8;
}

.premium-features li {
    margin-bottom: 8px;
}

.bank-info {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    color: white !important;
}

.bank-info h4 {
    color: #ffd700 !important;
    margin-bottom: 15px !important;
}

.bank-note {
    font-size: 0.85rem;
    margin-top: 10px;
    opacity: 0.9;
}

.section-title {
    margin-top: 20px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.btn-block {
    display: block;
    width: 100%;
}

.balance-badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 5px;
}

.dropdown-balance {
    padding: 10px 15px;
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}

.notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
}

.notification-item .badge {
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
}

.dream-yozumu {
    text-align: center;
    padding: 20px;
    background: rgba(30, 41, 59, 0.9);
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
    }

    .profile-tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .profile-tab {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .admin-content {
        padding: 20px;
    }

    .premium-features {
        padding: 15px;
    }
}

.premium-features ul {
    margin-left: 20px;
    line-height: 1.8;
}

/* Tarot content styles */
.tarot-desc {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.tarot-info-bar {
    background: rgba(30, 41, 59, 0.9);
    padding: 15px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255,255,255,0.08);
    padding-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.tarot-actions {
    margin-top: 40px;
}

.tarot-info-btn {
    margin-bottom: 20px;
}

.tarot-info-box {
    display: none;
    padding: 20px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
}

.tarot-info-title {
    margin-bottom: 15px;
    color: var(--primary-color);
    text-align: center;
}

.tarot-info-text {
    margin-bottom: 10px;
    line-height: 1.6;
}

.tarot-cards-list {
    margin-left: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.tarot-premium {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.tarot-premium-title {
    margin-bottom: 10px;
    color: #ffd700;
}

.tarot-premium-text {
    margin-bottom: 10px;
    line-height: 1.6;
}

.tarot-premium-list {
    margin-left: 20px;
    margin-bottom: 10px;
    line-height: 1.8;
    font-size: 0.9rem;
}

.tarot-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: 8px;
}

.tarot-item-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tarot-empty {
    color: var(--text-secondary);
}

.footer-hits {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Messages Page */
.messages-page {
    max-width: 1400px;
    margin: 0 auto;
}

/* Conversation List */
.conv-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px 16px;
    transition: background 0.2s;
}

.conv-item:hover {
    background: var(--background);
}

.conv-link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    text-decoration: none;
    color: var(--text-primary);
    min-width: 0;
}

.conv-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

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

.conv-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.conv-last {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.messages-header h2 {
    margin: 0;
}

.msg-delete-all {
    color: #ef4444;
    font-size: 0.85rem;
    text-decoration: none;
}

.msg-delete-all:hover {
    text-decoration: underline;
}

/* Chat Box */
.chat-box {
    max-width: 1400px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 16px;
    height: 450px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.chat-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

/* Message Row */
.msg-row {
    margin-bottom: 12px;
}

/* Message Bubble */
.msg-bubble {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 12px 14px;
    max-width: 80%;
    display: inline-block;
}

.msg-bubble.user-bubble {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid rgba(255,255,255,0.08);
}

/* Message Header (inside bubble) */
.msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.user-bubble .msg-header {
    border-bottom-color: rgba(255,255,255,0.08);
}

.msg-header strong {
    font-size: 0.85rem;
}

.msg-date {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-left: auto;
}

/* Avatar inside bubble */
.msg-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;

    flex-shrink: 0;
}

/* Message Text */
.msg-text {
    line-height: 1.5;
    font-size: 0.95rem;
    word-wrap: break-word;
}

.msg-img {
    max-width: 220px;
    max-height: 180px;
    border-radius: 8px;
    display: block;
    margin-bottom: 6px;
    cursor: pointer;
}

.msg-bubble audio {
    width: 220px;
    display: block;
    margin-bottom: 6px;
	
}

/* Delete Button */
.msg-del {
    color: #ef4444;
    text-decoration: none;
    font-size: 0.7rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239,68,68,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.msg-del:hover {
    background: #ef4444;
    color: white;
}

.user-bubble .msg-del {
    color: #ef4444;
    background: rgba(239,68,68,0.1);
}

.user-bubble .msg-del:hover {
    background: #ef4444;
    color: white;
}

/* Chat Input */
.chat-input-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 6px 8px;
}

.chat-input-row textarea {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    padding: 6px 8px;
    min-height: 24px;
    outline: none;
}

.chat-attach-btn,
.chat-voice-btn,
.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-attach-btn:hover,
.chat-voice-btn:hover {
    background: var(--primary-color);
    color: white;
}

.chat-voice-btn.recording {
    background: #ef4444;
    color: white;
}

.chat-send-btn {
    background: var(--primary-color);
    color: white;
}

.chat-send-btn:hover {
    opacity: 0.85;
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--background);
    border-radius: 8px;
    font-size: 0.85rem;
}

.btn-remove-file {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 0.75rem;
}

/* Badge */
.badge {
    display: inline-block;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: bold;
    margin-left: 5px;
}

/* Alerts */
.alert-success {
    background: #d1fae5;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.notification-item {
    position: relative;
}

/* JSON Fallback Results */
.json-result {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 25px;
    margin: 20px auto;
    max-width: 800px;
    color: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
}

.json-result .result-category {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.json-result .result-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 15px;
}

.json-result .match-info {
    font-size: 0.85rem;
    opacity: 0.8;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 15px;
}

.json-result .match-info span {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    padding: 3px 10px;
    border-radius: 15px;
    margin: 3px;
    font-size: 0.8rem;
}

/* Fal Card Styles */
.dream-ai-link-wrapper {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.dream-ai-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 35px 40px;
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 260px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.15);
}

.dream-ai-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

/* Twinkling stars on cards */
.dream-ai-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 30px 20px, #fff, transparent),
        radial-gradient(1px 1px at 70px 50px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1.5px 1.5px at 120px 30px, #fff, transparent),
        radial-gradient(1px 1px at 180px 70px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 50px 80px, #ddd, transparent),
        radial-gradient(1px 1px at 200px 40px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 140px 90px, #eee, transparent),
        radial-gradient(1px 1px at 90px 100px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 220px 80px, #ddd, transparent);
    pointer-events: none;
    z-index: 1;
    animation: cardTwinkle 3s ease-in-out infinite alternate;
}

@keyframes cardTwinkle {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.dream-ai-link i {
    font-size: 2.8rem;
    filter: drop-shadow(0 0 12px rgba(255,255,255,0.4));
    transition: transform 0.4s;
    position: relative;
    z-index: 2;
}

.dream-ai-link strong {
    position: relative;
    z-index: 2;
    font-size: 1.05rem;
}

.dream-ai-link:hover {
    transform: translateY(-6px) scale(1.03);
    color: white;
}

.dream-ai-link:hover i {
    transform: scale(1.2) rotate(-5deg);
}

.dream-ai-link:active {
    transform: translateY(-2px) scale(0.98);
}

.dream-ai-link-fal {
    background: linear-gradient(160deg, rgba(15, 12, 41, 0.4) 0%, rgba(48, 43, 99, 0.4) 50%, rgba(36, 36, 62, 0.4) 100%);
    box-shadow: 0 8px 40px rgba(48, 43, 99, 0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    backdrop-filter: blur(16px);
}

.dream-ai-link-fal:hover {
    box-shadow: 0 16px 60px rgba(48, 43, 99, 0.8), inset 0 1px 0 rgba(255,255,255,0.15);
}

.dream-ai-link-dream {
    background: linear-gradient(160deg, rgba(26, 10, 46, 0.4) 0%, rgba(45, 27, 78, 0.4) 50%, rgba(26, 10, 46, 0.4) 100%);
    box-shadow: 0 8px 40px rgba(45, 27, 78, 0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    backdrop-filter: blur(16px);
}

.dream-ai-link-dream:hover {
    box-shadow: 0 16px 60px rgba(45, 27, 78, 0.8), inset 0 1px 0 rgba(255,255,255,0.15);
}

[data-theme="light"] .dream-ai-link-dream,
[data-theme="light"] .dream-ai-link-fal {
    background: var(--surface);
    color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-color);
}
[data-theme="light"] .dream-ai-link-dream:hover,
[data-theme="light"] .dream-ai-link-fal:hover {
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
}
[data-theme="light"] .dream-ai-link-dream i,
[data-theme="light"] .dream-ai-link-fal i {
    filter: none;
}
[data-theme="light"] .dream-ai-link-dream::before,
[data-theme="light"] .dream-ai-link-fal::before {
    display: none;
}
[data-theme="light"] .dream-ai-link-dream::after,
[data-theme="light"] .dream-ai-link-fal::after {
    display: none;
}

.dream-ai-page {
    display: flex;
    gap: 0;
    height: calc(100vh - 180px);
    min-height: 500px;
    position: relative;
    overflow: hidden;
}

.dream-ai-sidebar {
    width: 280px;
    min-width: 280px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-right: 15px;
    backdrop-filter: blur(20px);
}

.dream-ai-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(15, 23, 42, 0.6);
}

.dream-ai-sidebar-header h3 {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dream-ai-sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

.dream-ai-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.dream-ai-empty {
    text-align: center;
    padding: 30px 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dream-ai-history-item {
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 5px;
    border: 1px solid transparent;
}

.dream-ai-history-item:hover {
    background: var(--background);
    border-color: var(--border-color);
}

.history-item-question {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.history-item-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dream-ai-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dream-ai-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
    flex-wrap: wrap;
    backdrop-filter: blur(20px);
}

.dream-ai-chat {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-top: none;
    border-bottom: none;
}

.dream-ai-menu-btn {
    display: none;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.dream-ai-header-info {
    flex: 1;
    min-width: 0;
}

.dream-ai-header-info h2 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.dream-ai-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 2px 0 0 0;
}

.dream-ai-status {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.dream-ai-attempts {
    background: #d1fae5;
    color: #065f46;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.dream-ai-balance {
    color: var(--primary-color);
    font-weight: 600;
}

.dream-ai-chat {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-top: none;
    border-bottom: none;
}

.dream-ai-welcome {
    text-align: center;
    padding: 40px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.dream-ai-welcome h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #f1f5f9;
}

.dream-ai-welcome > p {
    color: #94a3b8;
    margin-bottom: 20px;
}

.welcome-info {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 15px;
    text-align: left;
    font-size: 0.9rem;
}

.welcome-info p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.welcome-info p:last-child {
    margin-bottom: 0;
}

.welcome-info i {
    color: var(--primary-color);
}

/* Messages */
.dream-ai-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-out;
}

.dream-ai-message.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.message-avatar.ai-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 1.3rem;
}

.msg-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.message-content {
    max-width: 70%;
    min-width: 0;
}

.user-message .message-content {
    text-align: right;
}

.message-sender {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.message-text {
    background: rgba(15, 23, 42, 0.8);
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 0.95rem;
    word-wrap: break-word;
}

.ai-message .message-text {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 16px 16px 16px 4px;
    line-height: 1.7;
}

.user-message .message-text {
    background: var(--primary-color);
    color: white;
    border-radius: 16px 16px 4px 16px;
}

.ai-message .message-text {
    background: var(--background);
    border-radius: 16px 16px 16px 4px;
    line-height: 1.7;
}

/* Typing indicator */
.typing-dots {
    display: flex;
    gap: 5px;
    padding: 15px 20px;
    background: var(--background);
    border-radius: 16px 16px 16px 4px;
    align-items: center;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

/* Input area */
.dream-ai-input-area {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 15px;
    backdrop-filter: blur(20px);
}

.dream-ai-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 8px 12px;
}

.dream-ai-attempts {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.dream-ai-input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    color: #f1f5f9;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    padding: 6px 0;
    min-height: 24px;
    max-height: 120px;
    outline: none;
}

.dream-ai-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.dream-ai-send-btn:hover:not(:disabled) {
    opacity: 0.85;
}

.dream-ai-send-btn:disabled {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.dream-ai-new-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.dream-ai-new-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.dream-ai-input-footer {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dream-ai-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* Mobile */
@media (max-width: 768px) {
    .dream-ai-page {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 200px);
    }

    .dream-ai-sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 100;
        border-radius: 0;
        margin-right: 0;
        transition: left 0.3s;
        box-shadow: var(--shadow-lg);
    }

    .dream-ai-sidebar.active {
        left: 0;
    }

    .dream-ai-sidebar-close {
        display: block;
    }

    .dream-ai-menu-btn {
        display: block;
    }

    .dream-ai-overlay.active {
        display: block;
    }

    .dream-ai-header {
        flex-wrap: wrap;
    }

    .dream-ai-status {
        width: 100%;
        justify-content: flex-start;
    }

    .dream-ai-chat {
        height: 400px;
        padding: 15px;
    }

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

    .dream-ai-welcome {
        padding: 20px 15px;
    }
}

/* Modal popup */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: var(--surface, #2a2a3e);
    border-radius: 16px;
    padding: 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: modalIn 0.25s ease;
}
@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-icon {
    font-size: 48px;
    margin-bottom: 15px;
}
.modal-text {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 20px;
    color: var(--text-primary, #e0e0e0);
}
.modal-btn {
    padding: 10px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.modal-btn:hover {
    opacity: 0.9;
}
