/* ===========================================================
   Root variables
   =========================================================== */
:root {
  --brand-red: #951519;
  --brand-red-dark: #6c1014;
  --brand-red-soft: #b52b31;
  --bg-deep: #111013;
  --bg-panel: #18171b;
  --bg-panel-soft: #201f25;
  --text-main: #f4f4f6;
  --text-muted: #b3b3be;
  --accent: #f4b63b;
  --accent-soft: rgba(244, 182, 59, 0.1);
  --success: #4caf50;
  --danger: #f44336;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.45);
  --radius-lg: 18px;
  --radius-pill: 999px;
  
  /* Monthly Highlight Color */
  --monthly-accent: #82d7ff; /* Soft Blue */
}

/* ===========================================================
   Global
   =========================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Roboto", system-ui, sans-serif;
  color: var(--text-main);
  /* The background gradient is intentionally complex for visual style */
  background: radial-gradient(circle at top, #b52b31 0, #111013 55%, #050508 100%);
}

/* Utility Class */
.muted {
  color: var(--text-muted);
}

/* ===========================================================
   Layout
   =========================================================== */
.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  max-width: 1400px;
  margin: 24px auto;
  padding: 16px;
  gap: 18px;
}

@media (max-width: 960px) {
  .app-shell { 
    grid-template-columns: 1fr; 
  }
}

/* ===========================================================
   Sidebar
   =========================================================== */
.app-sidebar {
  background: linear-gradient(180deg, var(--brand-red) 0%, var(--brand-red-dark) 70%, #23090b 100%);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: #fff;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}

.brand-logo img {
  width: 74px;
  display: block;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.brand-text h1 {
  margin: 0;
  font-family: "Raleway";
  font-weight: 700;
  letter-spacing: .04em;
  font-size: 1.35rem;
}

.brand-text p {
  margin: 4px 0 0;
  font-size: .85rem;
  color: rgba(255,255,255,0.85);
}

/* ===========================================================
   Sidebar menu sections
   =========================================================== */
.sidebar-section h2 {
  margin: 0 0 10px;
  font-family: "Raleway";
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color:rgba(255,255,255,.8)
}

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-link-card {
  padding: 10px 12px;
  border-radius: 13px;
  color:#fff;
  text-decoration:none;
  background: linear-gradient(135deg, rgba(0,0,0,.15), rgba(255,255,255,.06));
  border:1px solid rgba(255,255,255,.16);
  transition:.12s ease;
}

.quick-link-card:hover {
  transform: translateY(-2px);
  box-shadow:0 12px 26px rgba(0,0,0,.45);
}

/* ===========================================================
   Main
   =========================================================== */
.app-main {
  /* Using a dark background with blur for a modern glass effect */
  background-color: rgba(6,5,10,.9);
  backdrop-filter: blur(22px);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  display:flex;
  flex-direction:column;
  gap:18px;
}

.main-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
}

.subtle {
  font-size:.85rem;
  color:var(--text-muted);
}

/* -----------------------------------------------------------
   HEADER META / CLOCK STYLES
   ----------------------------------------------------------- */
.header-meta {
  display: flex;
  flex-direction: column; /* Stack clock above pills */
  align-items: flex-end; /* Align all items to the right */
}

.header-pills {
  display: flex;
  gap: 8px; /* Space between the date and status pills */
  margin-top: 8px; /* Space between clock and pills */
}

.header-clock-display {
  /* NEW: Larger, more prominent clock display */
  font-size: 1.6rem; 
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
/* ----------------------------------------------------------- */


/* ===========================================================
   GRID LAYOUTS
   =========================================================== */
/* Top Row: Today (1.3fr), In Progress (1.8fr), Next Up (1.3fr) */
.grid-top {
  display: grid;
  grid-template-columns: 1.3fr 1.8fr 1.3fr;
  gap: 16px;
}

/* Middle Row: Upcoming (1.4fr), Week Summary (1.6fr) */
.grid-middle {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr;
  gap: 18px;
}

/* ===========================================================
   Cards
   =========================================================== */
.card {
  /* Complex gradient for premium panel look */
  background:linear-gradient(145deg, var(--bg-panel) 0%, var(--bg-panel-soft) 52%, #0a090f 100%);
  border-radius:var(--radius-lg);
  padding:16px 18px;
  border:1px solid var(--border-subtle);
  box-shadow:0 14px 30px rgba(0,0,0,.4);
  display:flex;
  flex-direction:column;
  justify-content: flex-start; /* don’t stretch content to the bottom */
}

.card-header {
  background: linear-gradient(135deg, rgba(149,21,25,.35), rgba(5,3,8,.6));
  padding:12px 16px;
  margin:-18px -18px 14px -18px;
  border-radius:20px 20px 0 0;
  display: flex;
  justify-content: space-between; /* To align badge/meta information */
  align-items: center;
}

.card-header h3 {
  margin:0;
  font-family:"Raleway";
}

/* ===========================================================
   Lesson rows
   =========================================================== */
.lesson-list {
  max-height:360px;
  overflow-y:auto;
  padding-right:4px;
}

/* Styling for a single row in Today's lessons */
.lesson-card {
  /* Change from Grid to Flex to allow stacking info group */
  display: flex; 
  flex-direction: row; 
  justify-content: space-between; 
  align-items: flex-start; 
  
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.lesson-card:last-child {
  border-bottom: none;
}

/* Container for Student Name and Time (stacked) */
.lesson-info-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.lesson-title {
  font-weight: 500;
  font-size: 1rem;
}

/* Time element is smaller and sits below the name */
.lesson-time {
    font-size: 0.78rem; 
    color: var(--text-muted);
    margin-top: 2px; 
}

/* Existing Meta group (Time and Tag in other places) */
.lesson-meta {
    display: flex;
    align-items: center;
    gap: 12px; 
}

/* Specific styling for Upcoming lesson rows */
.lesson-upcoming {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.lesson-upcoming:last-child {
  border-bottom: none;
}

.upcoming-name {
  flex-grow: 1;
  font-weight: 500;
}

.upcoming-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 10px;
}

/* ===========================================================
   Upcoming Lesson Date Header
   =========================================================== */

.upcoming-date-header {
    margin: 18px 0 8px 0;
    padding-bottom: 4px;
    font-family: "Raleway";
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent); /* Uses your primary accent color */
    border-bottom: 1px solid var(--border-subtle);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}


/* ===========================================================
   Lesson Notes/Current Lesson Styling
   =========================================================== */

.current-lesson-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.current-lesson-block .lesson-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.notes-box {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  background: #0f0e13;              /* darker */
  border: 1px solid rgba(255,255,255,.08);
  color: #e6e6f0;
  resize: vertical;
  font-family: inherit;
  font-size: 0.9rem;
  min-height: 80px;
}

.save-btn {
  background: var(--brand-red-soft);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.1s ease;
}

.save-btn:hover {
  background: var(--brand-red);
  transform: translateY(-1px);
}

.save-btn:active {
  transform: translateY(0);
}

/* Countdown in In Progress Box */
.lesson-countdown {
  font-size: 0.8rem;
  color: var(--accent); /* Highlight countdown time */
  font-weight: 500;
  margin-left: 10px;
}

/* Adjust card header to make space for countdown */
.card-header.current-lesson-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}


/* ===========================================================
   Pills, Badges, and Status Indicators
   =========================================================== */
.badge {
  background: var(--accent);
  color: var(--bg-deep);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  margin-left: 8px;
}

.status-pill {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-loading {
  background: rgba(244, 182, 59, 0.18);
  border: 1px solid rgba(244, 182, 59, 0.85);
  color: #ffe6b3;
}

.status-ok {
  background: rgba(62, 174, 73, 0.2);
  border: 1px solid rgba(62, 174, 73, 0.85);
  color: #c8ffd0;
}

.status-error {
  background: rgba(244, 67, 54, 0.18);
  border: 1px solid rgba(244, 67, 54, 0.85);
  color: #ffc8c2;
}

.date-pill {
  background: var(--bg-panel-soft);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
}

/* Paid / Unpaid Tags (small and large) */
.tag-paid {
  background:rgba(62,174,73,.2);
  border:1px solid rgba(62,174,73,.85);
  color:#c8ffd0;
  padding:4px 10px;
  border-radius:var(--radius-pill);
  font-size:.75rem;
  font-weight:600;
  width: fit-content;
}

.tag-unpaid {
  background:rgba(244,182,59,.18);
  border:1px solid rgba(244,182,59,.85);
  color:#ffe6b3;
  padding:4px 10px;
  border-radius:var(--radius-pill);
  font-size:.75rem;
  font-weight:600;
  width: fit-content;
}

.tag-missed {
  background:rgba(244,67,54,.18);
  border:1px solid rgba(244,67,54,.85);
  color:#ffc8c2;
  padding:4px 10px;
  border-radius:var(--radius-pill);
  font-size:.75rem;
  font-weight:600;
  width: fit-content;
}

.tag-sm {
  padding: 2px 8px;
  font-size: 0.65rem;
}


/* ========================================
   WEEK SUMMARY STAT BOXES
   ======================================== */

.week-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 10px;
}

.week-stat-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.week-stat-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.22);
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
/* ========================================
   HERO WEEKLY INCOME STAT (Gold Highlight)
   ======================================== */

.hero-income-box {
  grid-column: span 2; 
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  margin-top: 6px;
  padding: 16px 20px;
  text-align: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}


.hero-income-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.2);
}

.hero-label {
  text-transform: uppercase;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}

/* The circle wrapper */
.hero-income-box .hero-circle {
  width: 130px;
  height: 130px;
  margin: 0 auto 10px auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;

  background: radial-gradient(
      circle at 30% 30%,
      rgba(255, 215, 130, 0.45),
      rgba(255, 255, 255, 0.05)
    ),
    rgba(255, 255, 255, 0.03);

  border: 2px solid rgba(255, 215, 130, 0.35);
  box-shadow: inset 0 0 12px rgba(255, 215, 130, 0.25),
    0 0 15px rgba(0, 0, 0, 0.35);
}

/* The huge money number */
.hero-income-box .hero-income-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -1px;
  text-shadow: 0 0 12px rgba(255, 215, 130, 0.4);
}
/* ========================================
   HERO MONTHLY INCOME STAT (Blue Highlight)
   ======================================== */

.hero-monthly-box {
  grid-column: span 2; /* Spans both columns */
  background: rgba(130, 215, 255, 0.06); /* Light Blue BG */
  border: 1px solid rgba(130, 215, 255, 0.12);
  border-radius: 16px;
  margin-top: 6px;
  padding: 16px 20px;
  text-align: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}


.hero-monthly-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  border-color: rgba(130, 215, 255, 0.2);
}

/* The circle wrapper */
.hero-monthly-box .hero-circle {
    width: 130px;
    height: 130px;
    margin: 0 auto 10px auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    
    background: radial-gradient(
        circle at 30% 30%,
        rgba(130, 215, 255, 0.45), /* Light Blue Highlight */
        rgba(255, 255, 255, 0.05)
      ),
      rgba(255, 255, 255, 0.03);

  border: 2px solid rgba(130, 215, 255, 0.35);
  box-shadow: inset 0 0 12px rgba(130, 215, 255, 0.25),
    0 0 15px rgba(0, 0, 0, 0.35);
}

/* The huge money number */
.hero-monthly-box .hero-income-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -1px;
  text-shadow: 0 0 12px rgba(130, 215, 255, 0.4); /* Light Blue Shadow */
}


/* The tiny label under the circle */
.hero-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===========================================================
   HUE TOGGLE (SWITCH) STYLING
   =========================================================== */

.hue-toggle-card {
  padding: 14px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hue-toggle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.hue-helper {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* The switch - adapted for dark theme */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-panel-soft); /* Darker off state */
  transition: 0.4s;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: var(--text-main);
  transition: 0.4s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

input:checked + .slider {
  background-color: var(--accent); /* Accent color for on state */
  border-color: var(--accent);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--accent);
}

input:checked + .slider:before {
  transform: translateX(26px);
  background-color: white;
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* ===========================================================
   TOAST NOTIFICATIONS
   =========================================================== */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--success);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.toast.show {
  opacity: 1;
  visibility: visible;
}
/* Manager Modal Styles */
.manager-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.manager-modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 1100px;
    height: 85%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    border-radius: 18px 18px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-family: "Raleway";
    font-weight: 600;
}

#close-manager-btn {
    background: var(--brand-red);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.modal-body {
    display: grid;
    grid-template-columns: 350px 1fr;
    flex-grow: 1;
    overflow: hidden;
}

.student-list-container {
    padding: 20px;
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
}

.student-list-container h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

#student-name-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#student-name-list li {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--bg-panel-soft);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#student-name-list li:hover {
    background: var(--brand-red-soft);
}

.profile-editor {
    padding: 20px;
    overflow-y: auto;
}

.profile-editor form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    resize: vertical;
    font-family: inherit;
}

#save-profile-btn {
    align-self: flex-start;
    background: var(--accent);
    color: var(--bg-deep);
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

/* Digital Clock Style (Same as date pill but separate ID) */
.header-clock-display {
  /* NEW: Larger, more prominent clock display */
  font-size: 1.6rem; 
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

/* Countdown in In Progress Box */
.lesson-countdown {
  font-size: 0.8rem;
  color: var(--accent); /* Highlight countdown time */
  font-weight: 500;
  margin-left: 10px;
}

/* Adjust card header to make space for countdown */
.card-header.current-lesson-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

/* Add to style.css */

/* Style for the clickable student name */
.student-link {
    color: var(--text-main); /* White/Main text color */
    text-decoration: none;
    font-weight: 500;
    transition: color 0.1s ease;
}

.student-link:hover {
    color: var(--accent); /* Highlight on hover */
    text-decoration: underline;
}

/* Style for the small notes icon */
.notes-icon {
    font-size: 0.9rem;
    color: var(--accent);
    margin-left: 8px;
    cursor: pointer;
    transition: color 0.1s ease;
    padding: 3px;
    border-radius: 4px;
}

.notes-icon:hover {
    color: var(--brand-red-soft);
    background: rgba(255, 255, 255, 0.08);
}