
/* ======= RESET & BASE ======= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #f5a623;
  --gold-light: #ffd166;
  --maroon: #8b1a1a;
  --maroon-light: #c0392b;
  --green: #00b894;
  --blue-deep: #0b0914;
  --blue-mid: #1c1836;
  --blue-light: #2a244d;
  --glass: rgba(255,255,255,0.05);
  --glass-border: rgba(255,255,255,0.08);
  --glass-hover: rgba(255,255,255,0.1);
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0b8;
  --poya-color: #f5a623;
  --national-color: #00cec9;
  --religious-color: #a29bfe;
  --user-color: #ff7675;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--blue-deep);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ======= ANIMATED BACKGROUND ======= */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  animation: floatOrb 15s ease-in-out infinite;
}
.orb1 { width: 600px; height: 600px; background: radial-gradient(circle, var(--maroon), var(--gold)); top: -200px; left: -150px; }
.orb2 { width: 500px; height: 500px; background: radial-gradient(circle, #302b63, #a29bfe); bottom: -150px; right: -100px; animation-delay: 5s; }
.orb3 { width: 400px; height: 400px; background: radial-gradient(circle, #00b894, #0f0c29); top: 30%; left: 40%; animation-delay: 10s; opacity: 0.15; }

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -50px) scale(1.1); }
}

/* ======= DASHBOARD LAYOUT ======= */
.dashboard-layout {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
}

/* ======= SIDEBAR ======= */
.sidebar {
  width: 320px;
  background: rgba(15, 12, 25, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--glass-border);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 16px; }
.flag { font-size: 42px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5)); animation: flagWave 3s ease-in-out infinite; }
@keyframes flagWave { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

.app-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.app-title span {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 14px;
  vertical-align: super;
  margin-left: 4px;
}

/* Clock Widget */
.live-clock-widget {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.live-clock-widget .time {
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  text-shadow: 0 0 20px rgba(255,255,255,0.2);
}
.live-clock-widget .date {
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Sidebar Sections */
.section-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.upcoming-item {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: transform 0.2s, background 0.2s;
}
.upcoming-item:hover {
  transform: translateX(4px);
  background: var(--glass-hover);
}
.upcoming-icon {
  font-size: 24px;
  background: rgba(0,0,0,0.2);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
}
.upcoming-details h4 {
  font-size: 13px;
  color: #fff;
  font-weight: 600;
  margin-bottom: 4px;
}
.upcoming-details p {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
}
.no-events { font-size: 13px; color: var(--text-secondary); font-style: italic; }

.global-notes {
  width: 100%;
  height: 200px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  transition: border-color 0.3s;
}
.global-notes:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255,255,255,0.08);
}

/* ======= MAIN CONTENT ======= */
.main-content {
  flex: 1;
  padding: 30px 40px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  padding: 16px 24px;
  border-radius: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 18px;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.2);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.chip:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.chip.active { background: #fff; color: #000; border-color: #fff; box-shadow: 0 4px 15px rgba(255,255,255,0.2); }
.chip[data-filter="poya"].active { background: linear-gradient(135deg, #f5a623, #ffc048); color: #000; }
.chip[data-filter="national"].active { background: linear-gradient(135deg, #00cec9, #81ecec); color: #000; }
.chip[data-filter="religious"].active { background: linear-gradient(135deg, #a29bfe, #dfe6e9); color: #000; }
.chip[data-filter="user"].active { background: linear-gradient(135deg, #ff7675, #fab1a0); color: #000; }

.top-actions { display: flex; gap: 16px; align-items: center; }
.year-tabs {
  display: flex;
  background: rgba(0,0,0,0.4);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
}
.year-tab {
  padding: 8px 24px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.3s;
}
.year-tab.active {
  background: linear-gradient(135deg, var(--maroon), var(--gold));
  color: #fff;
  box-shadow: 0 4px 15px rgba(245,166,35,0.3);
}

.btn-primary {
  padding: 10px 24px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,255,255,0.3); }

/* Stats */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-card {
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s;
}
.stat-card:hover { transform: translateY(-4px); background: var(--glass-hover); }
.stat-num {
  display: block;
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; }

/* Calendar */
.months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.month-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  animation: slideUp 0.5s ease forwards;
  opacity: 0;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.month-header {
  padding: 16px 20px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--glass-border);
  text-align: center;
}
.month-name { font-size: 18px; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: 1px; }

.day-labels { display: grid; grid-template-columns: repeat(7, 1fr); padding: 12px 12px 8px; }
.day-label { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-secondary); }
.day-label:first-child, .day-label:last-child { color: #ff7675; }

.days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0 12px 16px; }
.day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 6px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
}
.day-cell:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); }
.day-cell.empty { background: transparent; cursor: default; border: none; }
.day-cell.weekend { color: #ff7675; }
.day-cell.today {
  background: rgba(245,166,35,0.15);
  border: 1px solid var(--gold);
  color: var(--gold);
}

/* Day Badges */
.day-badges {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
  pointer-events: none;
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.badge-poya { background: var(--poya-color); box-shadow: 0 0 6px var(--poya-color); }
.badge-national { background: var(--national-color); box-shadow: 0 0 6px var(--national-color); }
.badge-religious { background: var(--religious-color); box-shadow: 0 0 6px var(--religious-color); }
.badge-icon { font-size: 10px; line-height: 1; } /* For 🎂 or 📌 */

.day-cell.dimmed { opacity: 0.2; }

/* Info Section */
.info-section {
  background: var(--glass);
  border-radius: 20px;
  padding: 30px;
  border: 1px solid var(--glass-border);
}
.info-heading { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 20px; }
.info-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.info-card { display: flex; gap: 12px; align-items: flex-start; }
.info-card-icon { font-size: 28px; }
.info-card h3 { font-size: 14px; color: #fff; margin-bottom: 4px; }
.info-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* Footer */
.app-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  border-top: 1px solid var(--glass-border);
}

/* ======= MODAL ======= */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  backdrop-filter: blur(10px); z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-card {
  background: #1c1836;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  width: 90%; max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column;
}

.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.1); border: none;
  color: #fff; width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; transition: 0.2s;
}
.modal-close:hover { background: #fff; color: #000; }

.modal-header { padding: 30px 30px 20px; text-align: center; background: rgba(0,0,0,0.2); }
.modal-header h2 { font-size: 24px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.modal-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-style-poya { background: rgba(245,166,35,0.2); color: var(--poya-color); }
.badge-style-national { background: rgba(0,206,201,0.2); color: var(--national-color); }
.badge-style-religious { background: rgba(162,155,254,0.2); color: var(--religious-color); }

.modal-tabs { display: flex; border-bottom: 1px solid var(--glass-border); }
.modal-tab {
  flex: 1; padding: 16px; background: transparent; border: none;
  color: var(--text-secondary); font-weight: 600; cursor: pointer; transition: 0.3s;
}
.modal-tab.active { color: var(--gold); border-bottom: 2px solid var(--gold); background: rgba(255,255,255,0.02); }

.modal-tab-content { display: none; padding: 24px 30px; max-height: 400px; overflow-y: auto; }
.modal-tab-content.active { display: block; }

.holiday-info-box {
  background: rgba(255,255,255,0.05); padding: 16px; border-radius: 12px;
  margin-bottom: 16px; display: flex; align-items: center; gap: 12px;
}
.holiday-info-icon { font-size: 32px; }
.holiday-info-name { font-weight: 700; color: #fff; font-size: 15px; }

/* User Events List */
.user-events-list { display: flex; flex-direction: column; gap: 12px; }
.event-item {
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center;
}
.event-item-left { display: flex; align-items: center; gap: 12px; }
.event-icon { font-size: 20px; }
.event-text { font-size: 14px; color: #fff; font-weight: 500; }
.btn-delete { background: transparent; border: none; color: #ff7675; cursor: pointer; font-size: 16px; opacity: 0.7; }
.btn-delete:hover { opacity: 1; transform: scale(1.1); }
.no-user-events { text-align: center; color: var(--text-secondary); font-size: 13px; font-style: italic; padding: 20px 0; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; }
.form-group select, .form-group input {
  width: 100%; padding: 14px; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
  border-radius: 12px; color: #fff; font-size: 14px; font-family: inherit; transition: 0.3s;
}
.form-group select:focus, .form-group input:focus { outline: none; border-color: var(--gold); background: rgba(0,0,0,0.5); }
.btn-submit {
  width: 100%; padding: 14px; background: linear-gradient(135deg, var(--gold), #e67e22);
  color: #000; border: none; border-radius: 12px; font-weight: 700; font-size: 15px; cursor: pointer; margin-top: 10px;
}
.btn-submit:hover { opacity: 0.9; transform: translateY(-2px); }

/* ======= TOAST NOTIFICATIONS ======= */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; }
.toast {
  background: rgba(15, 12, 25, 0.95); border-left: 4px solid var(--gold); border-radius: 8px;
  padding: 16px 20px; color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: slideIn 0.3s ease forwards, fadeOut 0.3s ease 2.7s forwards;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

/* ======= SCROLLBAR ======= */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Responsive */
@media (max-width: 1024px) {
  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; border-right: none; border-bottom: 1px solid var(--glass-border); padding: 20px; }
  .main-content { padding: 20px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .months-grid { grid-template-columns: 1fr; }
  .top-bar { flex-direction: column; align-items: stretch; }
  .year-tabs { justify-content: center; width: 100%; }
}

/* ======= NEW FEATURES: TOOLTIPS & MONTH FOOTER ======= */

/* Tooltip on hover */
.day-cell { position: relative; }
.day-tooltip {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(20, 15, 35, 0.98);
  border: 1px solid rgba(245, 166, 35, 0.5);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  box-shadow: 0 8px 25px rgba(0,0,0,0.8);
  pointer-events: none;
}
.day-cell:hover .day-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.day-tooltip div { margin-bottom: 5px; }
.day-tooltip div:last-child { margin-bottom: 0; }
.day-tooltip strong { color: var(--gold); }

/* Month Footer (List below the month grid) */
.month-card {
  display: flex;
  flex-direction: column;
}
.month-footer {
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--glass-border);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 110px;
  overflow-y: auto;
  margin-top: auto; /* Push to bottom */
}
.month-footer::-webkit-scrollbar { width: 4px; }
.month-footer::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.footer-event {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}
.footer-event strong {
  color: #fff;
  font-size: 12px;
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Symbol Styles for Categories */
.sym {
  font-weight: bold;
  font-family: serif;
  color: var(--gold);
  margin-right: 4px;
}
.sym-icon {
  font-size: 38px;
  font-family: serif;
  color: var(--gold);
  line-height: 1;
}

/* Updated Chip Colors */
.chip[data-filter="public"].active { background: linear-gradient(135deg, #00cec9, #81ecec); color: #000; }
.chip[data-filter="bank"].active { background: linear-gradient(135deg, #a29bfe, #dfe6e9); color: #000; }
.chip[data-filter="mercantile"].active { background: linear-gradient(135deg, #f5a623, #ffc048); color: #000; }

/* Info Cards Updated Colors */
.public-card { border-top: 3px solid #00cec9; }
.bank-card { border-top: 3px solid #a29bfe; }
.merc-card { border-top: 3px solid #f5a623; }

/* Holiday Type Dots */
.badge-public { background: #00cec9; box-shadow: 0 0 6px #00cec9; }
.badge-bank { background: #a29bfe; box-shadow: 0 0 6px #a29bfe; }
.badge-mercantile { background: #f5a623; box-shadow: 0 0 6px #f5a623; }

/* Modal Badges */
.badge-style-public { background: rgba(0,206,201,0.2); color: #00cec9; }
.badge-style-bank { background: rgba(162,155,254,0.2); color: #a29bfe; }
.badge-style-mercantile { background: rgba(245,166,35,0.2); color: #f5a623; }

/* App Logo Styles */
.app-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.app-logo:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 6px 20px rgba(245, 166, 35, 0.5);
}

/* ======= INCREASE LOGO SIZE ======= */
.app-logo {
  width: 90px !important;
  height: 90px !important;
  border-radius: 22px !important;
  box-shadow: 0 8px 25px rgba(245, 166, 35, 0.4) !important;
}
.brand {
  gap: 20px !important;
}
.app-title {
  font-size: 26px !important;
}

/* ======= GOOGLE AUTH ======= */
.user-auth-section { margin-bottom: -10px; }
.user-profile { 
  display: flex; align-items: center; gap: 12px; 
  background: rgba(255,255,255,0.05); padding: 12px; 
  border-radius: 12px; border: 1px solid var(--glass-border); 
}
.user-profile img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold); }
.user-profile h4 { font-size: 14px; color: #fff; margin-bottom: 4px; line-height: 1.2; }
.btn-logout { 
  background: transparent; border: 1px solid #ff7675; color: #ff7675; 
  border-radius: 6px; font-size: 11px; padding: 4px 10px; cursor: pointer; transition: 0.2s;
}
.btn-logout:hover { background: #ff7675; color: #000; }

/* ======= EXTRA MOBILE OPTIMIZATION ======= */
@media (max-width: 600px) {
  /* Logo and Title */
  .brand { flex-direction: row !important; gap: 10px !important; justify-content: center; }
  .app-logo { width: 60px !important; height: 60px !important; border-radius: 12px !important; }
  .app-title { font-size: 20px !important; }
  
  /* Filters */
  .filter-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 15px; }
  .chip { padding: 6px 12px; font-size: 11px; flex: 1 1 auto; text-align: center; }
  
  /* Layout Padding */
  .main-content { padding: 10px; }
  .sidebar { padding: 15px; }
  
  /* Stats Strip */
  .stats-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
  .stat-card { padding: 12px; }
  .stat-num { font-size: 22px; }
  
  /* Info Cards */
  .info-cards { grid-template-columns: 1fr; gap: 15px; }
  .info-card { padding: 15px; }
  
  /* User Profile */
  .user-profile { flex-direction: column; align-items: flex-start; }
}
