:root {
    /* Cosmic Warm Palette */
    --bg-deep: #1A1A2E; /* Derin Lacivert */
    --bg-surface: #16213E; /* Yumuşak Lacivert/Mor */
    --accent-purple: #7B68EE; /* Lavanta / Mor */
    --accent-gold: #E2B714; /* Altın Sarısı */
    --accent-earth: #9CAF88; /* Adaçayı Yeşili */
    --accent-red: #E94560; /* Canlı Vurgu */
    
    --text-primary: #F7F7F7;
    --text-secondary: #B0B0C0;
    
    /* Glassmorphism */
    --glass-bg: rgba(22, 33, 62, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 80px; /* Nav bar boşluğu */
    overflow-x: hidden;
}

/* Background System */
#bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    background-color: var(--bg-deep);
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-layer.active {
    opacity: 1;
}

.bg-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.4) 0%, rgba(26, 26, 46, 0.95) 100%);
    z-index: 1;
    pointer-events: none;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: inherit;
}

/* Yükseklik ve Kaydırma Barı */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--bg-surface);
    border-radius: 10px;
}

/* Glassmorphism Utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
}

/* Main Container */
.app-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    animation: fadeIn 0.4s ease-out;
}

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

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

/* Center on large screens */
@media (min-width: 600px) {
    .bottom-nav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 20px 20px 0 0;
        border: 1px solid var(--glass-border);
        border-bottom: none;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    flex: 1;
    height: 100%;
}

.nav-item i {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

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

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

.nav-item.active i {
    transform: translateY(-2px);
}

/* Cards & Layouts */
.header-section {
    margin-bottom: 2rem;
}

.header-section h1 {
    font-size: 2rem;
    background: linear-gradient(90deg, #fff, var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-section p {
    color: var(--text-secondary);
}

.card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-3px);
}

.card-title {
    font-size: 1.2rem;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    background: rgba(123, 104, 238, 0.2);
    color: var(--accent-purple);
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, var(--accent-purple), #5a4bba);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(123, 104, 238, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 104, 238, 0.5);
}

.btn-secondary {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    box-shadow: none;
}

/* Inputs & Forms */
textarea, select, input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    margin-bottom: 1rem;
    transition: border 0.3s ease;
}

textarea:focus, select:focus, input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

/* Audio Mixer Sliders */
.mixer-item {
    margin-bottom: 1.5rem;
}

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

.mixer-header span {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    padding: 0;
    height: 4px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent-gold);
    cursor: pointer;
    margin-top: -6px;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: var(--bg-surface);
    border-radius: 2px;
}

/* Breathing Visualizer */
.breath-circle-container {
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
}

.breath-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-purple), transparent);
    box-shadow: 0 0 40px var(--accent-purple);
    animation: none; /* JS will trigger this */
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
}

@keyframes breatheIn {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(2.2); opacity: 1; }
}

@keyframes breatheHold {
    0% { transform: scale(2.2); }
    100% { transform: scale(2.2); }
}

@keyframes breatheOut {
    0% { transform: scale(2.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

/* Journal List */
.journal-entry {
    border-left: 3px solid var(--accent-purple);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}
.journal-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}
.mood-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    background: rgba(226, 183, 20, 0.2);
    color: var(--accent-gold);
    margin-left: 8px;
}

/* Chat UI (Philosophy Simulator) */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease-out;
}

.chat-socrates {
    align-self: flex-start;
    background: rgba(22, 33, 62, 0.8);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
}

.chat-user {
    align-self: flex-end;
    background: var(--accent-purple);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.chat-option-btn {
    background: transparent;
    border: 1px solid var(--accent-purple);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-option-btn:hover {
    background: rgba(123, 104, 238, 0.2);
}

/* Quiz UI */
.quiz-option {
    display: block;
    width: 100%;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    cursor: pointer;
    transition: border 0.3s ease;
}

.quiz-option:hover {
    border-color: var(--accent-gold);
}

/* Gamification UI */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(226, 183, 20, 0.9);
    color: #1A1A2E;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-family: var(--font-heading);
    box-shadow: 0 4px 15px rgba(226, 183, 20, 0.4);
    animation: toastSlideDown 0.3s ease-out forwards, toastFadeOut 0.5s ease-in 2.5s forwards;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

/* Badge Styles */
.badge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    width: 30%;
    transition: all 0.3s ease;
}

.badge-card.locked {
    opacity: 0.4;
    filter: grayscale(100%);
}

.badge-icon {
    font-size: 2rem;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.habit-checkbox {
    appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--accent-purple);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.habit-checkbox:checked {
    background: var(--accent-purple);
}

.habit-checkbox:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
}

/* AI Insight & Chart Styles */
.insight-panel {
    background: linear-gradient(145deg, rgba(123, 104, 238, 0.15), rgba(22, 33, 62, 0.4));
    border: 1px solid var(--accent-purple);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.insight-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-gold));
}

.chart-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 120px;
    padding-top: 20px;
    margin-top: 15px;
    border-top: 1px dashed rgba(255,255,255,0.1);
}

.chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 20px;
    background: var(--accent-purple);
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease-out;
    box-shadow: 0 0 10px rgba(123, 104, 238, 0.3);
}

.chart-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.ai-warning {
    background: rgba(233, 69, 96, 0.1);
    border-left: 4px solid var(--accent-red);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    animation: fadeIn 0.5s ease;
}

/* Practice Active State & Sound Select Styles */
.practice-area {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.practice-area.active {
    background: linear-gradient(145deg, rgba(123, 104, 238, 0.2), rgba(22, 33, 62, 0.6));
    border: 1px solid var(--accent-purple);
    box-shadow: 0 0 15px rgba(123, 104, 238, 0.3);
}

.sound-select-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.sound-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    flex: 1;
    outline: none;
    cursor: pointer;
}

.sound-select option {
    background: var(--bg-deep);
    color: var(--text-primary);
}

.active-practice-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--accent-gold);
    font-weight: 600;
    margin: 15px 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0.7; transform: scale(1); }
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.chat-input-wrapper input {
    margin-bottom: 0;
    flex: 1;
}

.chat-input-wrapper button {
    padding: 0 20px;
    border-radius: 15px;
}
