/* Custom CSS for DSCPS website */

/* CSS Variables for consistent theming */
:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;
  --radius: 0.5rem;
}

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;
  --primary: 210 40% 98%;
  --primary-foreground: 222.2 47.4% 11.2%;
  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 212.7 26.8% 83.9%;
}

/* Base styles */
* {
  border-color: hsl(var(--border));
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

/* Custom component styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  transition: colors 0.2s;
  focus-visible:outline-none;
  focus-visible:ring-2;
  focus-visible:ring-ring;
  focus-visible:ring-offset-2;
  disabled:pointer-events-none;
  disabled:opacity-50;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  height: 2.5rem;
  padding: 0.5rem 1rem;
}

.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  height: 2.5rem;
  padding: 0.5rem 1rem;
}

.btn-outline {
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  height: 2.5rem;
  padding: 0.5rem 1rem;
}

.btn-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-ghost {
  color: hsl(var(--foreground));
  height: 2.5rem;
  padding: 0.5rem 1rem;
}

.btn-ghost:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-lg {
  height: 2.75rem;
  padding: 0.5rem 2rem;
  font-size: 1rem;
}

.btn-sm {
  height: 2rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

.btn-icon {
  height: 2.5rem;
  width: 2.5rem;
  padding: 0;
}

/* Card styles */
.card {
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.card-header {
  display: flex;
  flex-direction: column;
  space-y: 1.5rem;
  padding: 1.5rem 1.5rem 0;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
}

.card-description {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.card-content {
  padding: 1.5rem;
}

/* Input styles */
.input {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: colors 0.2s;
}

.input:focus {
  outline: none;
  ring: 2px;
  ring-color: hsl(var(--ring));
  border-color: hsl(var(--ring));
}

.input::placeholder {
  color: hsl(var(--muted-foreground));
}

/* Textarea styles */
.textarea {
  display: flex;
  min-height: 5rem;
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: colors 0.2s;
}

.textarea:focus {
  outline: none;
  ring: 2px;
  ring-color: hsl(var(--ring));
  border-color: hsl(var(--ring));
}

.textarea::placeholder {
  color: hsl(var(--muted-foreground));
}

/* Label styles */
.label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid transparent;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  transition: colors 0.2s;
}

.badge-default {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.badge-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.badge-outline {
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

/* Separator styles */
.separator {
  height: 1px;
  width: 100%;
  background-color: hsl(var(--border));
  margin: 1rem 0;
}

/* Utility classes */
.text-muted-foreground {
  color: hsl(var(--muted-foreground));
}

.bg-muted {
  background-color: hsl(var(--muted));
}

.bg-muted\/30 {
  background-color: hsl(var(--muted) / 0.3);
}

/* Hover effects */
.hover\:scale-105:hover {
  transform: scale(1.05);
}

.transition-transform {
  transition: transform 0.3s;
}

.transition-colors {
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

/* Line clamp utilities */
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Aspect ratio utilities */
.aspect-video {
  aspect-ratio: 16 / 9;
}

/* Backdrop blur support */
.supports-\[backdrop-filter\]:bg-white\/60 {
  background-color: rgba(255, 255, 255, 0.6);
}

.backdrop-blur {
  backdrop-filter: blur(8px);
}

/* Container utilities */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}

/* Mobile-specific improvements */
@media (max-width: 1023px) {
  /* Improve touch targets */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Better spacing for mobile cards */
  .card {
    margin-bottom: 0.5rem;
  }
  
  .card-header {
    padding: 1rem 1rem 0;
  }
  
  .card-content {
    padding: 1rem;
  }
  
  /* Improve mobile navigation */
  .mobile-nav-link {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
  }
  
  .mobile-nav-link:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
  }
  
  /* Better mobile typography */
  .card-title {
    font-size: 1.25rem;
  }
  
  /* Improve mobile stats display */
  .stats-grid {
    gap: 0.75rem;
  }
  
  .stats-card {
    padding: 0.75rem;
  }
  
  .stats-value {
    font-size: 1.5rem;
    line-height: 1.2;
  }
  
  .stats-title {
    font-size: 0.75rem;
    line-height: 1.2;
  }
}

/* Mobile navigation improvements */
@media (max-width: 1023px) {
  /* Smooth transitions for mobile nav */
  #mobile-nav {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
  }
  
  #mobile-nav-overlay {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  /* Mobile navigation links styling */
  #mobile-nav nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    color: #374151;
    font-weight: 500;
  }
  
  #mobile-nav nav a:hover {
    background-color: #f3f4f6;
    color: #111827;
  }
  
  #mobile-nav nav a.active {
    background-color: #dbeafe;
    color: #1d4ed8;
  }
  
  #mobile-nav nav a i {
    margin-right: 0.75rem;
    width: 1rem;
    height: 1rem;
  }
  
  /* Better mobile button styling */
  .btn-sm {
    min-height: 40px;
    padding: 0.5rem 0.75rem;
  }
  
  /* Improve mobile card spacing */
  .grid {
    gap: 0.75rem;
  }
  
  /* Better mobile text sizing */
  .text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
  
  .text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
  }
  
  /* Mobile menu button styling */
  #mobile-menu-btn {
    background-color: #3b82f6;
    color: white;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 50;
  }
  
  #mobile-menu-btn:hover {
    background-color: #2563eb;
  }
  
  /* Mobile header spacing to accommodate hamburger menu */
  .mobile-header-spacing {
    margin-left: 4rem; /* 64px - enough space for hamburger button + padding */
  }
  
  /* Mobile menu header spacing */
  #mobile-nav .mobile-header-spacing {
    margin-left: 4rem; /* 64px - consistent spacing for mobile menu header */
  }
  
  /* Homepage mobile menu button styling */
  #mobile-menu-btn {
    background-color: #000000;
    color: white;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 50;
  }
  
  #mobile-menu-btn:hover {
    background-color: #374151;
  }
  
  /* Homepage header spacing to accommodate hamburger menu */
  .homepage-header-spacing {
    margin-left: 4rem; /* 64px - enough space for hamburger button + padding */
  }
  
  /* Admin pages mobile menu button styling */
  #mobile-menu-btn {
    background-color: #000000;
    color: white;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 50;
  }
  
  #mobile-menu-btn:hover {
    background-color: #374151;
  }
  
  /* Admin pages header spacing to accommodate hamburger menu */
  .mobile-header-spacing {
    margin-left: 4rem; /* 64px - enough space for hamburger button + padding */
  }
  
  /* Mobile message cards improvements */
  .message-item {
    border-bottom: 1px solid #e5e7eb;
  }
  
  .message-item:last-child {
    border-bottom: none;
  }
  
  /* Ensure proper text truncation on mobile */
  .line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Dark mode mobile improvements */
@media (max-width: 1023px) {
  .dark .mobile-nav-link:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
  }
}
