/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: hsl(220, 30%, 6%);
    --bg-card: hsl(220, 25%, 10%);
    --text-light: hsl(210, 40%, 98%);
    --text-muted: hsl(215, 20%, 65%);
    --primary: hsl(263, 70%, 60%);
    --primary-glow: hsl(280, 80%, 70%);
    --secondary: hsl(200, 90%, 55%);
    --accent: hsl(280, 80%, 70%);
    --border: hsl(220, 20%, 20%);
    --input-bg: hsl(220, 20%, 15%);
    --destructive: hsl(0, 84%, 60%);
    --amber: hsl(38, 92%, 50%);
    --radius: 1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 5rem 1rem;
    background: linear-gradient(135deg, hsl(263, 70%, 60%, 0.2), var(--bg-dark), hsl(200, 90%, 55%, 0.2));
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48cGF0dGVybiBpZD0iZ3JpZCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2JhKDI1NSwyNTUsMjU1LDAuMDMpIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=') center;
    opacity: 0.4;
}

.hero-content {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.brain-icon {
    width: 3rem;
    height: 3rem;
    stroke-width: 1.5;
}

.sparkle-icon {
    width: 1.5rem;
    height: 1.5rem;
    stroke-width: 2;
}

.title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    animation: fade-in 0.8s ease-out;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 42rem;
    margin: 0 auto;
    animation: fade-in 0.8s ease-out 0.2s both;
}

/* Form Section */
.form-section {
    flex: 1;
    padding: 3rem 1rem;
    max-width: 50rem;
    margin: 0 auto;
    width: 100%;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    animation: fade-in 0.6s ease-out;
}

.form-header {
    margin-bottom: 2rem;
}

.form-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sparkle-icon-small {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--accent);
    stroke-width: 2;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

textarea {
    width: 100%;
    min-height: 8rem;
    padding: 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 0.5);
    color: var(--text-light);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.energy-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.slider {
    width: 100%;
    height: 8px;
    background: var(--input-bg);
    border-radius: 1rem;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px var(--primary);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: calc(var(--radius) * 0.5);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    font-family: inherit;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--text-light);
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary);
}

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

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

.btn-secondary:hover {
    background: var(--bg-card);
}

/* Page Header (for moods page) */
.page-header {
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-small {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brain-icon-small {
    width: 2rem;
    height: 2rem;
    color: var(--primary);
    stroke-width: 1.5;
}

.logo-small h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.home-icon {
    width: 1rem;
    height: 1rem;
    stroke-width: 2;
}

/* Moods Section */
.moods-section {
    flex: 1;
    padding: 3rem 1rem;
    max-width: 64rem;
    margin: 0 auto;
    width: 100%;
}

.moods-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fade-in 0.6s ease-out;
}

.moods-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.moods-header p {
    color: var(--text-muted);
}

.loading {
    text-align: center;
    padding: 5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
}

.empty-state {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
}

.empty-state svg {
    width: 4rem;
    height: 4rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin: 0 auto 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Mood Cards */
.mood-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s;
    animation: fade-in 0.4s ease-out both;
}

.mood-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mood-content {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.mood-text {
    flex: 1;
    line-height: 1.6;
}

.mood-energy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.mood-energy svg {
    width: 1rem;
    height: 1rem;
}

.energy-low {
    color: var(--destructive);
}

.energy-medium {
    color: var(--amber);
}

.energy-high {
    color: var(--secondary);
}

.mood-meta {
    display: flex;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mood-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.mood-meta svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* Footer */
.footer {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 0.5);
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
    max-width: 400px;
}

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

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

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

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .hero {
        padding: 3rem 1rem;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary {
        width: 100%;
    }
    
    .mood-content {
        flex-direction: column;
    }
    
    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }
}