/**
 * ECCA Pledge System - Styles
 * 
 * Step Up For Students (SUFS) branded styles for the pledge system.
 * 
 * Brand Palette:
 * - Primary (Navy): #19284d
 * - Secondary (Red): #e11d38
 * - Primary Dark: #13203e
 * - Accent (Blue): #008fcc
 * - Accent Dark: #036f9e
 * - Text: #131720
 * - White: #ffffff
 * 
 * Design Principles:
 * - Clean, professional, trustworthy
 * - Mobile-first responsive design
 * - Accessible (WCAG 2.1 AA compliant)
 * - Fast loading (minimal CSS, no frameworks)
 */

/* ============================================================================
   CSS Variables for Brand Colors
   ============================================================================ */

:root {
  --primary: #19284d;
  --secondary: #e11d38;
  --primary-dark: #13203e;
  --accent: #008fcc;
  --accent-dark: #036f9e;
  --text: #131720;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --transition: all 0.2s ease;
}

/* ============================================================================
   Reset & Base Styles
   ============================================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, 
               Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  line-height: 1.6;
  color: var(--text);
  background-color: var(--gray-50);
}

/* ============================================================================
   Typography
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
}

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

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

strong {
  font-weight: 600;
  color: var(--primary-dark);
}

/* ============================================================================
   Layout
   ============================================================================ */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-narrow {
  max-width: 800px;
}

.container-form {
  max-width: 600px;
}

/* ============================================================================
   Header & Navigation
   ============================================================================ */

.header {
  background-color: var(--primary);
  color: var(--white);
  padding: 1.5rem 0;
  box-shadow: var(--shadow);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}

.logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav a {
  color: var(--white);
  font-weight: 500;
}

.nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ============================================================================
   Main Content
   ============================================================================ */

main {
  padding: 3rem 0;
  min-height: calc(100vh - 200px);
}

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 4rem 0;
  text-align: center;
  margin-bottom: 3rem;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  opacity: 0.95;
}

/* ============================================================================
   Cards
   ============================================================================ */

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}

.card-header {
  border-bottom: 2px solid var(--gray-100);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.card-subtitle {
  color: var(--gray-600);
  font-size: 0.95rem;
}

/* ============================================================================
   Forms
   ============================================================================ */

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-label-required::after {
  content: ' *';
  color: var(--secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 143, 204, 0.1);
}

.form-input::placeholder {
  color: var(--gray-400);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-help {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.form-error {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--error);
  font-weight: 500;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-dark);
  text-decoration: none;
}

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

.btn-secondary:hover:not(:disabled) {
  background-color: #c21830;
  text-decoration: none;
}

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

.btn-outline:hover:not(:disabled) {
  background-color: var(--primary);
  color: var(--white);
  text-decoration: none;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ============================================================================
   Alerts & Messages
   ============================================================================ */

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.alert-success {
  background-color: #d1fae5;
  border-color: var(--success);
  color: #065f46;
}

.alert-error {
  background-color: #fee2e2;
  border-color: var(--error);
  color: #991b1b;
}

.alert-warning {
  background-color: #fef3c7;
  border-color: var(--warning);
  color: #92400e;
}

.alert-info {
  background-color: #dbeafe;
  border-color: var(--accent);
  color: #1e40af;
}

/* ============================================================================
   Loading States
   ============================================================================ */

.loading {
  text-align: center;
  padding: 3rem 0;
}

.spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================================
   Tables
   ============================================================================ */

.table-container {
  overflow-x: auto;
  margin: 2rem 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table thead {
  background-color: var(--primary);
  color: var(--white);
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.table th {
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody tr:hover {
  background-color: var(--gray-50);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================================
   Badges & Status
   ============================================================================ */

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-error {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-info {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-corporate {
  background-color: #fce7f3;
  color: #831843;
}

/* ============================================================================
   Stats Grid (for Admin Dashboard)
   ============================================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.95rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================================
   Footer
   ============================================================================ */

.footer {
  background-color: var(--primary-dark);
  color: var(--white);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-content {
  text-align: center;
}

.footer a {
  color: var(--accent);
}

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

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  
  .hero {
    padding: 2rem 0;
  }
  
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .nav {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .table {
    font-size: 0.875rem;
  }
  
  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none !important; }
.visible { display: block; }

/* Screen reader only */
.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;
}

