/* --- Root Variables & Themes --- */
:root {
    --bg: #0b0e14;
    --sidebar: #11141d;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --primary: #6c5ce7;
    --text: #ffffff;
    --snow-color: #ffffff;
}

body.light-mode {
    --bg: #f5f6fa;
    --sidebar: #ffffff;
    --glass: rgba(255, 255, 255, 0.9);
    --border: rgba(0, 0, 0, 0.05);
    --text: #2d3436;
}

body { 
    margin: 0; 
    font-family: 'Inter', sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    transition: 0.5s; 
    overflow-x: hidden; 
}

#bgImageOverlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; background-size: cover; background-position: center;
    background-repeat: no-repeat; display: none; transition: background 0.5s ease-in-out;
}

.layout { display: flex; min-height: 100vh; transition: opacity 0.5s ease; position: relative; z-index: 10; }
.layout.low-opacity { opacity: 0.8; }

/* --- Sidebar --- */
.sidebar { 
    width: 250px; 
    background: var(--sidebar); 
    padding: 30px 15px; 
    border-right: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
}

.sidebar-top h2 { font-size: 1.5rem; margin-bottom: 30px; }
.sidebar-top h2 span { color: var(--primary); }

.nav-menu { flex: 1; }
.nav-item { 
    width: 100%;
    background: transparent; 
    border: none; 
    color: var(--text); 
    padding: 12px 15px; 
    border-radius: 12px; 
    margin: 4px 0; 
    text-align: left; 
    cursor: pointer; 
    transition: 0.2s; 
    display: flex; 
    align-items: center; 
    gap: 12px;
}

.nav-item.active, .nav-item:hover { background: var(--primary); color: white; }
.divider { font-size: 11px; opacity: 0.4; margin: 20px 0 10px 10px; font-weight: bold; }

.bg-control-btn { 
    background: rgba(108, 92, 231, 0.15); color: var(--primary); 
    border: 1px solid var(--primary); padding: 12px; border-radius: 12px; 
    cursor: pointer; font-weight: bold; 
}
.reset-btn { border-color: #ff4757; color: #ff4757; background: rgba(255, 71, 87, 0.1); }
.reset-btn:hover { background: #ff4757; color: white; }

/* --- Theme Toggle --- */
.theme-switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.theme-switch input { display: none; }
.slider-toggle { 
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; 
    background: #333; border-radius: 34px; transition: 0.4s; 
    display: flex; align-items: center; justify-content: space-around;
}
.slider-toggle:before { 
    position: absolute; content: ""; height: 20px; width: 20px; 
    left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.4s; 
}
input:checked + .slider-toggle:before { transform: translateX(24px); }

/* --- Main Content --- */
.content { flex: 1; padding: 40px; }
.glass { background: var(--glass); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 20px; padding: 25px; margin-bottom: 20px; }
.page { display: none; animation: slideUp 0.4s ease; }
.page.active { display: block; }

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

input { 
    width: 100%; padding: 12px; margin: 8px 0; border-radius: 10px; 
    border: 1px solid var(--border); background: rgba(255,255,255,0.05); 
    color: var(--text); outline: none;
}
.run-btn { 
    width: 100%; padding: 12px; border: none; border-radius: 10px; 
    background: var(--primary); color: white; font-weight: bold; cursor: pointer;
}
.result-area { 
    margin-top: 20px; padding: 15px; border-radius: 12px; 
    background: rgba(0,0,0,0.3); border-left: 4px solid var(--primary); 
    color: #00ffaa; font-family: monospace; font-weight: bold; 
}

/* --- Calculator --- */
.calc-container { max-width: 320px; margin: 0 auto; }
.calc-screen { font-size: 2.2rem; text-align: right; padding: 20px; background: rgba(0,0,0,0.3); border-radius: 15px; margin-bottom: 15px; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.calc-grid button { padding: 20px; border-radius: 12px; border: none; background: var(--glass); color: var(--text); cursor: pointer; }
.btn-op { color: var(--primary) !important; }
.btn-equal { background: var(--primary) !important; color: white !important; grid-row: span 2; }

/* --- Todo --- */
.todo-item { 
    background: var(--glass); padding: 15px; border-radius: 12px; 
    margin-bottom: 10px; display: flex; justify-content: space-between; 
    align-items: center; border: 1px solid var(--border); 
}
.delete-btn { background: #ff4757; color: white; border: none; padding: 5px 10px; border-radius: 6px; }

/* --- Success Popup --- */
.success-popup { 
    position: fixed; top: 20px; right: 20px; background: var(--primary); 
    color: white; padding: 12px 25px; border-radius: 10px; 
    opacity: 0; transition: 0.5s; z-index: 1000; 
}
.success-popup.show { opacity: 1; }

/* --- UPDATED PROFILE SECTION --- */
.profile-container { 
    text-align: center; 
    max-width: 500px; 
    margin: 0 auto; 
}

.profile-img-wrapper { 
    position: relative; 
    width: 160px; 
    height: 160px; 
    margin: 0 auto 20px; 
}

#profilePic { 
    width: 100%; 
    height: 100%; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 4px solid var(--primary); 
    cursor: pointer; 
    transition: transform 0.3s ease; 
}

#profilePic:hover { 
    transform: scale(1.05); 
}

.change-profile-btn { 
    position: absolute; 
    bottom: 5px; 
    right: 5px; 
    background: var(--primary); 
    color: white; 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    border: none;
}

.profile-info-footer {
    margin-top: 20px;
}

.profile-title {
    color: var(--primary);
    font-size: 1.6rem;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.profile-details p {
    margin: 8px 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* --- IMAGE MODAL (ZOOM) --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    padding-top: 80px; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(8px);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 500px;
    border-radius: 20px;
    border: 2px solid var(--primary);
    animation: zoomEffect 0.3s ease-out;
}

@keyframes zoomEffect {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* --- PARTICLES --- */
.snow-container { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    pointer-events: none; z-index: 1; 
}

.particle { 
    position: absolute; top: -20px; background: var(--snow-color); 
    border-radius: 50%; opacity: 0.8; animation: fall linear infinite; 
    box-shadow: 0 0 8px var(--snow-color); 
}

.light-mode .particle:nth-child(3n+1) { --snow-color: #39FF14; box-shadow: 0 0 15px #39FF14; }
.light-mode .particle:nth-child(3n+2) { --snow-color: #FFFF00; box-shadow: 0 0 15px #FFFF00; }
.light-mode .particle:nth-child(3n+3) { --snow-color: #FF3131; box-shadow: 0 0 15px #FF3131; }

.particle:nth-child(1) { left: 5%; width: 6px; height: 6px; animation-duration: 7s; }
.particle:nth-child(2) { left: 15%; width: 4px; height: 4px; animation-duration: 10s; animation-delay: 1s; }
.particle:nth-child(3) { left: 25%; width: 8px; height: 8px; animation-duration: 8s; animation-delay: 2s; }
.particle:nth-child(4) { left: 35%; width: 5px; height: 5px; animation-duration: 12s; }
.particle:nth-child(5) { left: 45%; width: 7px; height: 7px; animation-duration: 9s; animation-delay: 3s; }
.particle:nth-child(6) { left: 55%; width: 4px; height: 4px; animation-duration: 11s; }
.particle:nth-child(7) { left: 65%; width: 6px; height: 6px; animation-duration: 7.5s; animation-delay: 1s; }
.particle:nth-child(8) { left: 75%; width: 9px; height: 9px; animation-duration: 13s; }
.particle:nth-child(9) { left: 85%; width: 5px; height: 5px; animation-duration: 10s; animation-delay: 4s; }
.particle:nth-child(10) { left: 95%; width: 7px; height: 7px; animation-duration: 9s; }

@keyframes fall {
    0% { transform: translateY(0); }
    100% { transform: translateY(110vh); }
}