/* ========================================
   AceBGCSE - Complete Stylesheet
   Professional Education Platform for Botswana Students
   ======================================== */

/* CSS Variables - Theme System */
:root {
  --primary: #00E5FF;
  --secondary: #5B7CFF;
  --accent: #00D4AA;
  --darkbg: #050914;
  --darkcard: #0a1020;
  --lightbg: #F8FAFC;
  --border-light: rgba(0, 0, 0, 0.05);
  --border-dark: rgba(255, 255, 255, 0.05);
  --text-dark: #050914;
  --text-light: #F8FAFC;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  letter-spacing: -0.01em;
  transition: var(--transition);
}

/* Light mode (default) */
body {
  background-color: var(--lightbg);
  color: var(--text-dark);
}

/* Dark mode */
html.dark body {
  background-color: var(--darkbg);
  color: var(--text-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 3.5rem;
  @media (max-width: 768px) {
    font-size: 2.25rem;
  }
}

h2 {
  font-size: 2.25rem;
  @media (max-width: 768px) {
    font-size: 1.875rem;
  }
}

h3 {
  font-size: 1.875rem;
  @media (max-width: 768px) {
    font-size: 1.5rem;
  }
}

h4 {
  font-size: 1.5rem;
}

p {
  font-size: 1rem;
  line-height: 1.75;
}

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

a:hover {
  opacity: 0.8;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 229, 255, 0.4);
}

.btn-secondary {
  background: rgba(0, 229, 255, 0.1);
  color: var(--primary);
  border: 1px solid rgba(0, 229, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: rgba(0, 229, 255, 0.1);
}

/* Cards */
.card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border-light);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

html.dark .card {
  background: var(--darkcard);
  border-color: var(--border-dark);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-text {
  font-size: 0.95rem;
  opacity: 0.85;
}

/* Grid System */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.grid {
  display: grid;
  gap: 2rem;
}

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

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

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

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Flexbox Utilities */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  flex-direction: column;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

/* Spacing */
.mt-4 {
  margin-top: 1rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.p-4 {
  padding: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: rgba(0, 229, 255, 0.1);
  color: var(--primary);
  border: 1px solid rgba(0, 229, 255, 0.2);
}

.badge-success {
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent);
  border-color: rgba(0, 212, 170, 0.2);
}

.badge-warning {
  background: rgba(255, 193, 7, 0.1);
  color: #FFC107;
  border-color: rgba(255, 193, 7, 0.2);
}

/* Input Fields */
input, textarea, select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  background: white;
  color: var(--text-dark);
}

html.dark input, html.dark textarea, html.dark select {
  background: var(--darkcard);
  color: var(--text-light);
  border-color: var(--border-dark);
}

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

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-group .error {
  color: #FF6B6B;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  border-left: 4px solid;
  margin-bottom: 1rem;
}

.alert-success {
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent);
  border-left-color: var(--accent);
}

.alert-error {
  background: rgba(255, 107, 107, 0.1);
  color: #FF6B6B;
  border-left-color: #FF6B6B;
}

.alert-info {
  background: rgba(0, 229, 255, 0.1);
  color: var(--primary);
  border-left-color: var(--primary);
}

.alert-warning {
  background: rgba(255, 193, 7, 0.1);
  color: #FFC107;
  border-left-color: #FFC107;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(0, 229, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Transitions */
.transition {
  transition: var(--transition);
}

.scale-on-hover:hover {
  transform: scale(1.05);
}

.lift-on-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  p {
    font-size: 0.95rem;
  }

  .container {
    padding: 0 1rem;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Mobile Navbar Fixes */
@media (max-width: 768px) {
  header {
    padding: 0.75rem 0;
  }
  
  header .max-w-7xl {
    padding: 0 1rem;
  }

  button, a {
    min-height: auto;
    min-width: auto;
  }

  #mobileMenu a {
    display: block;
    width: 100%;
    text-align: left;
  }

  /* Profile dropdown alignment on mobile */
  #profileDropdown {
    left: 0 !important;
    right: auto !important;
  }

  /* Better spacing for mobile nav */
  nav {
    padding: 0.5rem;
  }

  .flex.items-center.gap-2.sm\:gap-4 {
    gap: 0.5rem !important;
  }
}

/* Print Styles */
@media print {
  .no-print {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  a {
    color: #0066cc;
  }

  .card {
    page-break-inside: avoid;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--primary);
  color: white;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

html.dark ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 5px;
}

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