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

:root {
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Theme variables - AVAH-UK Navy & Emerald Theme */
  --bg-primary: #0b1121; /* Deep Navy Background */
  --bg-secondary: #131c31; /* Lighter Navy */
  --bg-card: #1c263f; /* Card Background */
  --bg-card-hover: #2a3858;
  --border-color: #2a3858;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  /* Accent Colors */
  --brand-primary: #059669; /* Emerald Green */
  --brand-primary-hover: #047857;
  --brand-secondary: #1e3a8a; /* Deep Blue */
  --brand-secondary-hover: #1e40af;

  /* Compliance Colors */
  --color-green: #10b981;
  --color-green-soft: rgba(16, 185, 129, 0.15);
  --color-amber: #f59e0b;
  --color-amber-soft: rgba(245, 158, 11, 0.15);
  --color-red: #ef4444;
  --color-red-soft: rgba(239, 68, 68, 0.15);
  --color-grey: #6b7280;
  --color-grey-soft: rgba(107, 114, 128, 0.15);

  /* Shadows & Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 15px rgba(2, 132, 199, 0.3);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  --sidebar-width: 260px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-glow: 0 0 15px rgba(2, 132, 199, 0.15);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* App Shell Layout */
#app-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Landing Layout vs Admin Layout */
.landing-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

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

/* Sidebar Styling */
.sidebar {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: border-color var(--transition-normal);
}

@media (max-width: 900px) {
  .sidebar {
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
  }
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.sidebar-logo svg {
  width: 32px;
  height: 32px;
  color: var(--brand-primary);
}

.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-item:hover, .nav-item.active {
  color: var(--text-primary);
  background-color: var(--bg-card);
}

.nav-item.active {
  border-left: 3px solid var(--brand-primary);
  background-color: rgba(2, 132, 199, 0.1);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
}

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

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Button & Form Controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background-color: var(--brand-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background-color: var(--border-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
}

.btn-danger {
  background-color: var(--color-red);
  color: white;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-field {
  width: 100%;
  padding: 10px 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.input-field:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
}

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

.animate-fade-in {
  animation: fadeIn var(--transition-normal) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Glassmorphism Card Utility */
.glass-card {
  background-color: rgba(31, 41, 55, 0.5) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  transition: all var(--transition-normal);
}

[data-theme="light"] .glass-card {
  background-color: rgba(255, 255, 255, 0.75) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  box-shadow: 0 8px 32px 0 rgba(148, 163, 184, 0.1);
}

.glass-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--brand-primary) !important;
  box-shadow: var(--shadow-glow), 0 12px 40px 0 rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .glass-card:hover {
  box-shadow: var(--shadow-glow), 0 12px 40px 0 rgba(148, 163, 184, 0.15);
}

