:root {
  --bg-color: #050505;
  --bg-surface: rgba(15, 15, 20, 0.6);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.65);
  
  --glass-bg: rgba(15, 15, 20, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.15);
  
  --accent-color: #00f0ff;
  --accent-active-bg: rgba(0, 240, 255, 0.15);
  --accent-active-icon: #00f0ff;
  
  --active-glow-warm: rgba(255, 42, 85, 0.4);
  --active-glow-cool: rgba(0, 240, 255, 0.4);
  --active-glow-light: rgba(200, 255, 0, 0.3);

  --card-radius: 1.25rem;
  --icon-size: 2.75rem;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Rajdhani', sans-serif;
  --nav-width: 280px;
  --nav-mobile-height: 80px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  background-image: radial-gradient(circle at 100% 0%, #0a0f25 0%, #050505 50%),
                    radial-gradient(circle at 0% 100%, #120a25 0%, #050505 50%),
                    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 30px 30px, 30px 30px;
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  overflow: hidden; 
  user-select: none;
}

#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
}

home-dashboard {
  display: contents;
}

/* Sidebar */
.nav-bar {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 2.5rem) 1.5rem 1.5rem 1.5rem;
  width: var(--nav-width);
  z-index: 100;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.02);
}

.nav-header {
  padding: 0 0 2.5rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-header-icon {
  background: linear-gradient(135deg, #00f0ff, #0055ff);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.nav-header-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: white;
}

.nav-header-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.nav-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-item svg {
  width: 1.35rem;
  height: 1.35rem;
  stroke: currentColor;
}

.nav-item:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.nav-item.is-active {
  background: var(--accent-active-bg);
  color: var(--accent-active-icon);
  font-weight: 600;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(env(safe-area-inset-top, 2rem) + 1rem) 2.5rem calc(env(safe-area-inset-bottom, 2rem) + 2rem) 2.5rem;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.view-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
  margin-bottom: 0;
}

.current-date-time {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.time-sep {
  color: var(--accent-color);
  opacity: 0.5;
}

/* DateTime Card */
.datetime-card {
  background: var(--bg-surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.1);
  flex: 1; /* allow it to grow if needed */
}

.time-display {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  text-shadow: 0 4px 10px rgba(0,0,0,0.2);
  margin-bottom: 0.25rem;
}

.date-display {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sections-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.overview-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-primary);
  padding-left: 0.25rem;
  letter-spacing: 0.05em;
  opacity: 0.9;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* Premium Cards */
.mushroom-card {
  background: var(--bg-surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), 
              background 0.3s ease, 
              border-color 0.3s ease, 
              box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.1);
}

.mushroom-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.mushroom-card:hover::before {
  opacity: 1;
}

.mushroom-card:active {
  transform: scale(0.96);
}

.mushroom-card.is-active {
  background: rgba(20, 20, 25, 0.9);
  border-color: var(--accent-color);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 0 20px rgba(0, 240, 255, 0.1), 0 0 15px rgba(0, 240, 255, 0.2);
}

/* Glow effects for active state */
.mushroom-card.is-active.type-light {
  border-color: #c8ff00;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 0 20px rgba(200, 255, 0, 0.1), 0 0 15px rgba(200, 255, 0, 0.2);
}

.mc-icon-wrapper {
  position: relative;
  width: var(--icon-size);
  height: var(--icon-size);
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 1px solid rgba(255,255,255,0.05);
}

.mc-icon-wrapper svg {
  width: 1.35rem;
  height: 1.35rem;
  stroke: var(--text-secondary);
  transition: all 0.3s ease;
}

.is-active .mc-icon-wrapper {
  background: var(--text-primary);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255,255,255,0.2);
}

.is-active .mc-icon-wrapper svg {
  stroke: var(--bg-color);
}

.is-active.type-media_player .mc-icon-wrapper {
  background: #34c759;
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4);
}

.mc-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.mc-title {
  font-weight: 600;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.mc-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.mc-controls {
  width: 100%;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mushroom-card.has-controls {
  flex-direction: column;
  align-items: flex-start;
}

.mushroom-card.has-controls .mc-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.mc-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 2.25rem;
  border-radius: 1.25rem;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.04);
}

.mc-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 2.25rem;
  background: transparent;
}

.mc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0;
  height: 0;
  box-shadow: -100vw 0 0 100vw rgba(255,255,255,0.25);
}

.is-active .mc-slider::-webkit-slider-thumb {
  box-shadow: -100vw 0 0 100vw var(--text-primary);
}

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

.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Weather Banner */
.weather-banner {
  border-radius: var(--card-radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: white;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 1px 2px rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}

.weather-default { background: linear-gradient(135deg, #4b6cb7, #182848); }
.weather-sunny { background: linear-gradient(135deg, #f2994a, #f2c94c); box-shadow: 0 10px 40px rgba(242, 153, 74, 0.3), inset 0 1px 2px rgba(255,255,255,0.4); }
.weather-night { background: linear-gradient(135deg, #141e30, #243b55); }
.weather-rain { background: linear-gradient(135deg, #3a7bd5, #3a6073); }
.weather-cloudy { background: linear-gradient(135deg, #757f9a, #d7dde8); color: #1a1a24; box-shadow: 0 10px 40px rgba(117, 127, 154, 0.2), inset 0 1px 2px rgba(255,255,255,0.4); }
.weather-cloudy svg { stroke: #1a1a24 !important; }

.weather-icon-large {
  width: 4rem;
  height: 4rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
}

.weather-icon-large svg {
  width: 2rem;
  height: 2rem;
  stroke: white;
}

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

.weather-temp {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.weather-desc {
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.9;
  text-transform: capitalize;
  margin-top: 0.25rem;
}

/* Calendar Agenda */
.calendar-agenda {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.1);
  height: 100%;
}

.agenda-item {
  display: flex;
  align-items: stretch;
  padding: 0.75rem 0;
  position: relative;
}

.agenda-item:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.agenda-time {
  width: 6.5rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding-right: 1.25rem;
}

.agenda-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.agenda-hour {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.agenda-divider {
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.agenda-dot {
  width: 10px;
  height: 10px;
  background: var(--bg-surface);
  border: 2px solid var(--accent-color);
  border-radius: 50%;
  position: absolute;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.agenda-content {
  flex: 1;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.agenda-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.agenda-location {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.agenda-location::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.65)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
  background-size: cover;
}

@media (max-width: 768px) {
  #app {
    flex-direction: column-reverse;
  }
  
  .nav-bar {
    width: 100%;
    height: var(--nav-mobile-height);
    border-right: none;
    border-top: 1px solid var(--glass-border);
    flex-direction: row;
    padding: 0 env(safe-area-inset-right, 1rem) env(safe-area-inset-bottom, 1rem) env(safe-area-inset-left, 1rem);
    align-items: center;
    justify-content: space-around;
  }
  
  .nav-header {
    display: none;
  }
  
  .nav-items {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
  }
  
  .nav-item {
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.75rem;
  }
  
  .nav-item svg {
    width: 1.5rem;
    height: 1.5rem;
  }
  
  .main-content {
    padding: env(safe-area-inset-top, 1.5rem) 1.25rem 1.5rem 1.25rem;
  }
  
  .view-title {
    font-size: 1.75rem;
    margin-bottom: 0;
  }
  
  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
  }
  
  .current-date-time {
    font-size: 1rem;
  }
  
  .section-grid {
    grid-template-columns: 1fr;
  }
  
  .overview-top-row {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 1100px) and (min-width: 769px) {
  .overview-top-row {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}
