@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap");

:root {
  /* Modern Dark Palette */
  --bg-color: #05070a;
  --surface-color: rgba(255, 255, 255, 0.03);
  --surface-border: rgba(255, 255, 255, 0.1);
  --surface-glass: rgba(13, 17, 23, 0.7);

  --primary: #4f46e5;
  --primary-glow: rgba(79, 70, 229, 0.4);
  --secondary: #8b5cf6;
  --accent: #0ea5e9;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px var(--primary-glow);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-color);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(79, 70, 229, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(14, 165, 233, 0.15) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

/* Layout */
main {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.app-shell {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Navigation */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  position: sticky;
  top: 1rem;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.nav strong {
  font-family: "Outfit", sans-serif;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-main);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  gap: 0.5rem;
}

.button.primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.button.primary:hover {
  background: var(--secondary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.button.ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--surface-border);
}

.button.ghost:hover {
  background: var(--surface-color);
  color: var(--text-main);
  border-color: var(--text-muted);
}

/* Cards & Panels */
.panel,
.form-card {
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.panel h2 {
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

/* Forms */
.input {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.input label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}

.input input,
.input select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-size: 0.95rem;
  transition: var(--transition);
}

.input input:focus,
.input select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Tabs */
.tabs {
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: var(--radius-md);
  display: inline-flex;
}

.tab {
  padding: 0.5rem 1.25rem;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.tab.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* Weekly Table Redesign */
.weekly-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--surface-border);
}

.weekly-table th {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--surface-border);
  border-right: 1px solid var(--surface-border);
}

.weekly-table td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--surface-border);
  border-right: 1px solid var(--surface-border);
  height: 60px;
  min-width: 120px;
}

.weekly-table td.time-cell {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-align: center;
}

.weekly-table th.today-cell,
.weekly-table td.today-cell {
  background: rgba(79, 70, 229, 0.05);
}

/* Reservation Cards in Grid */
.reservation-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  height: 100%;
  transition: var(--transition);
  filter: grayscale(0.8);
  opacity: 0.6;
}

.reservation-card.mine {
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 25px rgba(14, 165, 233, 0.5);
  filter: none;
  opacity: 1;
  z-index: 5;
}

.reservation-card.mine strong {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.reservation-card strong {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Monthly Grid Redesign */
.monthly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--surface-border);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 1.5rem;
}

.monthly-grid .cell {
  background: var(--bg-color);
  min-height: 120px;
  padding: 0.75rem;
}

.monthly-grid .cell.header {
  min-height: auto;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  font-weight: 600;
  text-align: center;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.monthly-date {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.monthly-grid .cell.today .monthly-date {
  color: var(--primary);
}

.monthly-entry {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.7rem;
  margin-bottom: 4px;
  border-left: 3px solid #334155;
  color: var(--text-dim);
  opacity: 0.7;
}

.monthly-entry.mine {
  background: var(--primary);
  border-left: 3px solid #fff;
  color: white;
  border-color: var(--primary);
  opacity: 1;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.monthly-entry.mine strong {
  color: white;
}

/* Badges */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.approved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge.rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Helpers */
.muted {
  color: var(--text-muted);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.notice {
  font-size: 0.85rem;
  color: var(--danger);
  margin-top: 0.5rem;
}

.build-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1.5rem;
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

.mobile-schedule {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-day {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
}

.mobile-day.today {
  border-color: rgba(79, 70, 229, 0.4);
  background: rgba(79, 70, 229, 0.08);
}

.mobile-day-header {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-dim);
}

.mobile-day-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }

  .card-actions button {
    flex: 1 1 100%;
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
  }
}

.panel,
.form-card {
  animation: fadeIn 0.4s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* Tooltip or specialized cards */
.reservation-card {
  transition: var(--transition);
  cursor: pointer;
}

.reservation-card:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
  box-shadow: var(--shadow-glow);
}

/* Glass table headers */
.weekly-table th {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Responsive */
@media (max-width: 1024px) {
  main {
    padding: 1rem;
  }

  .nav {
    border-radius: 0;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-left: none;
    border-right: none;
  }
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr !important;
  }
}
