/* Design System Variables */
:root {
  /* Primary brand colors */
  --primary: 187 58% 44%; /* #32A7B4 */
  --primary-light: 187 58% 94%; /* #E8F6F8 */
  --primary-dark: 187 58% 36%; /* #2A8E99 */
  --primary-foreground: 0 0% 100%;

  /* Secondary colors */
  --secondary: 32 100% 63%; /* #FF9F43 */
  --secondary-foreground: 0 0% 100%;

  /* Accent colors */
  --accent: 248 85% 70%; /* #6C63FF */
  --accent-foreground: 0 0% 100%;

  /* Neutral colors */
  --background: 210 20% 98%; /* #F8FAFC */
  --foreground: 220 39% 11%; /* #1E293B */
  --card: 0 0% 100%;
  --card-foreground: 220 39% 11%;

  /* Text colors */
  --text-light: 215 25% 40%; /* #64748B */
  --muted: 210 40% 96.1%;
  --muted-foreground: 215 25% 40%;

  /* UI elements */
  --border: 220 13% 91%; /* #E2E8F0 */
  --input: 220 13% 91%;
  --ring: 187 58% 44%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, hsl(187 58% 44%) 0%, hsl(187 58% 36%) 100%);
  --gradient-hero: linear-gradient(135deg, hsl(187 58% 44%) 0%, hsl(32 100% 63%) 100%);
  --gradient-subtle: linear-gradient(180deg, hsl(210 20% 98%) 0%, hsl(0 0% 100%) 100%);

  /* Shadows */
  --shadow-elegant: 0 10px 30px -10px hsl(187 58% 44% / 0.3);
  --shadow-glow: 0 0 40px hsl(187 58% 94% / 0.4);
  --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.05);

  /* Animations */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --radius: 0.75rem;
}

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

body {
  font-family: 'Tajawal', sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  direction: rtl;
  line-height: 1.6;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 10% 20%, hsl(187 58% 44% / 0.1) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, hsl(32 100% 63% / 0.1) 0%, transparent 20%);
}

/* Container */
.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Card Styles */
.card {
  background: hsl(var(--card));
  border-radius: 1.5rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  width: 100%;
  border: 1px solid hsl(var(--border) / 0.5);
}

/* Header */
.header {
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.1), transparent);
  pointer-events: none;
}

.header-content {
  position: relative;
  z-index: 10;
}

 .logo-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-bottom: 1.5rem;
      transition: all 0.5s ease;
    }

    .logo {
      width: 6rem;
      height: 6rem;
      background: hsl(var(--card));
      border-radius: 1.25rem;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 1rem;
      transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
      position: relative;
      overflow: hidden;
      cursor: pointer;
    }

    .logo::before {
      content: '';
      position: absolute;
      inset: -5px;
      border-radius: 1.5rem;
      background: var(--gradient-hero);
      z-index: -1;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .logo:hover {
      transform: translateY(-5px) rotate(5deg) scale(1.05);
      box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    }

    .logo:hover::before {
      opacity: 1;
    }

    .logo img {
      transition: all 0.5s ease;
      width: 90px;
      height: 90px;
      object-fit: contain;
      filter: brightness(1) sepia(0) hue-rotate(0deg) saturate(1);
    }

    .logo:hover img {
      filter: brightness(20) sepia(0.3) hue-rotate(180deg) saturate(1.5);
      transform: scale(1);
    }

    .logo-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      transition: all 0.5s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .logo:hover .logo-overlay {
      opacity: 1;
    }

    .logo-overlay img {
      width: 80%;
      height: 80%;
      object-fit: contain;
      filter: brightness(0) invert(1);
    }

.institution-name {
  font-size: 1.875rem;
  font-weight: 800;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
  margin-bottom: 0.5rem;
}

.institution-subtitle {
  font-size: 1rem;
  opacity: 0.9;
}

.form-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.form-subtitle {
  opacity: 0.9;
}

/* Form Navigation */
.form-navigation {
  display: flex;
  background: hsl(var(--background));
  border-bottom: 1px solid hsl(var(--border));
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.form-navigation::-webkit-scrollbar {
  display: none;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  min-width: 120px;
  position: relative;
  color: hsl(var(--text-light));
  font-weight: 500;
  gap: 0.5rem;
}

.nav-item.active {
  color: hsl(var(--primary));
  background: hsl(var(--primary-light));
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 3px;
  background: hsl(var(--primary));
  transition: var(--transition-smooth);
}

.nav-item.active::after {
  width: 100%;
}

.nav-item:hover {
  color: hsl(var(--primary));
  background: hsl(var(--primary-light) / 0.5);
}

.nav-icon {
  font-size: 1.25rem;
}

/* Form Content */
.form-content {
  padding: 2rem;
}

/* Form Section */
.form-section {
  background: hsl(var(--card));
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
  border: 1px solid hsl(var(--border) / 0.5);
  margin-bottom: 2rem;
  padding: 1.5rem;
  transition: var(--transition-smooth);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s forwards;
}

.form-section:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elegant);
}

.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.2s; }
.form-section:nth-child(3) { animation-delay: 0.3s; }
.form-section:nth-child(4) { animation-delay: 0.4s; }
.form-section:nth-child(5) { animation-delay: 0.5s; }
.form-section:nth-child(6) { animation-delay: 0.6s; }

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid hsl(var(--primary) / 0.2);
  position: relative;
}

.section-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: hsl(var(--primary-light));
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-icon i {
  color: hsl(var(--primary));
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--primary));
  position: relative;
}



.section-step {
  margin-right: auto;
  font-size: 0.875rem;
  color: hsl(var(--text-light));
  background: hsl(var(--primary-light));
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
}

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.col-span-2 {
  grid-column: span 2;
}

/* Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.form-label i {
  color: hsl(var(--primary));
}

.required {
  color: hsl(var(--destructive));
}

/* Form Inputs */
.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: var(--transition-smooth);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

.form-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
  transform: translateY(-2px);
}

.form-input::placeholder {
  color: hsl(var(--text-light) / 0.7);
}

.form-input:invalid:not(:focus):not(:placeholder-shown) {
  border-color: hsl(var(--destructive));
}

/* Error Messages */
.error-message {
  font-size: 0.75rem;
  color: hsl(var(--destructive));
  margin-top: 0.25rem;
  display: none;
}

.form-input:invalid:not(:focus):not(:placeholder-shown) ~ .error-message {
  display: block;
}

/* File Upload */
.file-upload-container {
  margin-bottom: 2rem;
}

.file-upload-area {
  border: 2px dashed hsl(var(--border));
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.file-upload-area:hover {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary-light) / 0.1);
}

.file-upload-area.dragover {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary-light) / 0.2);
  transform: scale(1.02);
}

.upload-icon {
  font-size: 3rem;
  color: hsl(var(--primary));
  margin-bottom: 1rem;
}

.upload-text {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

.upload-subtext {
  font-size: 0.875rem;
  color: hsl(var(--text-light));
  margin-bottom: 0.25rem;
}

.upload-hint {
  font-size: 0.75rem;
  color: hsl(var(--text-light) / 0.7);
  margin-bottom: 1rem;
}

.browse-link {
  color: hsl(var(--primary));
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-info {
  display: none;
  align-items: center;
  gap: 0.75rem;
  background: hsl(var(--primary-light));
  padding: 1rem;
  border-radius: 0.75rem;
  margin-top: 1rem;
  animation: fadeInUp 0.3s ease-out;
}

.file-icon {
  font-size: 1.5rem;
  color: hsl(var(--primary));
}

.file-details {
  flex: 1;
}

.file-name {
  font-weight: 600;
  color: hsl(var(--foreground));
}

.file-size {
  font-size: 0.75rem;
  color: hsl(var(--text-light));
}

.file-remove {
  cursor: pointer;
  color: hsl(var(--destructive));
  padding: 0.25rem;
}

.upload-progress {
  display: none;
  margin-top: 1rem;
  animation: fadeInUp 0.3s ease-out;
}

.progress-bar-container {
  width: 100%;
  height: 0.5rem;
  background: hsl(var(--border));
  border-radius: 1rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 1rem;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.875rem;
  color: hsl(var(--text-light));
  margin-top: 0.5rem;
  text-align: center;
}

.upload-success {
  display: none;
  align-items: center;
  gap: 0.5rem;
  color: hsl(142 76% 36%);
  background: hsl(142 76% 97%);
  padding: 1rem;
  border-radius: 0.75rem;
  margin-top: 1rem;
  animation: fadeInUp 0.3s ease-out;
}

/* Privacy Section */
.privacy-section {
  background: hsl(var(--primary-light) / 0.3);
  padding: 1.5rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
  border: 1px solid hsl(var(--primary) / 0.2);
}

.privacy-label {
  display: flex;
  gap: 0.75rem;
  cursor: pointer;
  align-items: flex-start;
}

.privacy-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.25rem;
  accent-color: hsl(var(--primary));
  flex-shrink: 0;
}

.privacy-text {
  flex: 1;
}

.privacy-text p {
  font-size: 0.875rem;
  color: hsl(var(--text-light));
  margin-top: 0.5rem;
}

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

.btn-primary {
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
  transform: translateY(0);
}

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

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

.btn-next, .btn-prev {
  min-width: 140px;
}

/* Section Navigation */
.section-navigation {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--border));
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
}

/* Footer */
.footer {
  background: hsl(var(--background));
  padding: 1.5rem 2rem;
  text-align: center;
  color: hsl(var(--text-light));
  font-size: 0.875rem;
  border-top: 1px solid hsl(var(--border));
}

.footer a {
  color: hsl(var(--primary));
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  inset: 0;
  background: hsl(var(--background));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}

.loading-spinner {
  text-align: center;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid hsl(var(--border));
  border-top: 3px solid hsl(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

/* Progress Bar */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0.25rem;
  background: transparent;
  z-index: 1000;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  width: 0%;
  transition: width 0.3s ease;
}

/* FAB */
.fab {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
  z-index: 100;
}

.fab:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: hsl(var(--card));
  border-radius: 1.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideInUp 0.3s ease-out;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: hsl(var(--text-light));
  padding: 0.25rem;
  border-radius: 0.375rem;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  background: hsl(var(--border));
  color: hsl(var(--foreground));
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}

.modal-body ul {
  list-style: none;
  margin-bottom: 1.5rem;
}

.modal-body li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: hsl(var(--foreground));
}

.modal-body a {
  color: hsl(var(--primary));
  text-decoration: none;
}

.modal-body a:hover {
  text-decoration: underline;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0.5rem;
  }
  
  .card {
    border-radius: 1rem;
  }
  
  .header {
    padding: 1.5rem;
  }
  
  .form-content {
    padding: 1rem;
  }
  
  .form-navigation {
    flex-wrap: wrap;
  }
  
  .nav-item {
    min-width: 100px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
  
  .col-span-2 {
    grid-column: span 1;
  }
  
  .form-section {
    padding: 1.25rem;
  }
  
  .section-navigation {
    flex-direction: column;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .file-upload-area {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .institution-name {
    font-size: 1.5rem;
  }
  
  .form-title {
    font-size: 1.5rem;
  }
  
  .nav-item {
    min-width: 80px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .section-step {
    margin-right: 0;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.visible {
  display: block;
}

.active {
  display: block;
}

/* Enhanced Styles */
.enhanced-container {
  perspective: 1000px;
}

.enhanced-card {
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.enhanced-header {
  position: relative;
  overflow: hidden;
}

.enhanced-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05),
    transparent
  );
  transform: rotate(30deg);
}

.enhanced-logo {
  position: relative;
  transition: all 0.5s ease;
}

.enhanced-logo::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 1.5rem;
  background: var(--gradient-primary);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.enhanced-logo:hover::before {
  opacity: 1;
}

.enhanced-form-group {
  position: relative;
}

.enhanced-form-group::before {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
  border-radius: 1px;
}

.enhanced-form-group:focus-within::before {
  width: 100%;
}

.enhanced-section {
  position: relative;
}

.enhanced-section::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 0;
  background: var(--gradient-primary);
  border-radius: 0 0.5rem 0.5rem 0;
  transition: height 0.5s ease;
}

.enhanced-section.active::before {
  height: 100%;
}

.enhanced-privacy {
  position: relative;
  overflow: hidden;
}

.enhanced-privacy::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
}

.enhanced-privacy:hover::before {
  animation: shimmer 1.5s infinite;
}

.enhanced-actions {
  position: relative;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Header Background Shapes */
.header-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  background: hsl(var(--primary-foreground));
}

.shape-1 {
  width: 200px;
  height: 200px;
  top: -50px;
  right: -50px;
}

.shape-2 {
  width: 150px;
  height: 150px;
  bottom: -30px;
  left: 20px;
}

.shape-3 {
  width: 100px;
  height: 100px;
  top: 50%;
  left: 30%;
}