:root {
    --gold-primary: #FFD700;
    --gold-light: #FFF2CC;
    --gold-dark: #B8860B;
    --purple-deep: #4B0082;
    --orange-sunrise: #FF6B35;
    --white: #FFFFFF;
    --black: #1a1a1a;
    --gradient-primary: linear-gradient(135deg, #FFD700 0%, #FF6B35 50%, #4B0082 100%);
    --gradient-secondary: linear-gradient(45deg, #FFF2CC, #FFD700);
    
    --bat-black: #0a0a0a;
    --steve-gold: #FFD700;
    --steve-deep-gold: #B8860B;
    --buddha-warm-gold: #FFB347;
    --neo-purple: #1a0033;
    --matrix-green: #00ff41;
    --crimson-accent: #8B0000;
    
    --shadow-primary: 0 0 20px rgba(255, 215, 0, 0.3);
    --shadow-intense: 0 0 40px rgba(255, 215, 0, 0.5);
    --glow-neural: 0 0 10px rgba(0, 255, 65, 0.3);
    --quantum-black: #03010f;
    --deep-space-blue: #0a041a;
    --nebula-purple: #4B0082;
    --star-white: #f0f8ff;
    --accent-cyan: #00ffff;
    --accent-magenta: #ff00ff;

    --font-primary: 'Orbitron', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    --font-display: 'Cinzel', serif;
}

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

body {
    font-family: var(--font-secondary);
    background-color: var(--quantum-black);
    color: var(--star-white);
    overflow: hidden;
    height: 100vh;
    cursor: default;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--quantum-black);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out;
}

.preloader-logo {
    width: 100px;
    height: 100px;
    border: 3px solid var(--accent-cyan);
    border-radius: 50%;
    position: relative;
    animation: rotate 3s linear infinite;
}
.preloader-logo::before, .preloader-logo::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 2px solid;
    inset: 10px;
}
.preloader-logo::before {
    border-color: var(--ascension-gold);
    animation: rotate 2s linear infinite reverse;
}
.preloader-logo::after {
    border-color: var(--matrix-green);
    animation: rotate 1.5s linear infinite;
}

.preloader-text {
    font-family: var(--font-primary);
    margin-top: 2rem;
    letter-spacing: 3px;
    color: var(--matrix-green);
    text-shadow: 0 0 10px var(--matrix-green);
    animation: pulse-text 1.5s infinite alternate;
}

.preloader-bar {
    width: 200px;
    height: 2px;
    background: var(--matrix-green);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}
.preloader-bar::after {
    content: '';
    position: absolute;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--star-white), transparent);
    animation: scan 2s linear infinite;
}

@keyframes pulse-text {
    from { opacity: 0.7; }
    to { opacity: 1; }
}
@keyframes scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Quantum Core & Background */
#quantum-core {
    position: relative;
    width: 100%;
    height: 100vh;
    opacity: 0;
    transition: opacity 0.8s ease-in;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.sacred-geometry-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vmin;
    height: 100vmin;
    transform: translate(-50%, -50%);
    background: url('https://www.transparenttextures.com/patterns/hexellence.png'), 
                radial-gradient(ellipse at center, rgba(0, 255, 65, 0.05) 0%, transparent 60%);
    opacity: 0.15;
    animation: rotate 180s linear infinite, pulse-bg 10s ease-in-out infinite alternate;
    z-index: -1;
}

#metatron-cube .sg-line {
    stroke: var(--accent-cyan);
    stroke-width: 0.2;
    stroke-linecap: round;
}

#metatron-cube .sg-main-circle {
    fill: none;
    stroke: var(--accent-magenta);
    stroke-width: 0.15;
}

#metatron-cube .sg-node {
    fill: var(--star-white);
}

@keyframes pulse-bg {
    from {
        opacity: 0.05;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 0.15;
        transform: translate(-50%, -50%) scale(1);
    }
}

.presentation-container {
    width: 100%;
    height: 100%;
    position: relative;
    perspective: 1500px;
}

/* Slide Styling */
.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transform-style: preserve-3d;
    transition: opacity 0.8s ease, transform 0.8s ease;
    transform: translateX(50%) rotateY(-20deg) scale(0.8);
}

.slide:not(.active) {
    filter: blur(5px);
    opacity: 0;
}

.slide.active {
    opacity: 1;
    transform: translateX(0) rotateY(0) scale(1);
    z-index: 10;
}

.slide.exiting {
    transform: translateX(-50%) rotateY(20deg) scale(0.8);
    opacity: 0;
    z-index: 9;
}

.slide-content {
    max-width: 1000px;
    width: 100%;
    text-align: center;
    position: relative;
    padding: 3rem;
    background: rgba(10, 4, 26, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 255, 65, 0.2);
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(0, 255, 65, 0.1);
}
.slide-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.3), transparent, rgba(255, 0, 255, 0.3));
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

/* Title Slide */
.title {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.title-main {
    display: block;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: 3px;
    background: linear-gradient(45deg, var(--gold-primary), var(--star-white), var(--accent-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px var(--accent-cyan);
    animation: glow-title 3s infinite alternate;
}

.title-sub {
    display: block;
    font-family: var(--font-primary);
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--accent-cyan);
    margin-top: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--star-white);
    opacity: 0.8;
}

.start-prompt {
    margin-top: 3rem;
    font-family: var(--font-primary);
    color: var(--matrix-green);
    animation: pulse-text 2s infinite alternate;
}

@keyframes glow-title {
    from { text-shadow: 0 0 15px var(--accent-cyan); }
    to { text-shadow: 0 0 30px var(--accent-cyan), 0 0 50px var(--gold-primary); }
}

/* HUD Control Panel */
.hud-control-panel {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(10, 4, 26, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 50px;
    padding: 0.5rem;
    z-index: 100;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.1);
}

.hud-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--matrix-green);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hud-btn:hover {
    color: var(--star-white);
    background: rgba(0, 255, 65, 0.1);
    border-color: var(--matrix-green);
    text-shadow: 0 0 10px var(--matrix-green);
}

.hud-slide-counter {
    font-family: var(--font-primary);
    color: var(--star-white);
    padding: 0 1.5rem;
    font-size: 1.1rem;
}

/* Panels, Modals, Sidebar */
.holo-panel {
    background: rgba(10, 4, 26, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.1);
    position: relative;
}
.holo-panel::before { /* Corner elements */
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-cyan);
    opacity: 0.7;
}
.holo-panel::before {
    top: -2px; left: -2px;
    border-right: none; border-bottom: none;
}
/* This can be expanded with ::after and more pseudo-elements for all 4 corners */

.sidebar {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100vh;
    transition: left 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    z-index: 200;
    overflow-y: auto;
}

.sidebar.active { left: 0; }

.sidebar-header, .calendar-header, .daily-header, .practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}
.sidebar-header h3, .calendar-header h3, .daily-header h3, .practice-header h3 {
    font-family: var(--font-primary);
    color: var(--accent-cyan);
}

.close-btn {
    background: none;
    border: none;
    color: var(--accent-cyan);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
}
.close-btn:hover { color: var(--star-white); transform: rotate(90deg); }

.nav-section {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.nav-section h4 {
    color: var(--gold-light);
    margin-bottom: 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--star-white);
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}
.nav-item:hover {
    background: rgba(0, 255, 65, 0.1);
    border-left-color: var(--matrix-green);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 1, 15, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; }
.modal-overlay .holo-panel {
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1);
}
.modal-overlay.active .holo-panel { transform: scale(1); }

/* Journal Modal */
.journal-modal {
    width: 90%;
    max-width: 800px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.journal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.journal-header h3 {
    font-family: var(--font-primary);
    color: var(--accent-cyan);
}

.journal-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow: hidden;
}

.journal-template-selector {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.journal-template-selector label {
    font-family: var(--font-primary);
    color: var(--accent-cyan);
}

.holo-select {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: var(--star-white);
    padding: 0.5rem;
    border-radius: 5px;
    font-family: var(--font-secondary);
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.holo-select:focus {
    outline: none;
    border-color: var(--matrix-green);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.journal-template-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.journal-toolbar {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.tool-btn {
    background: transparent;
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: var(--accent-cyan);
    width: 40px;
    height: 40px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.tool-btn:hover, .tool-btn.active {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px var(--accent-cyan);
    transform: scale(1.05);
}

#voiceToTextBtn.active {
    background: var(--matrix-green);
    color: var(--quantum-black);
    animation: pulse-active 1.5s infinite;
}

@keyframes pulse-active {
    0% { box-shadow: 0 0 5px var(--matrix-green); }
    50% { box-shadow: 0 0 20px var(--matrix-green); }
    100% { box-shadow: 0 0 5px var(--matrix-green); }
}

.journal-editor {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    border: 1px solid transparent;
    outline: none;
    transition: all 0.3s ease;
    line-height: 1.7;
    font-size: 1rem;
}

.journal-editor:focus {
    border-color: var(--matrix-green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
    background: rgba(0, 10, 5, 0.3);
}

.journal-editor p {
    margin-bottom: 1em;
}

.journal-editor ul {
    padding-left: 2rem;
    margin-bottom: 1em;
}

.journal-footer {
    padding: 1rem 1.5rem;
    text-align: right;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
    flex-shrink: 0;
}

/* Journal Form Styles */
.journal-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.5rem;
}

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

.form-group label {
    font-family: var(--font-secondary);
    color: var(--star-white);
    opacity: 0.8;
}

.holo-input, .holo-textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: var(--star-white);
    padding: 0.75rem;
    border-radius: 5px;
    font-family: var(--font-secondary);
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.holo-textarea {
    resize: vertical;
    min-height: 80px;
}

.holo-input:focus, .holo-textarea:focus {
    outline: none;
    border-color: var(--matrix-green);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.star-rating {
    display: flex;
    gap: 0.5rem;
    font-size: 1.5rem;
    color: var(--star-white);
}

.star-rating i {
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}
.star-rating i:hover {
    transform: scale(1.1);
    color: var(--gold-primary);
}

.gratitude-input-group {
    display: flex;
    gap: 0.5rem;
}
.gratitude-input-group .holo-input {
    flex-grow: 1;
}

.gratitude-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gratitude-list li {
    background: rgba(0, 255, 65, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 5px;
    border-left: 3px solid var(--matrix-green);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gratitude-list li button {
    background: none;
    border: none;
    color: var(--star-white);
    opacity: 0.5;
    font-size: 1.2rem;
    cursor: pointer;
    transition: opacity 0.3s;
}
.gratitude-list li button:hover {
    opacity: 1;
}

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

/* Buttons */
.holo-button {
    background: transparent;
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}
.holo-button:hover {
    background: var(--matrix-green);
    color: var(--quantum-black);
    box-shadow: 0 0 20px var(--matrix-green);
}
.holo-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.4s ease;
}
.holo-button:hover::before { left: 100%; }

/* Voice Interface */
.voice-interface {
    position: fixed;
    bottom: calc(2rem + 70px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
}
.voice-interface.active {
    opacity: 1;
    pointer-events: auto;
    animation: voice-glow 2s infinite alternate;
}
.voice-indicator { display: flex; align-items: center; }
.voice-waves { display: flex; gap: 2px; }
.wave {
    width: 3px;
    height: 18px;
    background: var(--matrix-green);
    border-radius: 3px;
    animation: wave-quiet 1.5s ease-in-out infinite;
}
.voice-interface.active .wave { animation-name: wave-active; }
.wave:nth-child(2) { animation-delay: 0.2s; }
.wave:nth-child(3) { animation-delay: 0.4s; }

.voice-feedback { font-family: var(--font-primary); color: var(--star-white); }

@keyframes wave-quiet { 0%, 100% { transform: scaleY(0.2); } 50% { transform: scaleY(0.6); } }
@keyframes wave-active { 0%, 100% { transform: scaleY(0.2); } 50% { transform: scaleY(1); } }
@keyframes voice-glow { from { box-shadow: 0 0 15px rgba(0,255,65,0.2); } to { box-shadow: 0 0 30px rgba(0,255,65,0.5); } }

/* Other elements */
.calendar-modal {
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.calendar-body {
    overflow: hidden;
    padding: 1rem;
    flex-grow: 1;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    height: 100%;
    overflow-y: auto;
    padding-right: 1rem; /* space for scrollbar */
}
.calendar-day {
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.calendar-day:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--accent-cyan);
    transform: translateY(-5px);
}
.calendar-day.completed {
    background: rgba(0, 255, 65, 0.2);
    border-color: var(--matrix-green);
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.day-number {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    color: var(--accent-cyan);
}
.day-journal-btn {
    background: none;
    border: none;
    color: var(--star-white);
    opacity: 0.6;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.day-journal-btn:hover {
    opacity: 1;
    color: var(--matrix-green);
    transform: scale(1.1);
}
.day-date {
    font-size: 0.9rem;
    opacity: 0.8;
}
.day-virtue {
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--gold-primary);
}

.timer-circle { width: 200px; height: 200px; }
.timer-background { stroke: rgba(0, 255, 255, 0.2); }
.timer-progress { stroke: var(--matrix-green); }
.timer-text { font-family: var(--font-primary); fill: var(--star-white); }

.voice-commands ul { list-style: none; padding: 0; }
.voice-commands li { padding: 0.75rem 0; border-bottom: 1px solid rgba(0, 255, 255, 0.1); }

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

/* Final Polish */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--quantum-black);
}
::-webkit-scrollbar-thumb {
    background: var(--matrix-green);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hud-control-panel {
        gap: 0.2rem;
    }
    .hud-btn {
        width: 45px;
        height: 45px;
    }
    .hud-slide-counter {
        padding: 0 0.5rem;
    }
    .slide-content {
        padding: 2rem;
    }
    .sidebar {
        width: 80%;
        left: -80%;
    }
}