/**
 * SDECB Portal v2 - Components CSS
 * Light theme with SDECB brand colors
 */

/* Base styles */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

[data-role="nav"] {
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Header - Navy background with glassmorphic effect */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 42, 74, 0.95); /* --deep-navy with transparency */
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%); /* Safari support */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: slideDown 0.35s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 12px rgba(237, 28, 46, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-inverse);
}

.brand-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

/* Navigation - Light links on navy */
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid transparent;
  transition: all 0.18s ease;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  color: var(--text-inverse);
  background: rgba(255, 255, 255, 0.1);
}

.nav a[aria-current="page"] {
  color: var(--text-inverse);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Pill (data source indicator) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: var(--font-sans);
  font-weight: 500;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--accent-red);
}

.btn.primary {
  background: var(--accent-red);
  color: var(--text-inverse);
  border-color: var(--accent-red);
}

.btn.primary:hover {
  background: var(--accent-red-hover);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.public {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.internal {
  background: var(--accent-red-light);
  color: var(--accent-red);
  border: 1px solid rgba(237, 28, 46, 0.3);
}

/* Cards - White on light background */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-red);
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 10px;
}

.card h2,
.card h3 {
  margin: 0;
  color: var(--charcoal);
}

/* Link Cards (clickable) */
a.card {
  text-decoration: none;
  display: block;
}

a.card:hover {
  border-color: var(--accent-red);
}

a.card .card-icon {
  margin-bottom: var(--space-3);
}

a.card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--charcoal);
}

a.card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Page layout */
.page {
  padding: 26px 0 64px;
  animation: fadeIn 0.25s ease;
}

/* Hero section */
.hero {
  padding: 22px 0 18px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--charcoal);
}

.hero p {
  margin: 0;
  color: var(--text-secondary);
}

/* Forms */
.form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

input[type="search"],
input[type="text"],
input[type="email"],
select,
textarea {
  flex: 1 1 220px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  font-family: var(--font-sans);
  font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px var(--accent-red-light);
}

select {
  flex: 0 0 220px;
  cursor: pointer;
}

/* Helper text */
small.help {
  color: var(--text-muted);
}

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

/* Icon system */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.icon svg {
  width: 100%;
  height: 100%;
}

.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 24px; height: 24px; }
.icon-lg { width: 32px; height: 32px; }
.icon-xl { width: 40px; height: 40px; }

.icon-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--accent-red-light);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}

.icon-container .icon {
  width: 24px;
  height: 24px;
}

/* Language toggle */
.lang-toggle {
  display: flex;
  gap: 4px;
}

.lang-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-inverse);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn:hover,
.lang-btn.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Footer */
.footer {
  background: var(--bg-header);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--space-6) 0;
  margin-top: 64px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.18s ease;
}

.footer a:hover {
  color: var(--text-inverse);
}

.footer .muted {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

/* Responsive */

/* Mobile Toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: white;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  margin-left: auto;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Mobile Nav Container */
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    background: rgba(11, 42, 74, 0.95);
    /* Deep Navy with transparency */
    padding: 0;
    gap: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav.is-open {
    max-height: 500px;
    /* Arbitrary large height */
    opacity: 1;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav a {
    display: flex;
    padding: 12px 16px;
    border-radius: 8px;
    width: 100%;
    font-size: 15px;
    justify-content: space-between;
  }

  .nav a:hover,
  .nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.1);
  }

  /* Language toggle in mobile menu */
  .nav .btn[data-role="lang-toggle"] {
    margin-top: 12px;
    width: 100%;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
  }

  .card {
    padding: var(--space-4);
  }
  .hero h1 {
    font-size: 24px;
  }
}
