/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    background: linear-gradient(135deg, #AC5E56 0%, #402F3C 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
    letter-spacing: 0.3px;
}

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

/* Header Styles */
.app-header {
    text-align: center;
    padding: 2rem 1rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.app-title {
    font-family: 'Source Serif 4', serif;
    font-size: 2.8rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    letter-spacing: 1px;
}

.app-logo {
    height: 3.75rem;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { 
        transform: translateY(0px) scale(1);
        filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    }
    50% { 
        transform: translateY(-3px) scale(1.02);
        filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    }
}

.app-subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 200;
    opacity: 0.9;
    letter-spacing: 1.2px;
    text-transform: lowercase;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Meditation Selection Screen */
.meditation-selection {
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

.meditation-selection h2 {
    font-family: 'Source Serif 4', serif;
    font-size: 2.2rem;
    margin-bottom: 3rem;
    font-weight: 300;
    opacity: 0.95;
    letter-spacing: 0.8px;
}

.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.track-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.track-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.track-card:hover::before {
    left: 100%;
}

.track-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.track-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #E18159;
}

.track-card h3 {
    font-family: 'Source Serif 4', serif;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.track-card p {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    opacity: 0.85;
    margin-bottom: 1rem;
    line-height: 1.6;
    letter-spacing: 0.3px;
}

.duration {
    font-family: 'Nunito', sans-serif;
    display: inline-block;
    background: rgba(225, 129, 89, 0.3);
    padding: 0.3rem 1rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Meditation Player Screen */
.meditation-player {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.back-button {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-3px);
}

.current-track-info {
    margin-bottom: 3rem;
}

.current-track-info h2 {
    font-family: 'Source Serif 4', serif;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
    letter-spacing: 0.8px;
}

.current-track-info p {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    opacity: 0.85;
    font-size: 1.1rem;
    letter-spacing: 0.4px;
}

/* Glowing Orb */
.orb-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
    margin: 2rem 0;
    position: relative;
}

.orb {
    width: 200px;
    height: 200px;
    position: relative;
    cursor: pointer;
}

.orb-svg {
    width: 100%;
    height: 100%;
    animation: orbFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(225, 129, 89, 0.5));
}

#orb-core {
    transform-origin: center;
}

/* Fallback orb style if SVG fails */
.orb::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, #E7C9AE, #E18159, #AC5E56);
    border-radius: 50%;
    animation: orbFloat 4s ease-in-out infinite;
    box-shadow: 0 0 50px rgba(225, 129, 89, 0.5);
    z-index: -1;
}

/* Hide fallback when SVG is working */
.orb:has(.orb-svg)::before {
    display: none;
}

.orb-pulse {
    transform-origin: center;
    animation: orbPulse 2s ease-in-out infinite;
}

@keyframes orbFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(180deg); }
}

@keyframes orbPulse {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    100% { 
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Orb Active States */
.orb.playing .orb-svg {
    filter: drop-shadow(0 0 50px rgba(225, 129, 89, 0.8));
}

.orb.reacting #orb-core {
    animation: orbReact 0.1s ease-in-out;
}

@keyframes orbReact {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Timer Container */
.timer-container {
    margin: 2rem 0;
}

.timer-display {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.time-left {
    font-family: 'Source Serif 4', serif;
    font-size: 3.2rem;
    font-weight: 200;
    display: block;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
}

.timer-label {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 200;
    opacity: 0.7;
    text-transform: lowercase;
    letter-spacing: 2px;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #E18159, #D9C082);
    border-radius: 2px;
    width: 0%;
    transition: width 1s ease;
}

/* Controls */
.controls-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.control-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

#play-pause-btn {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    background: rgba(225, 129, 89, 0.3);
}

#play-pause-btn:hover {
    background: rgba(225, 129, 89, 0.5);
}

/* Volume Control */
.volume-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.volume-container i {
    opacity: 0.7;
}

.volume-slider {
    width: 150px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #E18159;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #E18159;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #E18159;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
    letter-spacing: 0.8px;
}

/* Demo Messages */
.demo-message {
    animation: fadeInOut 3s ease-in-out;
}

.demo-message p {
    margin: 0.25rem 0;
}

.demo-message p:first-child {
    font-weight: 600;
}

.demo-message i {
    color: #D9C082;
    margin-right: 0.5rem;
}

.completion-message h3 {
    margin: 1rem 0 0.5rem;
    font-size: 1.5rem;
}

.completion-message button:hover {
    background: rgba(225,129,89,0.5) !important;
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .app-logo {
        height: 3.125rem;
    }
    
    .app-subtitle {
        font-size: 1rem;
    }
    
    .track-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .track-card {
        padding: 1.5rem;
    }
    
    .orb {
        width: 150px;
        height: 150px;
    }
    
    .time-left {
        font-size: 2.5rem;
    }
    
    .back-button {
        position: relative;
        top: auto;
        left: auto;
        margin-bottom: 2rem;
    }
    
    .current-track-info h2 {
        font-size: 1.5rem;
    }
}

/* Mobile volume control when inside orb container */
.orb-container .volume-container {
    flex-direction: column;
    position: absolute;
    right: -4rem;
    top: 50%;
    transform: translateY(-50%);
    height: 200px;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    z-index: 10;
    gap: 0;
}

.orb-container .volume-container i:first-child {
    order: 1;
    font-size: 0.9rem;
}

.orb-container .volume-slider {
    order: 2;
    width: 150px;
    height: 4px;
    transform: rotate(-90deg);
    transform-origin: center;
}

.orb-container .volume-container i:last-child {
    order: 3;
    font-size: 1.1rem;
}

@media (max-width: 480px) {
    .orb-container .volume-container {
        right: -3rem;
        height: 160px;
    }
    
    .orb-container .volume-slider {
        width: 120px;
    }
    
    .orb-container .volume-container i:first-child {
        font-size: 0.8rem;
    }
    
    .orb-container .volume-container i:last-child {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
    }
    
    .app-logo {
        height: 2.5rem;
    }
    
    
    .meditation-selection h2 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .orb {
        width: 120px;
        height: 120px;
    }
    
    .orb-container {
        height: 200px;
    }
    
    .control-btn {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
    
    #play-pause-btn {
        width: 70px;
        height: 70px;
        font-size: 1.5rem;
    }
}