/* تحدي - أنماط مخصصة */

:root {
  --brand-cyan: #12c2e9;
  --brand-purple: #c471ed;
  --brand-pink: #f64f59;
  --brand-gradient: linear-gradient(135deg, var(--brand-cyan), var(--brand-purple), var(--brand-pink));
  
  /* New Design Colors */
  --orange-primary: #FF8C5A;
  --orange-light: #FF9E6D;
  --orange-dark: #FF7A45;
  --blue-info: #42A5F5;
  --blue-light-bg: #E3F2FD;
  --gray-bg: #F5F5F5;
  --orange-gradient: linear-gradient(135deg, #FF7A45 0%, #FF9E6D 100%);
}

/* تحسينات عامة */
* {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: var(--gray-bg);
  min-height: 100vh;
  color: #1f2937;
}

.gradient {
  background: var(--brand-gradient);
}

/* البطاقات */
.card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(18, 194, 233, 0.1);
}

/* الأزرار */
.btn {
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--brand-gradient);
  color: white;
  box-shadow: 0 2px 4px rgba(18, 194, 233, 0.2);
}

.btn-primary:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(18, 194, 233, 0.3);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

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

/* خيارات الأسئلة */
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: white;
  border: 2px solid #d1d5db;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(18, 194, 233, 0.05), rgba(196, 113, 237, 0.05));
  transition: width 0.3s ease;
  z-index: 0;
}

.option:hover::before {
  width: 100%;
}

.option:hover {
  border-color: var(--brand-cyan);
  transform: translateX(-4px);
  box-shadow: 0 2px 8px rgba(18, 194, 233, 0.2);
}

.option.selected {
  border-color: var(--brand-cyan);
  background: rgba(18, 194, 233, 0.05);
  box-shadow: 0 2px 8px rgba(18, 194, 233, 0.2);
}

.option.correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
  animation: correctPulse 0.6s ease;
}

.option.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
  animation: wrongShake 0.6s ease;
}

@keyframes correctPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--brand-gradient);
  border-radius: 12px;
  font-weight: 700;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
  z-index: 1;
}

.option-text {
  font-size: 18px;
  font-weight: 500;
  color: #374151;
  z-index: 1;
}

/* المؤقت */
#timer {
  font-variant-numeric: tabular-nums;
  animation: timerBounce 0.5s ease;
}

@keyframes timerBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* حقول الإدخال */
input[type="text"],
textarea {
  transition: all 0.3s ease;
}

input[type="text"]:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(18, 194, 233, 0.1);
}

/* الأيقونات */
.fas, .far {
  vertical-align: middle;
}

/* التأثيرات الحركية */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.option {
  animation: fadeIn 0.5s ease;
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease-out;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
  .option {
    padding: 16px 20px;
  }
  
  .option-text {
    font-size: 16px;
  }
  
  .option-letter {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  #timer {
    font-size: 2rem !important;
    padding: 12px 16px !important;
  }
}

/* Scrollbar مخصص */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
  background: var(--brand-gradient);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-pink));
}

/* Selection */
::selection {
  background: rgba(18, 194, 233, 0.2);
  color: #1f2937;
}

/* تأثيرات الاحتفال بالفوز */
@keyframes confetti {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

@keyframes trophy-bounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-30px) scale(1.1);
  }
}

@keyframes winner-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.5), 0 0 60px rgba(239, 68, 68, 0.3);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.animate-bounce {
  animation: trophy-bounce 1s ease-in-out infinite;
}

.animate-glow {
  animation: winner-glow 2s ease-in-out infinite;
}

/* ====== NEW DESIGN STYLES ====== */

/* Category Cards - New Design */
.category-card {
  background: var(--blue-light-bg);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.category-card-icon {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-light-bg);
  font-size: 48px;
}

.category-card-title {
  background: var(--orange-gradient);
  color: white;
  padding: 12px 16px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.category-info-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  background: var(--blue-info);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-info-btn:hover {
  background: #1E88E5;
  transform: scale(1.1);
}

/* Main Category Button */
.main-category-btn {
  background: var(--orange-gradient);
  color: white;
  padding: 14px 48px;
  border-radius: 32px;
  font-size: 24px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 138, 90, 0.3);
  transition: all 0.3s ease;
  margin: 24px auto;
  display: block;
}

.main-category-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 138, 90, 0.4);
}

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

/* Grid Layout for Categories */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 16px;
  }
  
  .category-card-icon {
    height: 100px;
    font-size: 36px;
  }
  
  .category-card-title {
    font-size: 14px;
    padding: 10px 12px;
  }
  
  .main-category-btn {
    font-size: 20px;
    padding: 12px 36px;
  }
}

/* Search Bar - New Design */
.search-container {
  max-width: 600px;
  margin: 24px auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 14px 24px 14px 56px;
  border-radius: 32px;
  border: 2px solid #E0E0E0;
  font-size: 18px;
  background: white;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--orange-primary);
  outline: none;
  box-shadow: 0 4px 12px rgba(255, 138, 90, 0.2);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: #E53935;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

/* Orange Button Style */
.btn-orange {
  background: var(--orange-gradient);
  color: white;
  padding: 12px 32px;
  border-radius: 28px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(255, 138, 90, 0.3);
  transition: all 0.3s ease;
}

.btn-orange:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(255, 138, 90, 0.4);
}

.btn-orange:active:not(:disabled) {
  transform: translateY(0);
}

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