/* New font for whole site */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root{
  --bg-light:#f3f4f6;
  --bg-card-light:#ffffff;
  --sidebar-light:#ffffff;
  --text-light:#0f172a;
  --muted-light:#6b7280;

  --bg-dark:#020617;
  --bg-card-dark:rgba(15,23,42,0.96);
  --sidebar-dark:rgba(15,23,42,0.98);
  --text-dark:#e5e7eb;
  --muted-dark:#9ca3af;

  --accent:#22c55e;
  --accent-soft:rgba(34,197,94,0.15);
  --accent-strong:#16a34a;
  --radius-xl:18px;
  --shadow-soft:0 18px 40px rgba(15,23,42,0.35);
}
*{box-sizing:border-box;margin:0;padding:0;}
body{
  font-family:'Poppins',system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  min-height:100vh;
  background:var(--bg-light);
  color:var(--text-light);
}
body.dark{
  background:
    radial-gradient(circle at top,rgba(56,189,248,0.15),transparent 55%),
    radial-gradient(circle at bottom,rgba(34,197,94,0.18),transparent 55%),
    var(--bg-dark);
  color:var(--text-dark);
}
a{text-decoration:none;color:inherit;}
ul{list-style:none;padding:0;margin:0;}

/* make all form controls & buttons use Poppins clearly */
.form-group input,
.form-group textarea,
.form-control,
button,
.btn,
.btn-small{
  font-family:'Poppins',system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

/* AUTH */
.auth-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:2rem;
}
.auth-container{
  max-width:960px;
  width:100%;
  display:grid;
  grid-template-columns:1.1fr 1fr;
  gap:2rem;
}
@media(max-width:800px){ .auth-container{grid-template-columns:1fr;} }
.auth-card{
  border-radius:var(--radius-xl);
  padding:2.2rem 2.6rem;
  box-shadow:var(--shadow-soft);
  border:1px solid rgba(148,163,184,0.25);
  background:#ffffff;
}
body.dark .auth-card{
  background:rgba(15,23,42,0.9);
}
.auth-header{text-align:center;margin-bottom:1.8rem;}
.auth-header i{font-size:2.4rem;color:var(--accent);margin-bottom:.6rem;}
.auth-header h1{font-weight:700;font-size:1.9rem;margin-bottom:.3rem;}
.auth-header p{font-size:.9rem;color:var(--muted-light);}
body.dark .auth-header p{color:var(--muted-dark);}

.auth-tabs{
  display:flex;
  margin-bottom:1.3rem;
  border-radius:999px;
  padding:0.2rem;
  background:#f3f4f6;
}
body.dark .auth-tabs{background:rgba(15,23,42,0.85);border:1px solid rgba(148,163,184,0.35);}
.auth-tabs .tab-btn{
  flex:1;
  border:none;
  background:transparent;
  font-size:.9rem;
  padding:.6rem 0;
  border-radius:999px;
  cursor:pointer;
  color:var(--muted-light);
}
body.dark .auth-tabs .tab-btn{color:var(--muted-dark);}
.auth-tabs .tab-btn.active{
  background:var(--accent-soft);
  color:var(--accent-strong);
}
.auth-form{display:none;}
.auth-form.active{display:block;}

.form-group{margin-bottom:1rem;}
.form-group label{
  display:block;
  font-size:.8rem;
  margin-bottom:.35rem;
  color:var(--muted-light);
}
body.dark .form-group label{color:var(--muted-dark);}
.form-group input,
.form-group textarea,
.form-control{
  width:100%;
  border-radius:12px;
  border:1px solid rgba(148,163,184,0.4);
  padding:.65rem .8rem;
  font-size:.9rem;
  outline:none;
  background:#f9fafb;
  color:var(--text-light);
}
body.dark .form-group input,
body.dark .form-group textarea,
body.dark .form-control{
  background:rgba(15,23,42,0.8);
  color:var(--text-dark);
  border-color:rgba(148,163,184,0.4);
}
.form-group textarea{
  resize:vertical;
  min-height:130px;
  /* nicer reading for notes */
  line-height:1.6;
  font-size:.92rem;
}
.form-group input:focus,
.form-group textarea:focus,
.form-control:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 1px rgba(34,197,94,.25);
}

.btn,.btn-small{
  border:none;
  border-radius:999px;
  padding:.6rem 1.1rem;
  font-size:.85rem;
  font-weight:500;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  justify-content:center;
  transition:background .18s,box-shadow .18s,transform .12s;
  white-space:nowrap;
}
.btn-primary{
  background:linear-gradient(135deg,#22c55e,#16a34a);
  color:white;
  box-shadow:0 12px 25px rgba(34,197,94,.35);
}
.btn-primary:hover{transform:translateY(-1px);box-shadow:0 16px 35px rgba(34,197,94,.45);}
.btn-secondary{
  background:#e5e7eb;
  color:#111827;
}
body.dark .btn-secondary{
  background:rgba(148,163,184,0.2);
  color:var(--text-dark);
}
.btn-small{
  padding:.4rem .7rem;
  font-size:.8rem;
  background:#e5e7eb;
  color:#111827;
}
body.dark .btn-small{
  background:rgba(15,23,42,0.85);
  color:var(--muted-dark);
  border:1px solid rgba(148,163,184,0.35);
}
.btn-small:hover{
  transform:translateY(-1px);
}
.btn-danger{background:#fee2e2;color:#b91c1c;}
body.dark .btn-danger{background:rgba(239,68,68,0.15);color:#fecaca;border:1px solid rgba(248,113,113,0.6);}

.alert{
  border-radius:12px;
  padding:.6rem .75rem;
  font-size:.8rem;
  margin-bottom:.8rem;
  display:flex;
  align-items:flex-start;
  gap:.4rem;
}
.alert-error{background:#fee2e2;color:#b91c1c;}
.alert-success{background:#dcfce7;color:#166534;}
body.dark .alert-error{
  background:rgba(239,68,68,0.15);
  color:#fecaca;
  border:1px solid rgba(248,113,113,0.7);
}
body.dark .alert-success{
  background:rgba(34,197,94,0.15);
  color:#bbf7d0;
  border:1px solid rgba(34,197,94,0.7);
}

/* APP LAYOUT */
.app-container{display:flex;min-height:100vh;}
.sidebar{
  width:250px;
  padding:1.3rem 1.1rem;
  background:var(--sidebar-light);
  border-right:1px solid #e5e7eb;
}
body.dark .sidebar{
  background:var(--sidebar-dark);
  border-color:rgba(30,64,175,0.35);
}
.sidebar-header{
  display:flex;
  align-items:center;
  gap:.6rem;
  margin-bottom:1.4rem;
}
.sidebar-header h2{font-size:1.3rem;font-weight:700;}
.sidebar-header i{color:var(--accent);}
.nav-menu{display:flex;flex-direction:column;gap:.15rem;}
.nav-link{
  display:flex;
  align-items:center;
  gap:.6rem;
  padding:.55rem .6rem;
  border-radius:10px;
  color:var(--muted-light);
  font-size:.9rem;
}
body.dark .nav-link{color:var(--muted-dark);}
.nav-link i{width:18px;text-align:center;}
.nav-link:hover{
  background:rgba(59,130,246,0.08);
  color:#1d4ed8;
}
body.dark .nav-link:hover{
  background:rgba(30,64,175,0.7);
  color:white;
}
.nav-link.active{
  background:var(--accent-soft);
  color:var(--accent-strong);
}

.main-content{flex:1;display:flex;flex-direction:column;max-width:100%;}
.top-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:1rem 1.5rem;
  border-bottom:1px solid #e5e7eb;
  background:#ffffff;
  position:sticky;
  top:0;
  z-index:20;
}
body.dark .top-header{
  background:rgba(15,23,42,0.9);
  border-color:rgba(30,64,175,0.35);
}
.header-left{display:flex;align-items:center;gap:.75rem;}
.header-left h1{font-size:1.1rem;font-weight:600;}
.menu-toggle{
  display:none;
  background:none;
  border:none;
  font-size:1.25rem;
  cursor:pointer;
}
.header-right{display:flex;align-items:center;gap:.6rem;font-size:.85rem;}
.user-info{display:flex;align-items:center;gap:.35rem;color:var(--muted-light);}
body.dark .user-info{color:var(--muted-dark);}
.user-info i{color:var(--accent);}
.theme-btn,.logout-btn{
  background:#f3f4f6;
  border-radius:999px;
  padding:.35rem .6rem;
  border:1px solid #e5e7eb;
  font-size:.8rem;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:.35rem;
}
body.dark .theme-btn,body.dark .logout-btn{
  background:rgba(15,23,42,0.9);
  border-color:rgba(148,163,184,0.35);
  color:var(--muted-dark);
}

.content-wrapper{
  padding:1.6rem 1.5rem 2.5rem;
  max-width:1200px;
  margin:0 auto;
  width:100%;
}
.page-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  margin-bottom:1rem;
  gap:1rem;
}
.page-header h2{font-size:1.4rem;font-weight:600;}
.page-header .text-muted{font-size:.8rem;color:var(--muted-light);}
body.dark .page-header .text-muted{color:var(--muted-dark);}

.dashboard-grid,
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:1.1rem;
}

.card{
  border-radius:var(--radius-xl);
  padding:1.1rem 1.2rem;
  border:1px solid #e5e7eb;
  background:var(--bg-card-light);
  box-shadow:var(--shadow-soft);
}
body.dark .card{
  background:var(--bg-card-dark);
  border-color:rgba(30,64,175,0.45);
}
.card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem;}
.card-title{font-size:.95rem;font-weight:600;display:flex;align-items:center;gap:.4rem;}
.card-title i{color:var(--accent);}

.stat-card{display:flex;align-items:center;gap:.75rem;}
.stat-icon{
  width:40px;height:40px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.1rem;
  background:#e5f9ec;
  color:#16a34a;
}
body.dark .stat-icon{background:rgba(34,197,94,0.12);color:#4ade80;}
.stat-content h3{font-size:1.3rem;margin-bottom:.1rem;}
.stat-label{font-size:.82rem;color:var(--muted-light);}
body.dark .stat-label{color:var(--muted-dark);}

.quote-content{padding:.4rem 0 .7rem;}
.quote-text{font-size:.95rem;line-height:1.5;}
.quote-author{font-size:.8rem;color:var(--muted-light);margin-top:.4rem;}
body.dark .quote-author{color:var(--muted-dark);}

.zikir-content .zikir-text{
  padding:.4rem 0;
  border-bottom:1px dashed rgba(148,163,184,0.5);
  font-size:.86rem;
}

.task-list{display:flex;flex-direction:column;gap:.4rem;}
.task-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:.6rem .7rem;
  border-radius:12px;
  border:1px solid #e5e7eb;
  background:#f9fafb;
}
body.dark .task-item{
  background:rgba(15,23,42,0.85);
  border-color:rgba(31,41,55,0.9);
}
.task-info h4{font-size:.9rem;margin-bottom:.15rem;}
.task-date{font-size:.78rem;color:var(--muted-light);display:flex;align-items:center;gap:.25rem;}
body.dark .task-date{color:var(--muted-dark);}
.status-badge{
  font-size:.72rem;
  padding:.15rem .45rem;
  border-radius:999px;
  border:1px solid rgba(148,163,184,0.6);
}
.status-completed{border-color:rgba(34,197,94,0.8);color:#15803d;background:#dcfce7;}
.status-pending{border-color:rgba(249,115,22,0.7);color:#c2410c;background:#ffedd5;}

.health-tip-card h3,
.health-tip-featured h3{font-size:1rem;margin-bottom:.3rem;}
.health-tip-card p,
.health-tip-featured p{font-size:.86rem;color:var(--muted-light);}
body.dark .health-tip-card p,
body.dark .health-tip-featured p{color:var(--muted-dark);}

/* NOTE CARD – tweak for readability */
.note-card-full{
  border-radius:16px;
  padding:.8rem .9rem;
  border:1px solid #e5e7eb;
  background:#f9fafb;
  margin-bottom:.5rem;
}
body.dark .note-card-full{
  background:rgba(15,23,42,0.92);
  border-color:rgba(31,41,55,0.9);
}
.note-header{display:flex;align-items:flex-start;justify-content:space-between;gap:.6rem;margin-bottom:.4rem;}
.note-header h3{font-size:.98rem;margin-bottom:.15rem;}
.note-date{font-size:.76rem;color:var(--muted-light);}
body.dark .note-date{color:var(--muted-dark);}
.note-content{
  font-size:.9rem;
  line-height:1.65;
  white-space:pre-wrap;
}

/* media inside notes */
.note-media img{
  border-radius:10px;
  margin-top:.4rem;
}
.note-media audio{
  margin-top:.3rem;
  width:100%;
}

.prayer-times-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:.6rem;
}
.prayer-card{
  border-radius:14px;
  padding:.7rem .8rem;
  border:1px solid #e5e7eb;
  background:#f9fafb;
}
body.dark .prayer-card{
  background:rgba(15,23,42,0.9);
  border-color:rgba(30,64,175,0.5);
}
.prayer-card.completed{
  border-color:rgba(34,197,94,0.8);
  box-shadow:0 0 0 1px rgba(34,197,94,0.4);
}
.prayer-header{display:flex;align-items:center;justify-content:space-between;}

.progress-container{margin-top:.5rem;font-size:.78rem;color:var(--muted-light);}
body.dark .progress-container{color:var(--muted-dark);}
.progress-bar{
  width:100%;
  border-radius:999px;
  height:6px;
  overflow:hidden;
  margin-bottom:.2rem;
  background:#e5e7eb;
}
body.dark .progress-bar{background:rgba(15,23,42,0.95);border:1px solid rgba(30,64,175,0.55);}
.progress-fill{
  height:100%;
  background:linear-gradient(90deg,#22c55e,#16a34a);
  width:0%;
  transition:width .25s ease-out;
}

.empty-state{
  text-align:center;
  padding:1.2rem .7rem;
  color:var(--muted-light);
  font-size:.85rem;
}
body.dark .empty-state{color:var(--muted-dark);}
.empty-state i{font-size:1.6rem;display:block;margin-bottom:.3rem;color:#9ca3af;}

.form-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:.8rem;
  margin-bottom:.9rem;
}
.form-inline{display:flex;gap:.6rem;align-items:center;margin:.7rem 0;flex-wrap:wrap;}
.notes-grid-full{margin-top:.4rem;}
.quran-content{margin-bottom:.7rem;}
.quran-arabic{font-size:1.2rem;margin-bottom:.4rem;direction:rtl;text-align:right;}
.quran-translation{font-size:.9rem;color:var(--muted-light);}
body.dark .quran-translation{color:var(--muted-dark);}

/* Calendar simple grid */
.calendar-grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:.4rem;
  margin-top:.8rem;
  font-size:.8rem;
}
.calendar-day-header{font-weight:600;text-align:center;color:var(--muted-light);}
body.dark .calendar-day-header{color:var(--muted-dark);}
.calendar-cell{
  min-height:55px;
  border-radius:10px;
  padding:.25rem .35rem;
  border:1px solid #e5e7eb;
  background:#f9fafb;
}
body.dark .calendar-cell{
  background:rgba(15,23,42,0.9);
  border-color:rgba(31,41,55,0.9);
}
.calendar-cell.has-task{
  border-color:var(--accent);
}
.calendar-date{font-weight:600;font-size:.8rem;margin-bottom:.15rem;}
.calendar-tag{font-size:.7rem;color:var(--muted-light);}
body.dark .calendar-tag{color:var(--muted-dark);}

@media(max-width:900px){
  .sidebar{
    position:fixed;
    left:-260px;
    top:0;
    height:100vh;
    z-index:30;
    transition:left .22s;
  }
  .sidebar.open{left:0;}
  .menu-toggle{display:inline-flex;}
  .content-wrapper{padding:1.2rem 1rem 1.8rem;}
}


/* ================================
   SIDEBAR OVERLAY + CLOSE BUTTON
================================ */
.sidebar-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.45);
  z-index:29;
}
.sidebar-overlay.show{
  display:block;
}

.sidebar-close{
  display:none;
  background:none;
  border:none;
  font-size:1.2rem;
  cursor:pointer;
  color:#6b7280;
}

/* MOBILE SIDEBAR FIX */
@media(max-width:900px){
  .sidebar{
    position:fixed;
    left:-260px;
    top:0;
    height:100vh;
    z-index:30;
    transition:left .25s ease;
  }
  .sidebar.open{ left:0; }

  .sidebar-close{
    display:inline-flex;
  }
}


/* ===== Notes media FIX ===== */

.note-card-full{
  overflow:hidden; /* prevent image overflow */
}

/* image gallery */
.note-images-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(120px,1fr));
  gap:.5rem;
  margin-top:.5rem;
}

.note-image-item{
  border-radius:12px;
  overflow:hidden;
  background:#e5e7eb;
}

.note-image-item img{
  width:100%;
  height:120px;
  object-fit:cover;
  display:block;
  transition:transform .25s ease;
}

.note-image-item img:hover{
  transform:scale(1.04);
}

/* audio list */
.note-audio-list audio{
  width:100%;
  margin-top:.35rem;
}

/* mobile tweaks */
@media(max-width:600px){
  .note-image-item img{
    height:100px;
  }
}
