/* 
   ==========================================================================
   CSS variables defining a Lovable-inspired premium dark/purple theme
   ==========================================================================
*/
:root {
  --font-main: 'Plus Jakarta Sans', sans-serif;
  
  /* Colors */
  --bg-dark: #09090b;
  --panel-purple-bg: linear-gradient(135deg, #4c1d95 0%, #2e1065 100%);
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.4);
  
  --text-white: #f8fafc;
  --text-muted-light: #cbd5e1;
  --text-dark: #0f172a;
  --text-muted-dark: #64748b;
  
  /* Glassmorphism */
  --glass-card: rgba(255, 255, 255, 0.08);
  --glass-card-hover: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.12);
  
  --glass-light-card: rgba(255, 255, 255, 0.75);
  --glass-light-border: rgba(255, 255, 255, 0.4);
  
  /* Animations */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 20px;
  --border-radius-md: 14px;
  --border-radius-sm: 8px;
}

/* Custom Scrollbar for premium feel */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-purple);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a78bfa;
}

/* General Resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Background Glow Effects */
.glow-bg {
  position: absolute;
  top: 10%;
  left: 20%;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(0,0,0,0) 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(40px);
}

/* Signage View Container */
.signage-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  padding: 0;
  position: relative;
}

/* Main Content Grid */
.main-layout {
  display: grid;
  grid-template-columns: 52% 48%;
  flex-grow: 1;
  height: calc(100vh - 75px); /* reserve 75px for bottom bar */
  overflow: hidden;
}

/* Left Panel: Schedule List with rich purple pattern background */
.left-panel {
  background: var(--panel-purple-bg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

/* Interactive dotted background pattern overlays */
.left-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  pointer-events: none;
}

/* Left Panel Header */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  z-index: 2;
}

.school-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--text-white);
  filter: drop-shadow(0 0 8px var(--accent-purple-glow));
}

.logo-img {
  max-height: 40px;
  max-width: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
}

.logo-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-white);
}

.logo-subtitle {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: #c084fc;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.header-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 14px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Schedule List Container */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 2;
  flex-grow: 1;
}

/* Loading spinner */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  gap: 12px;
  color: var(--text-muted-light);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--text-white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Schedule Items Styles (Inactive and Active states matching user image) */
.schedule-card {
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Default / Inactive state: Glassmorphism */
.schedule-card.inactive {
  background: var(--glass-card);
  color: var(--text-white);
}

.schedule-card.inactive:hover {
  background: var(--glass-card-hover);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Active Highlight state: Solid white card with deep purple content */
.schedule-card.active {
  background: #ffffff;
  color: #3b0764;
  border-color: #ffffff;
  transform: scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25), 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Inside Card Content Typography */
.card-meta {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.schedule-card.inactive .card-meta {
  color: #d8b4fe;
}

.schedule-card.active .card-meta {
  color: #7c3aed;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2px 0;
  letter-spacing: -0.01em;
}

.card-time {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.schedule-card.inactive .card-time {
  color: var(--text-muted-light);
}

.schedule-card.active .card-time {
  color: #6b21a8;
}

/* Right Panel: Active Event Detail */
.right-panel {
  background: #f8fafc; /* Sleek, crisp white */
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Adding subtle glow effect/grid overlay to right panel */
.right-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(135deg, rgba(243, 232, 255, 0.4) 0%, transparent 100%);
  pointer-events: none;
}

/* Active Detail Container */
.active-detail-container {
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn 0.4s ease-out;
  z-index: 1;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 0; transform: translateY(0); }
}

.detail-location-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #7c3aed;
  background: #f3e8ff;
  padding: 6px 14px;
  border-radius: 30px;
  text-transform: uppercase;
  margin-bottom: 20px;
  border: 1px solid #e9d5ff;
}

.detail-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

/* Underline accent on Right Panel title */
.detail-title-accent {
  width: 60px;
  height: 4px;
  background: #f59e0b; /* Yellow accent line from user image */
  border-radius: 2px;
  margin-bottom: 25px;
}

.detail-description {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #475569;
  font-weight: 400;
}

.detail-time-wrapper {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4f46e5;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Event Detail Image Holder (Ratio 16:9) */
.detail-image-container {
  margin-top: 25px;
  width: 100%;
  max-width: 100%; /* Spans the entire width of the right panel detail area */
  aspect-ratio: 16 / 9; /* Landscape 16:9 ratio */
  background-color: #ffffff; /* Solid white background as requested */
  border-radius: var(--border-radius-md);
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-empty {
  text-align: center;
  color: var(--text-muted-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  height: 300px;
}

.empty-icon {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

/* Bottom Bar */
.bottom-bar {
  height: 75px;
  background: #09090b; /* Sleek black */
  display: flex;
  align-items: center;
  border-top: 1px solid #1e1b4b;
  position: relative;
  z-index: 10;
}

/* Clock section */
.time-block {
  padding: 0 25px;
  display: flex;
  align-items: baseline;
  border-right: 1px solid #1e293b;
  height: 100%;
  align-items: center;
  gap: 4px;
  background: #020617;
}

.digital-clock {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.02em;
}

.digital-ampm {
  font-size: 0.8rem;
  font-weight: 600;
  color: #a78bfa;
}

/* Weather Section */
.weather-block {
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-right: 1px solid #1e293b;
  height: 100%;
  background: #020617;
}

.weather-temp {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-white);
}

.weather-icon-wrapper {
  color: #a5f3fc;
  display: flex;
  align-items: center;
}

.weather-icon-wrapper svg {
  width: 24px;
  height: 24px;
}

/* Prayer Section */
.prayer-block {
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-right: 1px solid #1e293b;
  height: 100%;
  background: #020617;
}

.prayer-icon-wrapper {
  color: #fbbf24; /* Amber icon color */
  display: flex;
  align-items: center;
}

.prayer-icon-wrapper svg {
  width: 20px;
  height: 20px;
}

.prayer-info {
  display: flex;
  flex-direction: column;
}

.prayer-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: #a78bfa;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.prayer-time {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.1;
}

/* Announcement Ticker */
.ticker-block {
  flex-grow: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 25px;
}

.ticker-wrapper {
  width: 100%;
  overflow: hidden;
}

.ticker-content {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-white);
  padding-left: 100%;
  animation: ticker 25s linear infinite;
}

@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* Floating Admin Gear Button */
.admin-trigger {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  backdrop-filter: blur(8px);
  opacity: 0.15;
  transition: var(--transition-smooth);
}

.admin-trigger:hover {
  opacity: 1;
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  transform: rotate(45deg);
  box-shadow: 0 0 15px var(--accent-purple-glow);
}

/* Admin Panel Drawer */
.admin-drawer {
  position: fixed;
  top: 0;
  right: -420px; /* Initially hidden */
  width: 400px;
  height: 100vh;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-white);
}

.drawer-title h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted-light);
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.drawer-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
}

.drawer-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Tabs */
.admin-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--border-radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted-light);
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.tab-btn.active {
  background: var(--accent-purple);
  color: var(--text-white);
}

/* Tab panes */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Forms styling */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.admin-form h3 {
  font-size: 1rem;
  font-weight: 700;
  border-left: 3px solid var(--accent-purple);
  padding-left: 8px;
  margin-bottom: 5px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted-light);
}

.form-group input, 
.form-group textarea, 
.form-group select {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  color: var(--text-white);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 5px rgba(139, 92, 246, 0.3);
}

.checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-group input {
  width: auto;
  cursor: pointer;
}

.checkbox-group label {
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 18px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--accent-purple);
  color: var(--text-white);
  flex-grow: 1;
}

.btn-primary:hover {
  background: #7c3aed;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: #ef4444;
  color: var(--text-white);
}

.btn-danger:hover {
  background: #dc2626;
}

.form-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 25px 0;
}

/* Admin lists styles */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.admin-list-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.admin-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.admin-item-info h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.admin-item-info p {
  font-size: 0.75rem;
  color: var(--text-muted-light);
}

.admin-item-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted-light);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
}

.btn-icon.delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ================= LOGIN MODAL (LOVABLE STYLE) ================= */
.login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.login-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.login-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.15);
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
  transform: translateY(20px);
  transition: var(--transition-smooth);
}

.login-modal.open .login-card {
  transform: translateY(0);
}

.login-lock-circle {
  width: 60px;
  height: 60px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.login-lock-circle svg {
  width: 24px;
  height: 24px;
}

.login-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-white);
}

.login-header p {
  font-size: 0.8rem;
  color: var(--text-muted-light);
}

