/* ===== CSS CUSTOM PROPERTIES (VARIABLES) ===== */
:root {
  /* Primary Blue Color Palette */
  --color-primary-50: #eff6ff;
  --color-primary-100: #dbeafe;
  --color-primary-200: #bfdbfe;
  --color-primary-300: #93c5fd;
  --color-primary-400: #60a5fa;
  --color-primary-500: #3b82f6;
  --color-primary-600: #2563eb;
  --color-primary-700: #1d4ed8;
  --color-primary-800: #1e40af;
  --color-primary-900: #1e3a8a;

  /* Dark Theme Colors */
  --color-dark-50: #f8fafc;
  --color-dark-100: #f1f5f9;
  --color-dark-200: #e2e8f0;
  --color-dark-300: #cbd5e1;
  --color-dark-400: #94a3b8;
  --color-dark-500: #64748b;
  --color-dark-600: #475569;
  --color-dark-700: #334155;
  --color-dark-800: #1e293b;
  --color-dark-900: #0f172a;
  --color-dark-950: #020617;

  /* Semantic Colors */
  --color-background: var(--color-dark-900);
  --color-surface: var(--color-dark-800);
  --color-text-primary: var(--color-dark-200);
  --color-text-secondary: var(--color-dark-300);
  --color-text-accent: var(--color-primary-800);
  --color-border: rgba(59, 130, 246, 0.2);
  --color-border-light: rgba(59, 130, 246, 0.1);

  /* Status Colors */
  --color-success: #10b981;
  --color-error: #ef4444;
  --color-warning: #f59e0b;
  --color-info: var(--color-primary-500);

  /* Gradients */
  --gradient-primary: linear-gradient(
    135deg,
    var(--color-primary-500),
    var(--color-primary-700)
  );
  --gradient-secondary: linear-gradient(
    135deg,
    var(--color-dark-600),
    var(--color-dark-700)
  );
  --gradient-background: linear-gradient(
    135deg,
    var(--color-dark-900),
    var(--color-dark-800),
    var(--color-dark-700)
  );

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  /* Shadows */
  --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);

  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.2s ease-in-out;
  --transition-slow: 0.3s ease-in-out;
}

/* ===== MODERN CSS RESET & BASE STYLES ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: var(--color-background);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== ENHANCED TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--color-text-accent);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.875rem);
  color: var(--color-primary-600);
}

/* ===== IMPROVED CONTAINER SYSTEM ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* ===== ENHANCED HEADER STYLES ===== */
header {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  min-height: 4rem;
}

.header-title {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== MODERN BUTTON SYSTEM ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.6);
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(135deg, #475569, #334155);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(71, 85, 105, 0.4);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #334155, #1e293b);
  box-shadow: 0 6px 20px 0 rgba(71, 85, 105, 0.6);
  transform: translateY(-2px);
}

/* ===== ENHANCED FORM STYLES ===== */
.form-container {
  max-width: 28rem;
  margin: 2rem auto;
  padding: 2rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3),
    0 10px 10px -5px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.form-container h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.875rem;
  font-weight: 800;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #cbd5e1;
  font-size: 0.875rem;
}

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #334155;
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: rgba(15, 23, 42, 1);
}

.form-input::placeholder {
  color: #9ca3af;
}

/* ===== ENHANCED HERO SECTION ===== */
.hero-section {
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%233b82f6' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 48rem;
  margin: 0 auto;
}

.hero-content h1 {
  margin-bottom: 1.5rem;
  animation: slideInUp 0.8s ease-out;
}

.hero-content p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin-bottom: 2.5rem;
  color: #1e40af;
  font-weight: 500;
  line-height: 1.7;
  animation: slideInUp 0.8s ease-out 0.2s both;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  animation: slideInUp 0.8s ease-out 0.4s both;
}

@media (min-width: 640px) {
  .hero-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 1.5rem;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ENHANCED SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 0;
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(59, 130, 246, 0.2);
}

.sidebar.open {
  width: 16rem;
}

.sidebar-content {
  padding: 1.5rem 0;
  padding-top: 5rem;
}

.sidebar a {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.5rem;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid transparent;
}

.sidebar a:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  border-left-color: #3b82f6;
}

.sidebar .close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #cbd5e1;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.sidebar .close-btn:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

/* ===== MENU ICON ===== */
.menu-icon {
  font-size: 1.5rem;
  cursor: pointer;
  color: #1d4ed8;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.menu-icon:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.1);
}

/* ===== MAIN CONTENT ===== */
#main-content {
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1rem;
  min-height: calc(100vh - 5rem);
  padding-bottom: 6rem;
}

/* ===== MESSAGE STYLES ===== */
.message {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  text-align: center;
  font-weight: 500;
  border: 1px solid transparent;
}

.message.success {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  border-color: #10b981;
}

.message.error {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
  border-color: #ef4444;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  background: linear-gradient(135deg, #0f172a, #020617);
  color: #e2e8f0;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
}

/* ===== LOADING ANIMATIONS ===== */
.loading-shimmer {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ===== ENHANCED RESPONSIVE DESIGN (MOBILE FIRST) ===== */

/* Mobile First - Base styles for mobile */
@media (max-width: 639px) {
  .container {
    padding: 0 0.75rem;
  }

  .hero-section {
    padding: 1.5rem 0.75rem;
    min-height: calc(100vh - 3rem);
  }

  .form-container {
    margin: 1rem;
    padding: 1.5rem;
  }

  .btn {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }

  .hero-buttons .btn {
    min-width: 200px;
  }
}

/* Small tablets and large phones */
@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }

  .btn {
    width: auto;
    min-width: 120px;
  }
}

/* Tablets */
@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }

  .sidebar {
    width: 16rem;
    position: relative;
  }

  #main-content {
    margin-left: 16rem;
  }

  .menu-icon,
  .close-btn {
    display: none;
  }

  .hero-section {
    padding: 4rem 2rem;
  }
}

/* Small desktops */
@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }

  .hero-section {
    padding: 6rem 2rem;
  }
}

/* Large desktops */
@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for better accessibility */
.btn:focus,
.form-input:focus,
.sidebar a:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn-primary {
    background: #1d4ed8;
    border: 2px solid #1e40af;
  }

  .form-input {
    border-width: 2px;
  }
}

/* ===== UTILITY CLASSES ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== SWEETALERT2 CUSTOMIZATION ===== */
.swal2-container {
  z-index: 1050 !important;
}

.swal2-popup {
  border-radius: 1rem !important;
  border: 1px solid rgba(59, 130, 246, 0.2) !important;
}

.swal2-confirm {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
  border-radius: 0.75rem !important;
}
