/* Modern Corporate Institutional Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Tajawal:wght@300;400;500;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Professional Blue/Teal Corporate Palette */
  --primary-color: #0f4c75;
  --primary-hover: #0d3d5f;
  --secondary-color: #3282b8;
  --accent-color: #1b9aaa;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --light-bg: #f8f9fa;
  --dark-text: #1f2937;
  --border-color: #e5e7eb;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.15);

  /* Gradient Overlays */
  --gradient-primary: linear-gradient(135deg, rgba(15, 76, 117, 0.95), rgba(27, 154, 170, 0.85));
  --gradient-secondary: linear-gradient(135deg, rgba(50, 130, 184, 0.9), rgba(27, 154, 170, 0.8));
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--light-bg);
  min-height: 100vh;
  color: var(--dark-text);
  direction: ltr;
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* RTL Support for Arabic */
body.rtl {
  direction: rtl;
  text-align: right;
  font-family: 'Inter', 'Tajawal', sans-serif;
}

body.rtl button,
body.rtl input,
body.rtl textarea,
body.rtl select,
body.rtl .btn {
  font-family: 'Inter', 'Tajawal', sans-serif;
}

body.rtl .hero-top-row .hero-logo {
  order: 2;
}

body.rtl .hero-top-row .header-sponsors {
  order: 1;
}

body.rtl .lang-switcher {
    margin-left: 0 !important;
    margin-right: 20px !important;
}

body.rtl .feature {
    text-align: right;
}

body.rtl .info-box {
    border-left: none;
    border-right: 4px solid var(--warning-color);
    text-align: right;
}

body.rtl .form-label {
    text-align: right;
    display: block;
}

body.rtl .form-control {
    text-align: right;
}

body.rtl .back-link a {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 5px;
}

/* Container */
.container {
  max-width: 90%;
  margin: 0 auto;
  padding: 20px;
}

/* Card Styles */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 30px;
  margin: 20px 0;
}

.card-header {
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 15px;
  margin-bottom: 25px;
}

.card-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--dark-text);
}

.card-subtitle {
  font-size: 14px;
  color: var(--secondary-color);
  margin-top: 5px;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--dark-text);
  font-size: 14px;
}

.form-label.required::after {
  content: " *";
  color: var(--danger-color);
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: white;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(12, 59, 90, 0.1);
}

.form-control.error {
  border-color: var(--danger-color);
}

.form-control:disabled {
  background: var(--light-bg);
  cursor: not-allowed;
}

/* Select2 Theme Overrides – match .form-control exactly */
.select2-container {
  display: block !important;
  width: 100% !important;
}

.select2-container--default .select2-selection--single {
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: white;
  height: 48px;
  transition: all 0.3s ease;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--dark-text);
  font-size: 14px;
  line-height: 44px;
  padding-left: 15px;
  padding-right: 40px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #6b7280;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 44px;
  right: 12px;
}

/* Focus / open state */
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(12, 59, 90, 0.1);
}

/* Disabled state */
.select2-container--default.select2-container--disabled .select2-selection--single {
  background: var(--light-bg);
  cursor: not-allowed;
}

/* Dropdown panel */
.select2-dropdown {
  border: 2px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  margin-top: 2px;
}

.select2-results__option {
  padding: 10px 15px;
  font-size: 14px;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--primary-color);
}

/* Search field inside dropdown */
.select2-search--dropdown .select2-search__field {
  padding: 10px 15px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.select2-search--dropdown .select2-search__field:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(12, 59, 90, 0.1);
}

/* RTL support */
body.rtl .select2-container--default .select2-selection--single .select2-selection__rendered {
  text-align: right;
  padding-left: 40px;
  padding-right: 15px;
}

body.rtl .select2-container--default .select2-selection--single .select2-selection__arrow {
  right: auto;
  left: 12px;
}

.error-message {
  color: var(--danger-color);
  font-size: 12px;
  margin-top: 5px;
  display: none;
}

.error-message.show {
  display: block;
}

.form-help {
  font-size: 12px;
  color: var(--secondary-color);
  margin-top: 5px;
}

/* Button Styles */
.btn {
  padding: 12px 32px;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.3px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(15, 76, 117, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 76, 117, 0.3);
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(50, 130, 184, 0.2);
}

.btn-secondary:hover:not(:disabled) {
  background: #2571a3;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(50, 130, 184, 0.3);
}

.btn-success {
  background: var(--success-color);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 76, 117, 0.3);
}

.btn-block {
  width: 100%;
  display: block;
}

.btn-sm {
  padding: 8px 20px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 40px;
  font-size: 16px;
  font-weight: 600;
}

/* Hero Section Styles */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-primary);
  z-index: 1;
}

.hero-section.secondary::before {
  background: var(--gradient-secondary);
}

.hero-section.reduced {
  min-height: 30vh;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  max-width: 1000px;
  padding: 60px 20px;
}

.hero-title {
  font-size: 56px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 40px;
  opacity: 0.95;
  line-height: 1.6;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

.hero-cta .btn {
  min-width: 180px;
}

/* Responsive Hero Styles */
@media (max-width: 768px) {
  .hero-section {
    min-height: 50vh;
  }

  .hero-section.reduced {
    min-height: 25vh;
  }

  .hero-content {
    padding: 40px 20px;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn {
    width: 100%;
  }
}

/* Alert Styles */
.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: none;
}

.alert.show {
  display: block;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--danger-color);
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid var(--warning-color);
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid var(--primary-color);
}

/* Navigation */
.navbar {
  background: white;
  box-shadow: var(--shadow);
  padding: 15px 0;
  margin-bottom: 30px;
}

.navbar-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.navbar-menu {
  display: flex;
  gap: 20px;
  list-style: none;
}

.navbar-menu a {
  text-decoration: none;
  color: var(--dark-text);
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar-menu a:hover {
  color: var(--primary-color);
}

/* Table Styles */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.table thead {
  background: var(--light-bg);
}

.table th,
.table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  font-weight: 600;
  color: var(--dark-text);
}

.table tbody tr:hover {
  background: var(--light-bg);
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  overflow: auto;
}

.modal.show {
  display: block;
}

.modal-content {
  background: white;
  margin: 50px auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 20px 30px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  font-size: 28px;
  font-weight: 300;
  color: var(--secondary-color);
  cursor: pointer;
  background: none;
  border: none;
}

.modal-close:hover {
  color: var(--dark-text);
}

.modal-body {
  padding: 30px;
}

.modal-footer {
  padding: 20px 30px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Loading Spinner */
.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.loading-overlay.show {
  display: flex;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.mt-1 {
  margin-top: 10px;
}

.mt-2 {
  margin-top: 20px;
}

.mt-3 {
  margin-top: 30px;
}

.mb-1 {
  margin-bottom: 10px;
}

.mb-2 {
  margin-bottom: 20px;
}

.mb-3 {
  margin-bottom: 30px;
}

.p-1 {
  padding: 10px;
}

.p-2 {
  padding: 20px;
}

.p-3 {
  padding: 30px;
}

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.gap-1 {
  gap: 10px;
}

.gap-2 {
  gap: 20px;
}

.gap-3 {
  gap: 30px;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .card {
    padding: 20px;
  }

  .navbar-content {
    flex-direction: column;
    gap: 15px;
  }

  .navbar-menu {
    flex-direction: column;
    text-align: center;
  }

  .table {
    font-size: 12px;
  }

  .table th,
  .table td {
    padding: 8px;
  }

  .modal-content {
    width: 95%;
    margin: 20px auto;
  }
}

/* Sponsors Section */
.sponsors-section {
    display: none; /* Hide footer sponsors */
}

.header-sponsors {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    justify-content: center;
}

.header-sponsor-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.header-sponsor-logo:hover {
    transform: scale(1.05);
    background: white;
}

/* Adjust for different contexts */
.hero-content .header-sponsors {
    justify-content: center;
}

.login-hero .header-sponsors {
    justify-content: center;
}

@media (max-width: 768px) {
    .header-sponsor-logo {
        height: 30px;
    }
}
