:root {
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.5);
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-blue: #3b82f6;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Effects */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
}

.nebula {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.05) 50%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
    border-radius: 50%;
    animation: pulse 10s infinite alternate;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary);
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.logo h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: transform var(--transition-speed) ease, border var(--transition-speed) ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Input Section */
.input-section {
    margin-bottom: 3rem;
}

textarea {
    width: 100%;
    min-height: 200px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1.1rem;
    line-height: 1.6;
    padding: 1rem;
    resize: none;
    outline: none;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Result Section */
.result-section {
    display: block;
}

.hidden {
    display: none !important;
}

.user-dream-card {
    grid-column: 1 / -1;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary);
    background: rgba(255, 255, 255, 0.03);
}

#display-user-dream {
    font-style: italic;
    color: var(--text-main);
    line-height: 1.6;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

.emotion-card {
    grid-row: span 2;
}

.chart-container {
    height: 300px;
    position: relative;
    margin-top: 1rem;
}

h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.8rem;
}

h3 i {
    color: var(--primary);
}

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

.symbol-item {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border-left: 3px solid var(--primary);
}

.symbol-item strong {
    display: block;
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.symbol-item span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.italic-text {
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Image Container */
.dream-image-container {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
    border: 1px solid var(--glass-border);
}

#dream-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 1s ease;
}

.image-skeleton {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Archetype & Music */
.archetype-content h4 {
    font-size: 1.4rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.music-content {
    background: rgba(139, 92, 246, 0.1);
    padding: 1rem;
    border-radius: 12px;
    border: 1px dashed var(--primary);
    display: flex;
    align-items: center;
    gap: 15px;
}

.music-content::before {
    content: "\f001";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--primary);
    font-size: 1.2rem;
}

.download-btn {
    margin-left: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-blue);
    color: var(--text-main);
}

.download-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.actions {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* Animations */
.animate-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards cubic-bezier(0.22, 1, 0.36, 1);
}

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

.app-footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
