/* ═══════════════════════════════════════════════════════════════════════════
   Portfolio Site Styles - Enhanced Version
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────── CSS Variables ─────────────────────────── */
:root {
  /* Dark mode (default) */
  --bg: #0b0f14;
  --fg: #e8eef2;
  --muted: #9ab;
  --primary: #5cc8ff;
  --primary-dark: #4ab8ef;
  --card: #121820;
  --border: #1e2833;
  --overlay: rgba(0, 0, 0, 0.35);
  --success: #2da44e;
  --error: #d73a49;
  --transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Light mode */
[data-theme="light"] {
  --bg: #f5f7fa;
  --fg: #1a1f2e;
  --muted: #5a6c7d;
  --primary: #0066cc;
  --primary-dark: #0052a3;
  --card: #ffffff;
  --border: #d1d9e0;
  --overlay: rgba(0, 0, 0, 0.15);
  --success: #28a745;
  --error: #dc3545;
}

/* ─────────────────────────────── Base Styles ───────────────────────────── */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: var(--transition);
}

/* ─────────────────────────────── Skip Link ─────────────────────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #001018;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 8px 0;
  z-index: 9999;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

/* ─────────────────────────────── Typography ────────────────────────────── */
h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
}

/* Gradient effect for non-hero h1 */
section:not(.hero) h1 {
  background: linear-gradient(135deg, var(--fg), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.8rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--primary);
  font-weight: 600;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--fg);
}

p {
  margin: 0.8rem 0;
}

a {
  transition: all 0.2s ease;
}

/* ─────────────────────────────── Layout ────────────────────────────────── */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
}

/* ─────────────────────────────── Header ────────────────────────────────── */
.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.brand {
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  font-size: 1.2rem;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.brand:hover {
  color: var(--primary);
}

/* ─────────────────────────────── Theme Toggle ──────────────────────────── */
.theme-toggle {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  padding: 0;
  color: var(--fg);
}

.theme-toggle:hover {
  border-color: var(--primary);
  transform: rotate(180deg);
  background: rgba(92, 200, 255, 0.1);
}

.theme-toggle:active {
  transform: rotate(180deg) scale(0.95);
}

/* ─────────────────────────────── Hamburger Menu ────────────────────────── */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--fg);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ─────────────────────────────── Navigation ────────────────────────────── */
.nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.nav a {
  color: var(--fg);
  text-decoration: none;
  opacity: 0.9;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
  white-space: nowrap;
  font-size: 0.95rem;
  position: relative;
}

/* Animated Navigation Link - Underline slide-in effect */
.nav a:not(.button):not(.download-resume-btn)::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav a:not(.button):not(.download-resume-btn):hover::after,
.nav a:not(.button):not(.download-resume-btn).active::after {
  transform: scaleX(1);
}

.nav a.active,
.nav a:not(.button):hover {
  background: rgba(92, 200, 255, 0.15);
  opacity: 1;
}

.nav a.active {
  color: var(--primary);
}

.nav a.button,
.nav a.download-resume-btn {
  opacity: 1;
}

.nav a.download-resume-btn {
  animation: pulse-cta 3s ease-in-out infinite;
}

/* Pulse CTA Animation for Download Resume Button */
@keyframes pulse-cta {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(92, 200, 255, 0.3);
  }
  50% {
    box-shadow: 0 4px 16px rgba(92, 200, 255, 0.6),
                0 0 20px rgba(92, 200, 255, 0.4);
  }
}

.nav a.download-resume-btn:hover {
  animation-play-state: paused;
}

/* ─────────────────────────────── Buttons ───────────────────────────────── */
.button,
button[type="submit"] {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(92, 200, 255, 0.3);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

/* Ensure buttons are visible in light mode */
[data-theme="light"] .button,
[data-theme="light"] button[type="submit"] {
  color: #ffffff;
  background: linear-gradient(135deg, #0066cc, #0052a3);
}

.button:hover,
button[type="submit"]:hover {
  box-shadow: 0 4px 16px rgba(92, 200, 255, 0.5);
  transform: translateY(-2px);
}

.button:active,
button[type="submit"]:active {
  transform: translateY(0);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.secondary {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.secondary:hover {
  text-decoration: underline;
}

/* ─────────────────────────────── Form Inputs ───────────────────────────── */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  transition: all 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Color scheme for date pickers */
input[type="date"] {
  color-scheme: dark;
  position: relative;
  cursor: pointer;
}

[data-theme="light"] input[type="date"] {
  color-scheme: light;
}

/* Style the calendar icon */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.7);
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  filter: invert(0.7) brightness(1.2);
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.3);
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator:hover {
  filter: invert(0.3) brightness(0.8);
}

/* Date input text styling */
input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

input[type="date"]::-webkit-datetime-edit-text {
  color: var(--muted);
  padding: 0 0.2em;
}

input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  color: var(--fg);
  padding: 0 0.1em;
}

input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus {
  background: rgba(92, 200, 255, 0.15);
  color: var(--primary);
  outline: none;
  border-radius: 3px;
}

/* Focus states */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.1);
}

/* Select dropdown arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ab' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px;
  padding-right: 2.5rem;
  cursor: pointer;
}

[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6c7d' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

.vault-filter-select,
#admin-filter-status,
#admin-filter-type,
#vault-filter-status,
#vault-filter-type {
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  appearance: menulist;
  background-image: none;
  padding-right: 1rem;
}

/* File input styling */
input[type="file"] {
  padding: 0.5rem;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  padding: 0.5rem 1rem;
  margin-right: 1rem;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 0.95rem;
}

input[type="file"]::file-selector-button:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Placeholder styling */
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

/* Disabled state */
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--card);
}

/* Checkbox styling */
input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
  cursor: pointer;
  accent-color: var(--primary);
}

/* ─────────────────────────────── Availability Badge ────────────────────── */
.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  animation: fadeInUp 0.6s ease-out;
}

.availability-badge img {
  height: 32px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 4px 16px rgba(92, 200, 255, 0.5),
                0 0 20px rgba(92, 200, 255, 0.3);
  }
}

.availability-badge img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(92, 200, 255, 0.6);
  animation-play-state: paused;
}

/* ─────────────────────────────── Hero Section ──────────────────────────── */
.hero {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  margin-top: 24px;
  transition: all 0.3s ease;
}

.hero-with-bg {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(12, 18, 26, 0.7), rgba(12, 18, 26, 0.85)),
    url("/images/bg-hero.jpg") center/cover no-repeat;
}

.hero-columns {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: center;
  min-height: 280px;
}

.hero-copy h1 {
  margin-top: 0;
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-copy .tagline {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hero-photo img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  object-fit: cover;
  background: #0e141b;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: float-profile 6s ease-in-out infinite;
}

/* Floating Profile Animation */
@keyframes float-profile {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.hero-photo img:hover {
  transform: scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 12px 32px rgba(92, 200, 255, 0.2);
  animation-play-state: paused;
}

.tagline {
  color: var(--muted);
  max-width: 55ch;
  font-size: 1.1rem;
  line-height: 1.7;
}

.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ─────────────────────────────── Sections ──────────────────────────────── */
section {
  margin: 32px 0;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Fade-In Animation for Cards and Elements */
.card,
.skill-item,
.grid > *,
.columns > * {
  opacity: 0;
  animation: scrollFadeIn 0.6s ease-out forwards;
}

@keyframes scrollFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation delays for grid items */
.grid > *:nth-child(1),
.columns > *:nth-child(1) {
  animation-delay: 0.1s;
}

.grid > *:nth-child(2),
.columns > *:nth-child(2) {
  animation-delay: 0.2s;
}

.grid > *:nth-child(3),
.columns > *:nth-child(3) {
  animation-delay: 0.3s;
}

.grid > *:nth-child(4),
.columns > *:nth-child(4) {
  animation-delay: 0.4s;
}

.grid > *:nth-child(5),
.columns > *:nth-child(5) {
  animation-delay: 0.5s;
}

.grid > *:nth-child(6),
.columns > *:nth-child(6) {
  animation-delay: 0.6s;
}

.skill-item:nth-child(odd) {
  animation-delay: 0.1s;
}

.skill-item:nth-child(even) {
  animation-delay: 0.2s;
}

/* ─────────────────────────────── Cards ─────────────────────────────────── */
.card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  transition: all 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
  perspective: 1000px;
}

/* 3D Tilt Card Effect for Skill Cards */
.skills-grid .card {
  transform-style: preserve-3d;
}

.skills-grid .card:hover {
  transform: translateY(-4px) rotateX(2deg) rotateY(2deg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4),
              0 0 20px rgba(92, 200, 255, 0.2);
  border-color: rgba(92, 200, 255, 0.5);
}

/* Gradient Shift Card Effect for Contact Cards */
.contact-form .card,
section:has(.contact-form) .card {
  background: linear-gradient(135deg, var(--card) 0%, var(--card) 100%);
  background-size: 200% 200%;
  transition: all 0.3s ease, background-position 0.5s ease;
}

.contact-form .card:hover,
section:has(.contact-form) .card:hover {
  background: linear-gradient(135deg, var(--card) 0%, rgba(92, 200, 255, 0.05) 100%);
  background-size: 200% 200%;
  background-position: 100% 100%;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-color: rgba(92, 200, 255, 0.3);
}

.card h3 {
  margin-top: 0;
}

/* ─────────────────────────────── Grid Layouts ──────────────────────────── */
.grid {
  display: grid;
  gap: 16px;
}

.grid.cards {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* ─────────────────────────────── Forms ─────────────────────────────────── */
.contact-form {
  max-width: 720px;
}

label {
  display: block;
  margin: 1rem 0 0.5rem;
  font-weight: 500;
  color: var(--fg);
}

input,
textarea {
  width: 100%;
  padding: 12px;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* ─────────────────────────────── Form Status ───────────────────────────── */
#contact-status {
  margin-top: 1rem;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 500;
  display: none;
}

#contact-status:not(:empty) {
  display: block;
  animation: slideIn 0.3s ease-out;
}

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

#contact-status.success {
  background: rgba(45, 164, 78, 0.15);
  border-left: 3px solid var(--success);
  color: var(--success);
}

#contact-status.error {
  background: rgba(215, 58, 73, 0.15);
  border-left: 3px solid var(--error);
  color: var(--error);
}

/* ─────────────────────────────── Loading State ─────────────────────────── */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ─────────────────────────────── Lists ─────────────────────────────────── */
ul {
  padding-left: 1.5rem;
}

li {
  margin: 0.5rem 0;
}

/* ─────────────────────────────── Links ─────────────────────────────────── */
.link-button {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.link-button:hover {
  text-decoration: underline;
  color: var(--primary-dark);
}

/* ─────────────────────────────── Skill Tags ────────────────────────────── */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tag {
  padding: 6px 14px;
  background: rgba(92, 200, 255, 0.12);
  border: 1px solid rgba(92, 200, 255, 0.3);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 500;
  transition: all 0.2s ease;
}

.tag:hover {
  background: rgba(92, 200, 255, 0.2);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ─────────────────────────────── Skill Progress Bars ───────────────────── */
.skill-item {
  margin: 16px 0;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.skill-name {
  font-weight: 600;
  color: var(--fg);
  font-size: 0.95rem;
}

.skill-level {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.skill-bar {
  height: 8px;
  background: rgba(92, 200, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 4px;
  transition: width 1s ease-out;
  position: relative;
}

.skill-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

/* ─────────────────────────────── Card Footer ───────────────────────────── */
.card-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ─────────────────────────────── Footer ────────────────────────────────── */
footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-grid .social {
  display: flex;
  gap: 16px;
}

.footer-grid .social a {
  color: var(--muted);
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

/* Social Link Bounce Effect */
.footer-grid .social a:hover {
  color: var(--primary);
  transform: translateY(-4px);
  animation: bounce-link 0.6s ease;
}

@keyframes bounce-link {
  0%, 100% {
    transform: translateY(-4px);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ─────────────────────────────── Utilities ─────────────────────────────── */
.muted {
  color: var(--muted);
}

.lead {
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ─────────────────────────────── Responsive ────────────────────────────── */
@media (max-width: 1100px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }
  
  .nav {
    gap: 6px;
  }
  
  .nav a {
    padding: 6px 10px;
    font-size: 0.9rem;
  }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto auto;
  }

  .theme-toggle {
    grid-column: 2;
    grid-row: 1;
  }

  .menu-toggle {
    display: flex;
    grid-column: 3;
    grid-row: 1;
  }

  .nav {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    background: var(--card);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 70px 24px 24px;
    gap: 8px;
    z-index: 1000;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    animation: slideInRight 0.3s ease-out;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 12px 16px;
    text-align: left;
    font-size: 1rem;
    border-radius: 8px;
  }

  .nav a.button {
    margin-top: 16px;
    text-align: center;
  }

  .badge {
    display: none;
  }

  @keyframes slideInRight {
    from {
      transform: translateX(100%);
    }
    to {
      transform: translateX(0);
    }
  }

  /* Overlay when menu is open */
  body.menu-open::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    animation: fadeIn 0.3s ease-out;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}

@media (max-width: 800px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero-columns {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .availability-badge {
    justify-content: flex-start;
  }

  .hero-photo {
    order: -1;
    text-align: center;
  }

  .hero-photo img {
    width: 160px;
    height: 160px;
  }

  .cta-row {
    flex-direction: column;
  }

  .cta-row .button,
  .cta-row .secondary {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 16px;
  }

  .hero {
    padding: 20px;
  }

  .card {
    padding: 16px;
  }

  .grid.cards {
    grid-template-columns: 1fr;
  }
}


/* ─────────────────────────────── Vault Page ─────────────────────────────── */
.vault-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

.vault-hero-copy,
.vault-hero-panel {
  margin: 0;
}

.vault-kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.vault-session-note {
  margin-top: 1rem;
}

.vault-secondary-btn {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  box-shadow: none;
}

.vault-secondary-btn:hover {
  background: rgba(92, 200, 255, 0.12);
  box-shadow: none;
}

.vault-list {
  margin: 0;
  padding-left: 1.2rem;
}

.vault-overview-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.vault-dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.vault-stat-card {
  min-height: 152px;
}

.vault-stat-card h2 {
  margin: 0.4rem 0;
  color: var(--fg);
}

.vault-stat-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.vault-callout {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(92, 200, 255, 0.08);
  color: var(--fg);
}

.vault-callout.success {
  border-color: rgba(45, 164, 78, 0.4);
  background: rgba(45, 164, 78, 0.12);
}

.vault-callout.error {
  border-color: rgba(215, 58, 73, 0.45);
  background: rgba(215, 58, 73, 0.12);
}

.vault-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.vault-inline-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.vault-documents {
  display: grid;
  gap: 16px;
}

.vault-document-card {
  padding: 20px;
}

.vault-document-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.vault-document-header h3 {
  margin-bottom: 0.25rem;
}

.vault-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.vault-metrics-list {
  display: grid;
  gap: 12px;
}

.vault-metric-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: break-word;
  word-break: break-word;
}

.vault-metric-row > div:first-child {
  flex: 1;
  min-width: 0;
}

.vault-metric-row p {
  overflow-wrap: break-word;
  word-break: break-word;
}

.vault-metric-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.vault-metric-row:first-child {
  padding-top: 0;
}

.vault-metric-meta {
  text-align: right;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .vault-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .vault-document-header,
  .vault-metric-row {
    flex-direction: column;
  }

  .vault-metric-meta {
    text-align: left;
  }
}
/* ─────────────────────────────── Print Styles ──────────────────────────── */
@media print {
  .site-header,
  footer,
  .badge {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}



/* ─────────────────────────────── Vault Page ─────────────────────────────── */
.vault-hero {
  position: relative;
  overflow: hidden;
}

.vault-kicker {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.vault-secondary-btn {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(92, 200, 255, 0.35);
  box-shadow: none;
}

.vault-secondary-btn:hover {
  background: rgba(92, 200, 255, 0.12);
  box-shadow: none;
}

.vault-overview-grid,
.vault-dashboard-grid,
.vault-admin-grid {
  display: grid;
  gap: 16px;
}

.vault-overview-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.vault-dashboard-grid,
.vault-admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.vault-stat-card {
  min-height: 100%;
}

.vault-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.vault-section-heading h3 {
  margin: 0;
}

/* Vault list styling */
.vault-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.vault-list li {
  margin-bottom: 0.75rem;
}

.vault-list li:last-child {
  margin-bottom: 0;
}

/* Analytics details grid - two columns side by side */
.analytics-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 2rem;
}

.analytics-details-grid .card {
  padding: 20px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.analytics-details-grid h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.analytics-details-grid .vault-metrics-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Custom scrollbar styling for analytics sections */
.analytics-details-grid .vault-metrics-list::-webkit-scrollbar {
  width: 8px;
}

.analytics-details-grid .vault-metrics-list::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

.analytics-details-grid .vault-metrics-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
  transition: background 0.2s;
}

.analytics-details-grid .vault-metrics-list::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Firefox scrollbar styling */
.analytics-details-grid .vault-metrics-list {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg);
}

@media (max-width: 900px) {
  .analytics-details-grid {
    grid-template-columns: 1fr;
  }
}

.vault-documents,
.vault-admin-documents {
  display: grid;
  gap: 16px;
}

.vault-admin-documents {
  max-height: 600px;
  overflow-y: auto;
  padding-right: 8px;
}

/* Custom scrollbar styling for admin documents */
.vault-admin-documents::-webkit-scrollbar {
  width: 8px;
}

.vault-admin-documents::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

.vault-admin-documents::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.vault-admin-documents::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Firefox scrollbar styling */
.vault-admin-documents {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg);
}

.vault-document-card,
.vault-admin-document-card {
  min-height: 100%;
}

.vault-admin-document-card.is-expanded {
  border-color: rgba(92, 200, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(92, 200, 255, 0.35);
}

.vault-document-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.vault-document-header[data-action="toggle-admin-doc"] {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.vault-document-header[data-action="toggle-admin-doc"]:hover {
  background-color: rgba(92, 200, 255, 0.05);
  border-radius: 4px;
  margin: -4px;
  padding: 4px;
}

.vault-expand-icon {
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.2s ease;
  font-size: 0.8em;
  color: var(--color-primary, #5cc8ff);
}

.vault-meta-details {
  margin-top: 16px;
  animation: slideDown 0.3s ease;
}

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

.vault-inline-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Search and Filter Controls */
.vault-search-controls {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.vault-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  transition: border-color 0.2s ease;
  margin-bottom: 1rem;
}

.vault-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.1);
}

.vault-search-input::placeholder {
  color: var(--muted);
}

.vault-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.vault-filter-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.vault-filter-label span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
}

.vault-filter-select {
  padding: 0.625rem 0.875rem;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.vault-filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.1);
}

.vault-clear-btn {
  white-space: nowrap;
  align-self: flex-end;
}

.vault-document-card.vault-hidden,
.vault-admin-document-card.vault-hidden {
  display: none !important;
}

.vault-no-results {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 768px) {
  .vault-filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .vault-filter-label {
    min-width: 100%;
  }
  
  .vault-clear-btn {
    align-self: stretch;
  }
}

.vault-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.vault-break {
  word-break: break-all;
}

.vault-admin-note {
  margin-top: 14px;
}

.vault-callout {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(92, 200, 255, 0.08);
  color: var(--fg);
}

.vault-callout.success {
  background: rgba(45, 164, 78, 0.14);
  border-color: rgba(45, 164, 78, 0.35);
}

.vault-callout.error {
  background: rgba(215, 58, 73, 0.14);
  border-color: rgba(215, 58, 73, 0.35);
}

.vault-metrics-list {
  display: grid;
  gap: 12px;
}

.vault-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.vault-metric-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.vault-metric-meta {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: right;
}

.vault-admin-form {
  display: grid;
  gap: 16px;
}

.vault-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.vault-form-grid label,
.vault-admin-form label {
  margin: 0;
}

.vault-admin-form input,
.vault-admin-form textarea,
.vault-admin-form select {
  margin-top: 8px;
}

.vault-admin-form select {
  width: 100%;
  padding: 12px;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.vault-admin-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.1);
}

.vault-admin-form input[type="file"] {
  padding: 10px;
}

.vault-checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.vault-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 500;
}

.vault-inline-check input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}

@media (max-width: 700px) {
  .vault-document-header,
  .vault-metric-row,
  .vault-section-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .vault-metric-meta {
    text-align: left;
  }

  .vault-dashboard-grid,
  .vault-admin-grid,
  .vault-overview-grid,
  .vault-form-grid,
  .vault-meta-grid {
    grid-template-columns: 1fr;
  }

  .card-footer {
    flex-direction: column;
  }

  .card-footer .button,
  .card-footer button {
    width: 100%;
    text-align: center;
  }
}
