/* css/enhanced-ui.css */
/* تحسينات إضافية للشفافية والفورمات */

/* ===== زيادة الشفافية للكروت ===== */
.card {
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.card:hover {
  background: rgba(15, 23, 42, 0.75) !important;
  border-color: rgba(24, 174, 243, 0.3) !important;
}

/* ===== تحسين الفورمات ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(10px);
  color: var(--text);
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 4px rgba(24, 174, 243, 0.15);
  background: rgba(15, 23, 42, 0.7);
  outline: none;
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* ===== تحسين كروت التقديمات ===== */
.application-card {
  padding: 28px;
  text-align: center;
  background: color-mix(in srgb, var(--surface-1) 88%, transparent) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.application-card:hover {
  transform: translateY(-8px);
  background: rgba(15, 23, 42, 0.75) !important;
  border-color: rgba(24, 174, 243, 0.25) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(24, 174, 243, 0.1);
}

.app-icon {
  font-size: 48px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.app-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.app-desc {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.6;
}

.app-requirements {
  text-align: right;
  background: rgba(0, 0, 0, 0.2);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.app-requirements h4 {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 10px;
  font-weight: 600;
}

.app-requirements ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.app-requirements li {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 0;
  padding-right: 20px;
  position: relative;
}

.app-requirements li::before {
  content: "✓";
  position: absolute;
  right: 0;
  color: var(--accent);
  font-size: 12px;
}

.app-apply-btn {
  width: 100%;
  padding: 14px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
}

/* ===== تحسين البطاقات الإحصائية ===== */
.stat-card {
  padding: 24px;
  text-align: center;
  background: rgba(15, 23, 42, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.stat-card:hover {
  background: rgba(15, 23, 42, 0.7) !important;
}

.stat-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* ===== تحسين Hero Section ===== */
.hero {
  padding: 80px 0 60px;
}

.hero-content {
  max-width: 600px;
}

.hero-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text) 0%, rgba(255,255,255,0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.hero-alert {
  background: rgba(234, 179, 8, 0.1) !important;
  border: 1px solid rgba(234, 179, 8, 0.3) !important;
  backdrop-filter: blur(10px);
  padding: 16px 20px;
  border-radius: 14px;
  margin-bottom: 28px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ===== تحسين الأزرار ===== */
.btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #0284c7 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(24, 174, 243, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(24, 174, 243, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

/* ===== تحسين page header ===== */
.page-header {
  padding: 50px 0 40px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.page-title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  margin-bottom: 12px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto;
}

/* ===== تحسين Section headers ===== */
.section {
  padding: 50px 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-head h2 {
  font-size: 22px;
  font-weight: 700;
}

.section-link {
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.section-link:hover {
  color: var(--accent);
}

/* ===== Grid improvements ===== */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ===== تحسين Alerts ===== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.alert-warning {
  background: rgba(234, 179, 8, 0.08);
  border-color: rgba(234, 179, 8, 0.25);
}

.alert-success {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.25);
}

.alert-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

/* ===== تحسين Testimonials ===== */
.testimonial-card {
  padding: 24px;
  background: rgba(15, 23, 42, 0.55) !important;
}

.testimonial-content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 18px;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(24, 174, 243, 0.3);
}

.testimonial-name {
  font-weight: 600;
  font-size: 14px;
}

.testimonial-role {
  font-size: 12px;
  color: var(--muted);
}

/* ===== تحسين News Cards ===== */
.news-card {
  background: color-mix(in srgb, var(--surface-1) 88%, transparent) !important;
  overflow: hidden;
}

.news-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.news-card-content {
  padding: 20px;
}

.news-card-category {
  display: inline-block;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
  margin-bottom: 10px;
}

.news-card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.news-card-excerpt {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

/* ===== تحسين Portfolio Cards ===== */
.portfolio-card {
  background: color-mix(in srgb, var(--surface-1) 88%, transparent) !important;
  overflow: hidden;
  position: relative;
}

.portfolio-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.portfolio-card:hover .portfolio-card-image {
  transform: scale(1.05);
}

.portfolio-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
}

.portfolio-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.portfolio-card-author {
  font-size: 13px;
  color: var(--muted);
}

/* ===== تحسين Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== Live Badge ===== */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ===== Responsive adjustments ===== */
@media (max-width: 768px) {
  .hero {
    padding: 50px 0 40px;
  }
  
  .hero-title {
    font-size: 26px;
  }
  
  .hero-cta {
    flex-direction: column;
  }
  
  .hero-cta .btn {
    width: 100%;
    text-align: center;
  }
  
  .section {
    padding: 35px 0;
  }
  
  .page-header {
    padding: 35px 0 30px;
  }
  
  .application-card {
    padding: 22px;
  }
  
  .stat-value {
    font-size: 26px;
  }
}

/* ===== تحسينات إضافية للنماذج ===== */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Select custom styling */
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' fill-opacity='0.5' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.762L10.825 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 40px;
}

/* Checkbox and Radio improvements */
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  width: auto;
  margin-inline-end: 10px;
  accent-color: var(--text);
}

/* File input improvements */
.form-group input[type="file"] {
  padding: 12px;
}

.form-group input[type="file"]::file-selector-button {
  padding: 10px 16px;
  margin-inline-end: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.form-group input[type="file"]::file-selector-button:hover {
  background: rgba(24, 174, 243, 0.25);
}

/* ===== Toast notifications styling ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 24px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  animation: toastSlideUp 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}

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

/* ===== Scrollbar styling ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ===== تحسين Tables ===== */
.table-container {
  overflow-x: auto;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 18px;
  text-align: right;
}

th {
  background: rgba(0, 0, 0, 0.3);
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}

tr:hover td {
  background: rgba(24, 174, 243, 0.05);
}

/* ===== Tabs styling ===== */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.5);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: rgba(24, 174, 243, 0.1);
  border-color: rgba(24, 174, 243, 0.2);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, #0284c7 100%);
  color: white;
  border-color: transparent;
}

/* ===== Badge styling ===== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-pending {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.badge-approved, .badge-accepted {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.badge-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.badge-admin {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.badge-moderator {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.badge-designer {
  background: rgba(236, 72, 153, 0.15);
  color: #ec4899;
}

.badge-user {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
}

/* ===== Light theme overrides (fix: cards/forms stuck in dark due to !important) ===== */
html[data-theme="light"] .card{
  background: rgba(255,255,255,0.72) !important;
  border-color: rgba(15,23,42,0.08) !important;
}
html[data-theme="light"] .card:hover{
  background: rgba(255,255,255,0.82) !important;
  border-color: rgba(2,132,199,0.28) !important;
}

html[data-theme="light"] .form-group input,
html[data-theme="light"] .form-group textarea,
html[data-theme="light"] .form-group select{
  background: rgba(255,255,255,0.68) !important;
  border-color: rgba(15,23,42,0.10) !important;
}
html[data-theme="light"] .form-group input:focus,
html[data-theme="light"] .form-group textarea:focus,
html[data-theme="light"] .form-group select:focus{
  background: rgba(255,255,255,0.88) !important;
  border-color: rgba(2,132,199,0.35) !important;
}
html[data-theme="light"] .form-group input::placeholder,
html[data-theme="light"] .form-group textarea::placeholder{
  color: rgba(15,23,42,0.45) !important;
}

html[data-theme="light"] .stat-card{
  background: rgba(255,255,255,0.65) !important;
  border-color: rgba(15,23,42,0.08) !important;
}
html[data-theme="light"] .stat-card:hover{
  background: rgba(255,255,255,0.78) !important;
}

html[data-theme="light"] .page-header{
  background: rgba(255,255,255,0.45) !important;
}

html[data-theme="light"] .app-requirements{
  background: rgba(255,255,255,0.55) !important;
}
