:root {
    --bg-color: #0A0A0B;
    --panel-bg: rgba(20, 20, 24, 0.7);
    --panel-border: rgba(255, 255, 255, 0.05);
    --primary-gradient: linear-gradient(135deg, #2DD4BF 0%, #3B82F6 100%);
    --primary-color: #3B82F6;
    --coin-gradient: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    --text-main: #FFFFFF;
    --text-muted: #8A8F98;
    --success: #00E676;
    --glass-blur: blur(20px);
}

* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; }
body { 
    font-family: 'Outfit', sans-serif; 
    background-color: var(--bg-color); 
    color: var(--text-main); 
    height: 100vh; 
    width: 100vw;
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}
input, textarea { user-select: auto; }

/* Subtle Background Animation for a Cleaner Look */
.bg-animation { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; overflow: hidden; background: #0A0A0B; }
.blob { position: absolute; border-radius: 50%; filter: blur(150px); opacity: 0.15; animation: move 20s infinite alternate; }
.blob-1 { width: 50vw; height: 50vw; background: #2DD4BF; top: -10%; left: -10%; }
.blob-2 { width: 40vw; height: 40vw; background: #3B82F6; bottom: -10%; right: -5%; animation-delay: -5s; }
@keyframes move { 0% { transform: translate(0, 0); } 100% { transform: translate(5vw, 5vh); } }

/* Focused & Clean Panels */
.glass-panel { 
    background: var(--panel-bg); 
    backdrop-filter: var(--glass-blur); 
    -webkit-backdrop-filter: var(--glass-blur); 
    border: 1px solid var(--panel-border); 
    border-radius: 24px; 
    padding: 1.5rem; 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); 
}

/* Fullscreen Layout Grid */
.main-header { 
    width: 100%; 
    height: 90px;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 3rem; 
    border-bottom: 1px solid var(--panel-border);
    background: rgba(10, 10, 11, 0.4);
    backdrop-filter: blur(20px);
    z-index: 10;
}

.container.main-layout { 
    width: 100%; 
    height: calc(100vh - 90px);
    display: grid; 
    grid-template-columns: 400px 1fr; 
    gap: 2rem; 
    padding: 2rem 3rem; 
}

/* Header & Currency Setup */
.profile-info { display: flex; align-items: center; gap: 1rem; }
.avatar { width: 45px; height: 45px; background: var(--primary-gradient); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.2rem; }
.user-details h1 { font-size: 1.1rem; letter-spacing: 0.5px; }
.user-details p { color: var(--text-muted); font-size: 0.85rem; font-weight: 400; margin-top: 0.2rem; }

.currency-panel { display: flex; align-items: center; gap: 3rem; }
.coin-display { font-size: 1.6rem; font-weight: 700; color: #FFD700; display: flex; align-items: center; gap: 0.5rem; }
.coin-icon { font-size: 1.3rem; }

.xp-display { width: 180px; display: flex; flex-direction: column; gap: 0.4rem; }
.xp-bar { width: 100%; height: 6px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; overflow: hidden; }
.xp-progress { height: 100%; background: var(--primary-gradient); width: 0%; transition: width 0.8s; }
.xp-text { font-size: 0.75rem; color: var(--text-muted); text-align: right; text-transform: uppercase; letter-spacing: 1px; }

.header-actions { display: flex; gap: 1rem; }
.action-btn { background: var(--coin-gradient); color: #000; border: none; padding: 0.8rem 1.5rem; border-radius: 12px; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; font-family: inherit; display: flex; gap: 0.5rem; align-items: center; }
.action-btn.settings-action { background: rgba(255,255,255,0.05); color: white; }
.action-btn:hover { background: #FFFFFF; color: #000; }

/* Left Column: Focused Timer  */
.left-column { display: flex; flex-direction: column; gap: 2rem; height: 100%; overflow: hidden; }

.timer-panel { display: flex; flex-direction: column; align-items: center; position: relative; padding: 2.5rem 1.5rem; flex-shrink: 0; }
.timer-modes { display: flex; background: rgba(0, 0, 0, 0.4); padding: 0.4rem; border-radius: 16px; gap: 0.4rem; margin-bottom: 2rem; width: 100%; justify-content: center;}
.mode-btn { background: transparent; border: none; color: var(--text-muted); padding: 0.6rem 1rem; border-radius: 12px; font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: 0.3s; flex: 1; }
.mode-btn.active { background: var(--panel-border); color: white; }

.timer-display { position: relative; width: 280px; height: 280px; display: flex; flex-direction: column; justify-content: center; align-items: center; margin-bottom: 2rem; }
.progress-ring { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }
.progress-ring__circle { transition: stroke-dashoffset 1s linear; transform-origin: 50% 50%; opacity: 1; }
.progress-ring__circle.stopwatch-ring { transform: rotate(90deg); stroke-dashoffset: 0 !important; animation: stopwatch-spin 60s linear infinite; }
.progress-ring__circle.stopwatch-ring.paused { animation-play-state: paused; }
@keyframes stopwatch-spin { 100% { transform: rotate(450deg); } }

.time { font-size: 4rem; font-weight: 700; z-index: 2; letter-spacing: -1px; }
.status-text { font-size: 0.95rem; color: var(--text-muted); z-index: 2; margin-top: -0.5rem;}

.timer-controls { display: flex; gap: 1rem; }
.control-btn { width: 64px; height: 64px; border-radius: 20px; border: none; background: white; color: black; font-size: 1.5rem; cursor: pointer; transition: 0.2s; }
.control-btn:hover { transform: translateY(-3px); }
.control-btn.secondary { width: 48px; height: 48px; font-size: 1.1rem; background: rgba(255, 255, 255, 0.05); color: white; border: 1px solid var(--panel-border); border-radius: 15px;}
.control-btn.secondary:hover { background: rgba(255, 255, 255, 0.1); }

/* Alerts */
.coin-income-alert { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2rem; font-weight: 700; color: #FFD700; opacity: 0; pointer-events: none; z-index: 10; }
.coin-income-alert.show { animation: floatUp 2s ease-out forwards; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 0); } 10% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -40px); } }

/* Tasks - Fills remaining left column space */
.task-panel { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.task-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.task-header h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted);}
.pomodoro-count { background: rgba(255, 255, 255, 0.05); color: var(--text-main); padding: 0.3rem 0.8rem; border-radius: 10px; font-size: 0.8rem; font-weight: 600; }
.task-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-shrink: 0;}
.task-form input { flex: 1; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--panel-border); padding: 1rem; border-radius: 14px; color: white; font-family: inherit; font-size: 0.95rem; }
.add-task-btn { width: 50px; background: rgba(255,255,255,0.1); border: 1px solid var(--panel-border); border-radius: 14px; color: white; cursor: pointer; transition: 0.2s;}
.add-task-btn:hover { background: white; color: black; }
.task-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; overflow-y: auto; padding-right: 0.5rem; flex: 1; }
.task-list::-webkit-scrollbar { width: 4px; } .task-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 5px; }
.task-item { background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border); padding: 1rem; border-radius: 14px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: 0.2s;}
.task-item:hover { background: rgba(255,255,255,0.08); }
.task-item.completed .task-text { text-decoration: line-through; color: var(--text-muted); opacity: 0.5; }
.task-content { display: flex; align-items: center; gap: 1rem; flex: 1; }
.check-circle { width: 22px; height: 22px; border: 2px solid var(--text-muted); border-radius: 50%; display: flex; justify-content: center; align-items: center; color: transparent; font-size: 0.7rem; transition: 0.2s;}
.task-item.completed .check-circle { background: var(--success); border-color: var(--success); color: #000; }
.delete-task { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem;}
.delete-task:hover { color: #F43F5E; }

/* Right Column: Clean Virtual Room */
.room-panel { display: flex; flex-direction: column; height: 100%; border: none; }
.room-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding: 0 1rem;}
.room-header h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.room-stats { color: var(--text-main); font-size: 0.85rem; font-weight: 600; background: rgba(255,255,255,0.05); padding: 0.4rem 1rem; border-radius: 10px;}
.room-container { flex: 1; background: rgba(0, 0, 0, 0.4); border-radius: 24px; position: relative; overflow: hidden; display: flex; justify-content: center; align-items: center; padding: 2rem; border: 1px solid var(--panel-border);}

/* The room layout */
.virtual-room {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: 
        linear-gradient(to bottom, #1E232B 0%, #15181F 35%, transparent 35%),
        repeating-linear-gradient(90deg, #3A2922, #3A2922 40px, #2E201B 42px, #2E201B 42px) 0 35% / 100% 65% no-repeat;
}

.virtual-room.level-1 { width: 50%; height: 50%; border-radius: 16px; }
.virtual-room.level-2 { width: 70%; height: 70%; border-radius: 20px; }
.virtual-room.level-3 { width: 90%; height: 90%; border-radius: 24px; }

.drag-hint { position: absolute; top: 60%; left: 50%; transform: translate(-50%, -50%); color: rgba(255,255,255,0.3); text-align: center; width: 80%; z-index: 0; pointer-events: none; font-size: 1.1rem; font-weight: 300;}

/* Room Draggable Items */
.room-item { position: absolute; font-size: 4.5rem; cursor: grab; user-select: none; transition: filter 0.2s, transform 0.2s; display: flex; justify-content: center; align-items: center; }
.room-item.z-low { z-index: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));}
.room-item:not(.z-low) { z-index: 5; filter: drop-shadow(0 15px 15px rgba(0,0,0,0.4)); }
.room-item:active { cursor: grabbing; transform: scale(1.05) !important; filter: drop-shadow(0 25px 25px rgba(0,0,0,0.3)) !important;}

/* Item Animations */
.anim-sway { transform-origin: bottom center; animation: sway 4s infinite ease-in-out; }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.anim-glow { animation: glow 2.5s infinite alternate ease-in-out; }
@keyframes glow { 0% { filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.2)); } 100% { filter: drop-shadow(0 0 25px rgba(0, 255, 255, 0.6)); } }
.anim-breathe { transform-origin: bottom center; animation: breathe 3.5s infinite ease-in-out; }
@keyframes breathe { 0%, 100% { transform: scaleY(1) scaleX(1); } 50% { transform: scaleY(1.03) scaleX(1.02); } }

/* Modals */
.overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(5,5,5,0.9); backdrop-filter: blur(10px); display: flex; justify-content: center; align-items: center; z-index: 100; opacity: 0; pointer-events: none; transition: 0.3s; }
.overlay.active { opacity: 1; pointer-events: all; }

.modal { width: 650px; max-width: 90%; background: #111318; border: 1px solid var(--panel-border); max-height: 85vh; display: flex; flex-direction: column; border-radius: 24px; padding: 2rem;}
.settings-modal { width: 450px; height: auto; }

.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 1.5rem; margin-bottom: 1.5rem; }
.modal-header h2 { font-size: 1.4rem; font-weight: 600; display: flex; gap: 0.8rem; align-items: center;}
.icon-btn { background: rgba(255,255,255,0.05); border: none; color: white; width: 40px; height: 40px; border-radius: 12px; font-size: 1.2rem; cursor: pointer; transition: 0.2s;}
.icon-btn:hover { background: rgba(255,255,255,0.1); color: #F43F5E;}

/* Settings Form */
.settings-form { display: flex; flex-direction: column; gap: 1.5rem; }
.settings-form label { display: flex; flex-direction: column; gap: 0.8rem; color: var(--text-muted); font-size: 0.95rem; }
.settings-form input { background: rgba(0,0,0,0.5); border: 1px solid var(--panel-border); padding: 1rem; border-radius: 12px; color: white; font-family: inherit; font-size: 1rem; transition: 0.2s;}
.settings-form input:focus { border-color: rgba(255,255,255,0.3); outline: none;}
.settings-form .action-btn { margin-top: 1rem; justify-content: center; background: white; color: black; box-shadow: none;}
.settings-form .action-btn:hover { background: #e0e0e0; transform: none;}

/* Shop Modal */
.shop-tabs { display: flex; gap: 1rem; margin-bottom: 1.5rem; background: rgba(0,0,0,0.3); padding: 0.5rem; border-radius: 16px;}
.shop-tab { flex: 1; background: transparent; border: none; color: var(--text-muted); padding: 0.8rem; border-radius: 12px; cursor: pointer; transition: 0.3s; font-weight: 600; font-family: inherit; font-size: 0.95rem;}
.shop-tab.active { background: rgba(255,255,255,0.1); color: white; }
.modal-content { overflow-y: auto; max-height: 50vh; padding-right: 0.5rem; }
.modal-content::-webkit-scrollbar { width: 4px; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.shop-item-card { background: rgba(0,0,0,0.3); border: 1px solid var(--panel-border); border-radius: 16px; padding: 1.5rem 1rem; text-align: center; transition: 0.3s; }
.shop-item-card:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.03); transform: translateY(-3px); }
.shop-item-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.shop-item-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 1rem; color: #E0E2E5;}
.buy-btn { width: 100%; background: transparent; border: 1px solid #FFD700; color: #FFD700; padding: 0.6rem; border-radius: 10px; font-weight: 600; cursor: pointer; transition: 0.2s; font-family: inherit; }
.buy-btn:hover:not(:disabled) { background: #FFD700; color: #000; }
.buy-btn:disabled { border-color: var(--panel-border); color: var(--text-muted); cursor: not-allowed; opacity: 0.5; background: transparent; }

/* Celebration */
.celebration-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0, 0.9); backdrop-filter: blur(15px); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; pointer-events: none; transition: 0.5s; }
.celebration-overlay.active { opacity: 1; pointer-events: all; }
.celebration-content { text-align: center; transform: scale(0.8); transition: 0.5s; max-width: 400px; width: 90%; background: transparent; border: none; box-shadow: none;}
.celebration-overlay.active .celebration-content { transform: scale(1); }
.celebration-content h2 { font-size: 3rem; margin-bottom: 1rem; color: white; letter-spacing: -1px; }
.event-icon { font-size: 6rem; margin-bottom: 2rem; animation: bounce 2s infinite cubic-bezier(0.28, 0.84, 0.42, 1); }
.trophy-icon { color: #FFD700; filter: drop-shadow(0 10px 30px rgba(255, 215, 0, 0.3)); }
.item-bought-icon { filter: drop-shadow(0 10px 30px rgba(255, 255, 255, 0.2)); }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
.celebration-content p { font-size: 1.2rem; margin-bottom: 2.5rem; color: var(--text-muted); }
#close-celebration { width: 100%; padding: 1.2rem; font-size: 1.1rem; border-radius: 16px; background: white; color: black; font-weight: 700; border: none;}
#close-celebration:hover { opacity: 0.9; }
