:root {
  --primary: #262627;
  --primary-dark: #423f3f;
  --secondary: #1f201f;
  --accent: #14b56d;
  --success: #4cf088;
  --danger: #f72585;
  --light: #e1e2e3;
  --dark: #343739;
  --gray: #6c757d;
  --border-radius: 12px;
  --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Tajawal', Arial, sans-serif;
  background-color: #dddde0;
  color: var(--dark);
  line-height: 1.6;
  padding: 20px;
  min-height: 100vh;
  font-size: clamp(16px, 4vw, 18px); /* تكبير الخط تلقائيًا حسب الشاشة */
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  background-color: rgb(255, 255, 255);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  position: relative;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* Header */
header {
  text-align: center;
  padding: 15px 0;
  margin-bottom: 20px;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(70, 65, 65);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  box-shadow: var(--box-shadow);
  margin-left: 10px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.logo:hover {
  transform: rotate(5deg) scale(1.05);
}

.logo i {
  font-size: 40px;
  color: var(--accent);
}

.logo-text {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -1px;
  position: relative;
}

.logo-text::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: right;
  transition: var(--transition);
}

.logo-container:hover .logo-text::after {
  transform: scaleX(1);
}

h1 {
  color: var(--primary-dark);
  font-size: clamp(22px, 5vw, 28px);
  margin-top: 8px;
  position: relative;
  display: inline-block;
  padding-bottom: 15px;
  font-weight: 700;
}

h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 50%;
  transform: translateX(50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}

/* Card */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 20px;
  transition: var(--transition);
  overflow: hidden;
  position: relative;
  border: 1px solid #e2e8f0;
  animation: fadeIn 0.5s ease-out;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
}

.card-header i {
  margin-left: 8px;
  color: var(--accent);
  font-size: 20px;
}

.card-title {
  font-size: 18px;
  color: var(--dark);
  font-weight: 600;
}

/* Form Elements */
.control-group {
  position: relative;
  margin-bottom: 15px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--dark);
  font-size: 14px;
  padding-right: 5px;
}

.select-wrapper {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.select-wrapper::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: var(--gray);
  pointer-events: none;
}

input, select, button {
  padding: 12px 15px 12px 35px;
  margin: 8px 0;
  border: none;
  border-radius: var(--border-radius);
  width: 100%;
  box-sizing: border-box;
  font-size: 1rem; /* نسبي */
  transition: var(--transition);
  outline: none;
}

select {
  color: var(--dark);
  background-color: white;
  appearance: none;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

select:focus {
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 3px rgba(19, 100, 221, 0.2);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
  padding: 14px 28px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
  animation: pulse 0.5s ease-in-out;
}

/* Options */
.option {
  padding: 15px 20px;
  margin: 8px 0;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  background-color: white;
  position: relative;
  font-size: 1rem; /* نسبي */
}

.option:hover {
  border-color: var(--accent);
  transform: translateX(-5px);
}

.option.selected {
  background-color: #f0f8ff;
  border-color: var(--accent);
  font-weight: bold;
}

.option.correct {
  background-color: rgba(76, 240, 136, 0.1);
  border-color: var(--success);
  color: #006d77;
}

.option.incorrect {
  background-color: rgba(247, 37, 133, 0.1);
  border-color: var(--danger);
  color: #9d0208;
}

.option.disabled {
  opacity: 0.7;
  pointer-events: none;
}

/* Controls */
.controls {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 12px;
}

.controls button {
  width: auto;
  padding: 12px 18px;
  font-size: 1rem;
}

/* Score Box */
#score-box {
  text-align: center;
  margin-top: 20px;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--dark);
  padding: 14px;
  background: #e2e8f0;
  border-radius: 8px;
  animation: pulse 2s infinite;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px 0;
  margin-top: 40px;
  color: var(--gray);
  border-top: 1px solid #E0E0E0;
  font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.02); }
            100% { transform: scale(1); }
        }
        
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
            20%, 40%, 60%, 80% { transform: translateX(5px); }
        }
        
        @keyframes shimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }
        
        @media (max-width: 768px) {
            .controls {
                grid-template-columns: 1fr;
            }
            
            .container {
                padding: 20px;
            }
            
            h1 {
                font-size: 1.6rem;
            }
            
            .navigation {
                flex-direction: column;
            }
            
            .option {
                padding: 12px 15px;
            }
        }

/* Media Queries */
@media (max-width: 768px) {
  body { font-size: 17px; padding: 15px; }
  h1 { font-size: 24px; }
  .option { font-size: 16px; padding: 14px 16px; }
  .controls button { font-size: 16px; padding: 14px 18px; }
}

@media (max-width: 480px) {
  body { font-size: 18px; padding: 10px; line-height: 1.7; }
  h1 { font-size: 22px; }
  .option { font-size: 17px; padding: 16px 18px; }
  .controls button { font-size: 17px; padding: 16px 20px; }
  #score-box { font-size: 1.3rem; padding: 16px; }
}
