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

/* ==================== DESIGN TOKENS ==================== */
:root {
  /* Brand colors */
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-primary-hover: #1d4ed8;

  /* Neutral colors */
  --color-text: #1f2937;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-bg: #ffffff;
  --color-bg-secondary: #f9fafb;
  --color-bg-tertiary: #f1f5f9;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;

  /* Status colors */
  --color-success: #16a34a;
  --color-error: #dc2626;
  --color-warning: #d97706;
  --color-info: #2563eb;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== DARK MODE ==================== */
[data-theme="dark"] {
  --color-primary: #3b82f6;
  --color-primary-dark: #2563eb;
  --color-primary-light: #1e3a5f;
  --color-primary-hover: #2563eb;

  --color-text: #e2e8f0;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-bg: #0f172a;
  --color-bg-secondary: #1e293b;
  --color-bg-tertiary: #334155;
  --color-border: #334155;
  --color-border-hover: #475569;

  --color-success: #22c55e;
  --color-error: #ef4444;
  --color-warning: #f59e0b;
  --color-info: #3b82f6;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] body {
  background: var(--color-bg);
  color: var(--color-text);
}

[data-theme="dark"] .sticky-navbar {
  background: var(--color-bg-secondary);
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .bottom-nav {
  background: var(--color-bg-secondary);
  border-top-color: var(--color-border);
  border-right-color: var(--color-border);
}

[data-theme="dark"] .bottom-nav-btn {
  color: var(--color-text-muted);
}

[data-theme="dark"] .bottom-nav-btn:hover {
  color: var(--color-text);
  background-color: var(--color-bg-tertiary);
}

[data-theme="dark"] .bottom-nav-btn.active {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
}

[data-theme="dark"] .sidebar-toggle-btn {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

[data-theme="dark"] .sidebar-toggle-btn:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text);
}

/* ==================== BASE ==================== */
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  padding-bottom: 4.5rem;
  color: var(--color-text);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-primary: #000000;
    --text-secondary: #1f2937;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

* {
  scroll-behavior: smooth;
  box-sizing: border-box;
}

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* ==================== FIXED HEADER ==================== */
.sticky-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  height: 4rem;
}

main {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

@media (min-width: 1024px) {
  main {
    padding-top: 5rem;
  }
}

/* ==================== BOTTOM NAVIGATION ==================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  z-index: 50;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 0.75rem;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-width: 70px;
  flex: 1;
}

.bottom-nav-btn:hover {
  color: #475569;
  background-color: #f8fafc;
}

.bottom-nav-btn.active {
  color: #2563eb;
  background-color: #eff6ff;
}

.bottom-nav-btn.hidden {
  display: none !important;
}

.bottom-nav-btn.active::before {
  content: '';
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2.5rem;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.bottom-nav-btn i {
  transition: transform 0.25s ease;
}

.bottom-nav-btn.active i {
  transform: scale(1.1);
}

.bottom-nav-btn:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* Desktop: sidebar layout */
@media (min-width: 1024px) {
  :root {
    --sidebar-width: 170px;
  }

  body.sidebar-icon-only {
    --sidebar-width: 52px;
  }

  body.sidebar-hidden {
    --sidebar-width: 0px;
  }

  .bottom-nav {
    top: 4rem;
    bottom: 0;
    left: 0;
    right: auto;
    width: var(--sidebar-width);
    max-width: none;
    transform: none;
    height: calc(100vh - 4rem);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0.0625rem;
    padding: 2.75rem 0.5rem 1rem 0.5rem;
    border-top: none;
    border-right: 1px solid #e2e8f0;
    border-radius: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Stage 2: Icon Only */
  body.sidebar-icon-only .bottom-nav {
    padding: 2.75rem 0.25rem 1rem 0.25rem;
    align-items: center;
  }

  body.sidebar-icon-only .bottom-nav-btn {
    justify-content: center;
    padding: 0.375rem 0.25rem;
  }

  body.sidebar-icon-only .bottom-nav-btn span,
  body.sidebar-icon-only .bottom-nav-btn .badge,
  body.sidebar-icon-only .bottom-nav-btn [class*="badge-"] {
    display: none;
  }

  body.sidebar-icon-only .bottom-nav-btn.active::before {
    left: -0.5rem;
  }

  /* Stage 3: Hidden */
  body.sidebar-hidden .bottom-nav {
    width: 0;
    padding: 1.5rem 0;
    overflow: hidden;
    border-right: none;
  }

  body.sidebar-hidden .bottom-nav-btn,
  body.sidebar-hidden .bottom-nav-btn span,
  body.sidebar-hidden .bottom-nav-btn .badge {
    opacity: 0;
    pointer-events: none;
  }

  .sidebar-toggle-btn {
    position: fixed;
    left: 0.75rem;
    top: 4.5rem;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .sidebar-toggle-btn i {
    width: 0.75rem;
    height: 0.75rem;
  }

  .sidebar-toggle-btn.hidden {
    display: none !important;
  }

  .sidebar-toggle-btn:hover {
    background: #f1f5f9;
    color: #334155;
  }

  .bottom-nav-btn {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    min-width: auto;
    min-height: auto;
    width: 100%;
    flex: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
  }

  .bottom-nav-btn.active {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
  }

  .bottom-nav-btn.active::before {
    top: 50%;
    left: -0.625rem;
    transform: translateY(-50%);
    width: 0.25rem;
    height: 1rem;
    border-radius: 0 0.25rem 0.25rem 0;
  }

  body {
    padding-bottom: 0;
    overflow-x: hidden;
  }

  main {
    margin-left: var(--sidebar-width) !important;
    margin-right: 0 !important;
    max-width: none !important;
    width: calc(100% - var(--sidebar-width)) !important;
    min-width: 0;
    min-height: calc(100vh - 4rem);
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 3rem;
    overflow-x: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sticky-navbar .max-w-7xl {
    max-width: none;
  }
}

.sidebar-toggle-btn {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar-toggle-btn {
    display: flex;
  }
}

/* Mobile: settings via bottom nav only */
#btnSettings {
  display: flex;
}

#btnProfile.hidden {
  display: none;
}

@media (min-width: 1024px) {
  #btnSettings {
    display: none;
  }
}

/* ==================== PREMIUM TEMPLATE CARDS ==================== */
.template-card {
  padding: 0.75rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.template-card:hover {
  border-color: #d97706;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.12);
}

.template-card.ring-2 {
  background: #fffbeb;
  border-color: #f59e0b;
}

/* ==================== PORTFOLIO PREVIEW TEMPLATES ==================== */
.portfolio-preview {
  padding: 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.portfolio-modern {
  background: #ffffff;
  border-left: 5px solid #0f172a;
  color: #1f2937;
}

.portfolio-modern h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.portfolio-modern .tagline {
  color: #64748b;
  font-weight: 600;
  margin-bottom: 1rem;
}

.portfolio-modern .section-title {
  font-weight: 700;
  color: #0f172a;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.25rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.portfolio-minimal {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.portfolio-minimal h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.25rem;
}

.portfolio-minimal .tagline {
  color: #64748b;
  font-style: italic;
  margin-bottom: 1rem;
}

.portfolio-minimal .section-title {
  font-weight: 600;
  color: #475569;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.portfolio-creative {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  color: #451a03;
}

.portfolio-creative h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #92400e;
  margin-bottom: 0.25rem;
}

.portfolio-creative .tagline {
  color: #b45309;
  font-weight: 600;
  margin-bottom: 1rem;
}

.portfolio-creative .section-title {
  font-weight: 700;
  color: #92400e;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.portfolio-preview .skill-badge {
  display: inline-block;
  background: #e2e8f0;
  color: #334155;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  margin: 0.125rem;
}

/* ==================== PROFILE SUB-TABS ==================== */
.profile-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.625rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.profile-subnav-btn:hover {
  border-color: #bfdbfe;
  color: #2563eb;
  background: #f8fafc;
}

.profile-subnav-btn.active {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #93c5fd;
  color: #1d4ed8;
}

.profile-subnav-btn.hidden {
  display: none !important;
}

.profile-subnav-btn .admin-tab-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.625rem;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.profile-subnav-btn .admin-tab-badge.hidden {
  display: none !important;
}

/* ==================== SIDEBAR PORTAL ALUMNI ==================== */
.sidebar-portal-section {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.sidebar-portal-header {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  padding: 0 0.5rem 0.5rem;
}

.sidebar-portal-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 12rem;
  overflow-y: auto;
}

.sidebar-portal-empty {
  padding: 0.75rem 0.5rem;
  font-size: 0.6875rem;
  color: #94a3b8;
  text-align: center;
}

.sidebar-portal-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-portal-btn:hover {
  background: #f1f5f9;
  color: #2563eb;
}

.sidebar-portal-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.sidebar-portal-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-portal-school {
  font-size: 0.625rem;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-portal-section {
  margin-top: 0.75rem;
}

body.sidebar-hidden .sidebar-portal-section {
  display: none !important;
}

body.sidebar-icon-only .sidebar-portal-header,
body.sidebar-icon-only .sidebar-portal-label {
  display: none !important;
}

body.sidebar-icon-only .sidebar-portal-btn {
  justify-content: center;
  padding: 0.5rem 0.25rem;
}

@media (max-width: 1023px) {
  .sidebar-portal-section {
    display: none !important;
  }
}

/* ==================== UTILITIES ==================== */
/* Hide scrollbars globally but maintain scroll functionality */
.scrollbar-none::-webkit-scrollbar {
  display: none !important;
}

.scrollbar-none {
  -ms-overflow-style: none !important;  /* IE and Edge */
  scrollbar-width: none !important;  /* Firefox */
}
