/* Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:'Poppins',sans-serif;
}

body{
  min-height:100vh;
  background:linear-gradient(135deg,#eef2ff,#f8fafc);
  color:#111827;
  transition:.3s;
}

body.dark{
  background:#0f172a;
  color:white;
}

.hidden{
  display:none;
}

/* Login */
.login-screen{
  height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#2563eb,#7c3aed);
}

.login-card{
  width:420px;
  max-width:90%;
  padding:40px;
  border-radius:25px;
  text-align:center;
  color:white;
  background:rgba(255,255,255,.15);
  backdrop-filter:blur(18px);
  box-shadow:0 20px 60px rgba(0,0,0,.25);
}

.login-card h1{
  margin-bottom:12px;
  font-size:34px;
}

.login-card p{
  margin-bottom:24px;
  opacity:.9;
}

.login-card input{
  width:100%;
  padding:16px;
  border:none;
  outline:none;
  border-radius:14px;
  margin-bottom:14px;
  font-size:15px;
}

.login-card button{
  width:100%;
  padding:15px;
  border:none;
  border-radius:14px;
  background:white;
  color:#2563eb;
  font-weight:700;
  cursor:pointer;
  transition:.25s;
}

.login-card button:hover{
  transform:translateY(-2px);
}

/* App */
.app{
  display:flex;
  min-height:100vh;
}

/* Sidebar */
.sidebar{
  width:260px;
  padding:30px 20px;
  background:rgba(255,255,255,.75);
  backdrop-filter:blur(18px);
  border-right:1px solid rgba(255,255,255,.35);
  box-shadow:0 0 25px rgba(0,0,0,.08);
}

body.dark .sidebar{
  background:#111827;
  border-right:1px solid #1f2937;
}

.sidebar h2{
  color:#2563eb;
  margin-bottom:35px;
}

.sidebar ul{
  list-style:none;
}

.sidebar li{
  padding:14px 16px;
  margin:8px 0;
  border-radius:12px;
  cursor:pointer;
  transition:.25s;
  font-weight:500;
}

.sidebar li:hover,
.sidebar li.active{
  background:#2563eb;
  color:white;
}

#themeBtn{
  width:100%;
  margin-top:20px;
  padding:12px;
  border:none;
  border-radius:12px;
  background:#111827;
  color:white;
  cursor:pointer;
  font-weight:600;
}

body.dark #themeBtn{
  background:#2563eb;
}

/* Main */
.main{
  flex:1;
  padding:35px;
}

/* Topbar */
.topbar{
  display:flex;
  justify-content:space-between;
  gap:20px;
  margin-bottom:30px;
}

.topbar h1{
  font-size:34px;
  margin-bottom:8px;
}

.topbar p{
  color:#6b7280;
}

body.dark .topbar p{
  color:#cbd5e1;
}

/* Profile */
.profile-card{
  min-width:230px;
  text-align:center;
  padding:22px;
  border-radius:22px;
  background:white;
  box-shadow:0 10px 30px rgba(0,0,0,.08);
}

body.dark .profile-card{
  background:#111827;
}

.profile-card img{
  width:90px;
  height:90px;
  border-radius:50%;
  margin-bottom:10px;
}

.profile-card h3{
  color:#2563eb;
  margin-bottom:8px;
}

/* Pages */
.page{
  display:none;
}

.active-page{
  display:block;
}

/* Stats */
.stats-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:22px;
  margin-bottom:25px;
}

.stat-card{
  text-align:center;
  padding:28px;
  border-radius:22px;
  background:white;
  box-shadow:0 10px 30px rgba(0,0,0,.08);
  transition:.25s;
}

.stat-card:hover{
  transform:translateY(-5px);
}

body.dark .stat-card{
  background:#111827;
}

.stat-card h3{
  margin-bottom:10px;
  color:#6b7280;
}

body.dark .stat-card h3{
  color:#cbd5e1;
}

.stat-card h2{
  color:#2563eb;
  font-size:34px;
}

/* Progress */
.progress-box,
.badge-box,
.settings-box,
canvas,
.shop-card{
  background:white;
  padding:24px;
  border-radius:22px;
  box-shadow:0 10px 30px rgba(0,0,0,.08);
}

body.dark .progress-box,
body.dark .badge-box,
body.dark .settings-box,
body.dark canvas,
body.dark .shop-card{
  background:#111827;
}

.progress-box{
  margin-bottom:25px;
}

.progress-bar{
  height:18px;
  background:#dbeafe;
  border-radius:999px;
  overflow:hidden;
  margin-top:12px;
}

#progressFill{
  width:0%;
  height:100%;
  background:linear-gradient(90deg,#2563eb,#7c3aed);
  border-radius:999px;
  transition:.4s;
}

/* Badges */
.badge-container{
  margin-top:15px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.badge-container span{
  padding:10px 16px;
  border-radius:999px;
  background:#2563eb;
  color:white;
  font-weight:600;
}

/* Form */
.habit-form{
  display:grid;
  grid-template-columns:2fr 1fr 1fr auto;
  gap:16px;
  margin:25px 0;
}

input,
select,
button{
  padding:14px;
  border:none;
  border-radius:14px;
  outline:none;
  font-size:15px;
}

input,
select{
  background:white;
  box-shadow:0 6px 20px rgba(0,0,0,.06);
}

body.dark input,
body.dark select{
  background:#111827;
  color:white;
}

button{
  background:#2563eb;
  color:white;
  cursor:pointer;
  font-weight:600;
  transition:.25s;
}

button:hover{
  transform:translateY(-2px);
}

/* Habit List */
#habitList{
  list-style:none;
}

#habitList li{
  margin:14px 0;
  padding:18px 22px;
  border-radius:18px;
  background:white;
  box-shadow:0 6px 20px rgba(0,0,0,.06);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

body.dark #habitList li{
  background:#111827;
}

/* Heatmap */
.heatmap{
  display:grid;
  grid-template-columns:repeat(10,42px);
  gap:10px;
}

.heatmap div{
  width:42px;
  height:42px;
  border-radius:10px;
  background:#cbd5e1;
}

.heatmap .active{
  background:#22c55e;
}

/* Shop */
.shop-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:20px;
}

.shop-card{
  text-align:center;
  font-weight:600;
  cursor:pointer;
  transition:.25s;
}

.shop-card:hover{
  transform:scale(1.04);
}

/* Settings */
.settings-box{
  display:flex;
  gap:15px;
  flex-wrap:wrap;
}

/* Responsive */
@media(max-width:900px){
  .app{
    flex-direction:column;
  }

  .sidebar{
    width:100%;
  }

  .topbar{
    flex-direction:column;
  }

  .habit-form{
    grid-template-columns:1fr;
  }

  .heatmap{
    grid-template-columns:repeat(5,42px);
  }
}