/* Root Variables */
:root {
    --primary-gold: #D4AF37;
    --secondary-purple: #6B46C1;
    --deep-blue: #1a1f3a;
    --light-blue: #4a5f8a;
    --calm-teal: #2dd4bf;
    --warm-orange: #fb923c;
    --soft-pink: #f9a8d4;
    --dark-bg: #0f0f23;
    --light-text: #e2e8f0;
    --muted-text: #94a3b8;
    --glass-bg: rgba(15, 15, 35, 0.7);
    --glass-border: rgba(212, 175, 55, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1f3a 100%);
    color: var(--light-text);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1f3a 0%, #0f0f23 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 1s ease-out;
}

.loading-content {
    text-align: center;
    max-width: 500px;
}

.sanskrit-symbol {
    font-size: 4rem;
    color: var(--primary-gold);
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.loading-title {
    font-family: 'Crimson Text', serif;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--primary-gold), var(--secondary-purple));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.loading-subtitle {
    color: var(--muted-text);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-gold), var(--secondary-purple));
    width: 0%;
    animation: loadProgress 3s ease-out forwards;
}

.loading-quote {
    font-style: italic;
    color: var(--muted-text);
    font-family: 'Crimson Text', serif;
    font-size: 1.1rem;
}

/* Navigation */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-brand .sanskrit {
    font-size: 1.5rem;
    color: var(--primary-gold);
}

.nav-brand .title {
    font-family: 'Crimson Text', serif;
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.nav-item {
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted-text);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.nav-item:hover {
    color: var(--light-text);
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--glass-border);
}

.nav-item.active {
    color: var(--primary-gold);
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--primary-gold);
}

.nav-controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--light-text);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
}

.control-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: scale(1.1);
}

/* Main Container */
#main-container {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
    position: relative;
}

/* Content Sections */
.content-section {
    display: none;
    min-height: calc(100vh - 70px);
    position: relative;
}

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

.canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Overlay UI Styles */
.overlay-ui {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    animation: slideIn 0.5s ease-out;
}

.formation-controls h2 {
    font-family: 'Crimson Text', serif;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-gold);
}

.formation-toggles {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toggle-group label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.toggle-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-gold);
}

.toggle-label {
    flex: 1;
    font-weight: 500;
}

.toggle-label small {
    display: block;
    color: var(--muted-text);
    font-size: 0.8rem;
    font-weight: 400;
}

.formation-info {
    margin-left: 2rem;
    color: var(--muted-text);
    font-size: 0.9rem;
    font-style: italic;
}

.state-slider {
    margin-top: 2rem;
}

.state-slider label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
}

.state-slider input[type="range"] {
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg,
        var(--warm-orange) 0%,
        var(--primary-gold) 50%,
        var(--calm-teal) 100%);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.state-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-gold);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.5);
}

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

/* Breathing UI */
.breathing-ui {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 4rem;
}

.breath-circle-container {
    position: relative;
}

.breath-circle {
    transform: rotate(-90deg);
}

.breath-track {
    fill: none;
    stroke: rgba(212, 175, 55, 0.1);
    stroke-width: 8;
}

.breath-progress {
    fill: none;
    stroke: var(--primary-gold);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 880;
    stroke-dashoffset: 880;
    transition: stroke-dashoffset 4s ease-in-out;
}

.breath-text {
    fill: var(--light-text);
    font-size: 1.5rem;
    text-anchor: middle;
    dominant-baseline: middle;
    transform: rotate(90deg);
    transform-origin: center;
}

.breathing-controls {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    min-width: 350px;
}

.breathing-controls h2 {
    font-family: 'Crimson Text', serif;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-gold);
}

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

.breath-phases {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.phase-btn {
    padding: 0.75rem;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--light-text);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.phase-btn:hover {
    background: rgba(212, 175, 55, 0.2);
}

.phase-btn.active {
    background: rgba(212, 175, 55, 0.3);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

.breath-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric {
    text-align: center;
    padding: 1rem;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 8px;
}

.metric-label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted-text);
    margin-bottom: 0.5rem;
}

.metric-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-gold);
}

/* Primary Button */
.primary-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-purple));
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

.secondary-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--primary-gold);
    border-radius: 8px;
    color: var(--primary-gold);
    cursor: pointer;
    transition: var(--transition);
}

.secondary-btn:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* Energy Controls */
.energy-controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    min-width: 400px;
}

.energy-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.input-group label {
    font-weight: 500;
    color: var(--light-text);
}

.input-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.input-group select {
    padding: 0.75rem;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--light-text);
    font-size: 0.9rem;
}

/* Mind-Body UI */
.mind-body-ui {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
}

.body-scanner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.scan-progress {
    position: relative;
    height: 200px;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--primary-gold) 50%,
        transparent 100%);
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

.scan-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-gold);
    font-weight: 500;
}

.tension-map, .release-techniques {
    background: rgba(212, 175, 55, 0.05);
    border-radius: 8px;
    padding: 1rem;
}

.tension-map h3, .release-techniques h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-gold);
}

/* Thoughts UI */
.thoughts-ui {
    position: absolute;
    left: 2rem;
    bottom: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
}

.thought-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.thought-input {
    display: flex;
    gap: 0.5rem;
}

.thought-input input {
    flex: 1;
    padding: 0.75rem;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--light-text);
    font-size: 0.9rem;
}

.thought-input button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-gold);
    border: none;
    border-radius: 8px;
    color: var(--deep-blue);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.thought-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--light-text);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
}

.filter-btn:hover {
    background: rgba(212, 175, 55, 0.2);
}

.filter-btn.active {
    background: var(--primary-gold);
    color: var(--deep-blue);
    border-color: var(--primary-gold);
}

.thought-stats {
    max-height: 200px;
}

/* Weather UI */
.weather-ui {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    min-width: 400px;
}

.current-weather {
    margin-bottom: 2rem;
}

.weather-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

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

.weather-desc {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary-gold);
}

.weather-modifiers {
    margin-bottom: 2rem;
}

.weather-modifiers h3 {
    margin-bottom: 1rem;
    color: var(--light-text);
}

.weather-btn {
    display: inline-block;
    margin: 0.25rem;
    padding: 0.75rem 1.5rem;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--light-text);
    cursor: pointer;
    transition: var(--transition);
}

.weather-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: scale(1.05);
}

/* Journey UI */
.journey-ui {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
}

.journey-ui h2 {
    text-align: center;
    font-family: 'Crimson Text', serif;
    font-size: 3rem;
    margin-bottom: 3rem;
    background: linear-gradient(45deg, var(--primary-gold), var(--secondary-purple));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.journey-stages {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.journey-stages::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        var(--warm-orange) 0%,
        var(--primary-gold) 50%,
        var(--calm-teal) 100%);
    z-index: -1;
}

.stage {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    max-width: 200px;
}

.stage:hover {
    transform: translateY(-10px);
    border-color: var(--primary-gold);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.2);
}

.stage.completed {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--primary-gold);
}

.stage-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.stage h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-gold);
}

.stage p {
    font-size: 0.85rem;
    color: var(--muted-text);
}

.progress-tracker {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
}

.progress-bar {
    height: 20px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-gold), var(--secondary-purple));
    width: 0%;
    transition: width 1s ease-out;
}

.progress-text {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
}

#progress-percent {
    color: var(--primary-gold);
}

/* Side Panel */
.side-panel {
    position: fixed;
    top: 70px;
    right: -400px;
    width: 400px;
    height: calc(100vh - 70px);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    transition: right 0.3s ease-out;
    z-index: 999;
    overflow-y: auto;
}

.side-panel.open {
    right: 0;
}

.close-panel {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    color: var(--light-text);
    font-size: 1.5rem;
    cursor: pointer;
}

.panel-content {
    padding: 2rem;
}

.panel-content h2 {
    font-family: 'Crimson Text', serif;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-gold);
}

.info-section {
    margin-bottom: 2rem;
}

.info-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--light-text);
}

.info-section p {
    color: var(--muted-text);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.info-section ul {
    list-style-position: inside;
    color: var(--muted-text);
    line-height: 1.8;
}

.info-section ul li {
    margin-bottom: 0.5rem;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes loadProgress {
    to { width: 100%; }
}

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

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .overlay-ui,
    .breathing-ui,
    .energy-controls,
    .mind-body-ui,
    .thoughts-ui,
    .weather-ui {
        position: relative;
        transform: none;
        top: auto;
        left: auto;
        right: auto;
        max-width: 100%;
        margin: 1rem;
    }

    .journey-stages {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .journey-stages::before {
        display: none;
    }
}