/**
 * 🧩 Components CSS - المكونات
 * التاج بلس للديكور
 * 
 * هذا الملف يحتوي على:
 * - Buttons
 * - Cards
 * - Services
 * - Forms
 * - Alerts
 * - وجميع المكونات القابلة لإعادة الاستخدام
 */

/* ========================================
   Buttons - الأزرار
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-bold);
  font-size: 15px;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

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

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-light {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.btn-light:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-gold {
  background: linear-gradient(135deg, #f5b253, #f59f53);
  color: #431239;
  box-shadow: 0 16px 32px -18px rgba(245, 178, 83, 0.65);
}

.btn-gold:hover {
  transform: translateY(-3px);
}

.btn-lg {
  padding: 14px 32px;
  font-size: var(--text-lg);
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--text-sm);
}

/* ========================================
   Cards - البطاقات
   ======================================== */

/* Service Card */
.service-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 340px;
  box-shadow: 0 28px 60px -36px rgba(74, 22, 61, 0.45);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  background: #160912;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    185deg,
    rgba(12, 5, 16, 0.15) 0%,
    rgba(38, 10, 36, 0.4) 45%,
    rgba(67, 18, 57, 0.78) 100%
  );
  z-index: 1;
  transition: background 0.4s ease;
}

.service-card__link {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.service-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.5s ease;
}

.service-card__text {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px 26px;
  display: grid;
  gap: 12px;
  color: #fff;
  text-align: start;
}

.service-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
  padding: 6px 18px;
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.4px;
  width: fit-content;
}

.service-card__title {
  font-size: 22px;
  font-weight: var(--font-weight-black);
  line-height: 1.4;
}

.service-card__excerpt {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.4s ease, margin-top 0.4s ease;
}

.service-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: var(--font-weight-bold);
  font-size: 14px;
  color: #ffe6f3;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.4s ease;
}

.service-card__cta i {
  font-size: 13px;
  transition: transform 0.35s ease;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 34px 70px -30px rgba(74, 22, 61, 0.55);
}

.service-card:hover::before {
  background: linear-gradient(
    185deg,
    rgba(32, 9, 29, 0.18) 0%,
    rgba(68, 25, 59, 0.55) 50%,
    rgba(123, 51, 102, 0.88) 100%
  );
}

.service-card:hover .service-card__image {
  transform: scale(1.12);
}

.service-card:hover .service-card__excerpt {
  max-height: 100px;
  opacity: 1;
  margin-top: 0.5rem;
}

.service-card:hover .service-card__cta {
  max-height: 50px;
  opacity: 1;
  margin-top: 0.75rem;
  transform: translateX(-6px);
  color: var(--accent);
}

.service-card:hover .service-card__cta i {
  transform: translateX(-4px);
}

/* Promo Card */
.promo-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  display: grid;
  gap: 18px;
}

.promo-showcase {
  background: linear-gradient(135deg, #fef9ff, #f0deef);
  align-content: start;
}

.promo-showcase img {
  border-radius: var(--radius-lg);
}

.promo-showcase h3 {
  font-size: 22px;
  font-weight: var(--font-weight-black);
}

.promo-showcase p {
  color: var(--muted);
}

.promo-cta {
  background: linear-gradient(135deg, #742d60, #4a163d);
  color: #fff;
  text-align: center;
  align-content: center;
}

.promo-cta p {
  color: rgba(255, 255, 255, 0.78);
}

/* Project Card */
.project-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.project-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.project-card__body {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.project-card__title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-black);
  color: var(--primary-dark);
}

.project-card__description {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.7;
}

/* ========================================
   Forms - النماذج
   ======================================== */
.form-field {
  display: grid;
  gap: 8px;
  font-weight: var(--font-weight-medium);
  color: var(--primary-dark);
}

.form-field label {
  font-weight: var(--font-weight-medium);
  color: var(--primary-dark);
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--text);
  background: var(--surface);
  transition: all var(--transition-base);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(115, 45, 96, 0.18);
}

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

.form-field--full {
  grid-column: 1 / -1;
}

/* Form Status */
.form-status {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  text-align: center;
}

.form-status--success {
  background: var(--success-light);
  color: var(--success);
}

.form-status--error {
  background: var(--error-light);
  color: var(--error);
}

.form-status--info {
  background: var(--info-light);
  color: var(--info);
}

/* ========================================
   Badges & Tags - الشارات والوسوم
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.3px;
}

.badge-primary {
  background: rgba(115, 45, 96, 0.12);
  color: var(--primary);
}

.badge-accent {
  background: rgba(245, 178, 83, 0.12);
  color: var(--accent-dark);
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  background: rgba(115, 45, 96, 0.12);
  color: var(--primary);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-sm);
  letter-spacing: 0.4px;
  width: fit-content;
}

/* Tag Variants */
.tag--light {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 600;
}

.tag--light-enhanced {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 600;
}

/* ========================================
   Hero Stats - إحصائيات البطل
   ======================================== */
.hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-stats .stat {
  min-width: 160px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 18px 24px;
  text-align: center;
}

.hero-stats .stat span {
  display: block;
  font-size: 28px;
  font-weight: var(--font-weight-black);
  margin-bottom: 6px;
}

/* ========================================
   Grids - الشبكات
   ======================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

.promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

/* ========================================
   Loading States - حالات التحميل
   ======================================== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(115, 45, 96, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   Lazy Loading - التحميل الكسول
   ======================================== */
.lazy-loading {
  opacity: 0.6;
  filter: blur(4px);
}

.lazy-loaded {
  opacity: 1;
  filter: blur(0);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.lazy-error {
  opacity: 0.5;
  filter: grayscale(100%);
}

/* ========================================
   Alerts - التنبيهات
   ======================================== */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: var(--font-weight-medium);
}

.alert-success {
  background: var(--success-light);
  color: var(--success);
  border-left: 4px solid var(--success);
}

.alert-warning {
  background: var(--warning-light);
  color: var(--warning);
  border-left: 4px solid var(--warning);
}

.alert-error {
  background: var(--error-light);
  color: var(--error);
  border-left: 4px solid var(--error);
}

.alert-info {
  background: var(--info-light);
  color: var(--info);
  border-left: 4px solid var(--info);
}

/* ========================================
   Tooltips - تلميحات الأدوات
   ======================================== */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  background: var(--primary-dark);
  color: #fff;
  font-size: var(--text-xs);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  z-index: var(--z-tooltip);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ========================================
   Dividers - الفواصل
   ======================================== */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 24px 0;
}

.divider-thick {
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary),
    transparent
  );
}

/* ========================================
   Services - الخدمات
   ======================================== */
.services {
  background: var(--soft);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

.service-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 340px;
  box-shadow: 0 28px 60px -36px rgba(74, 22, 61, 0.45);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  background: #160912;
  cursor: pointer;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    185deg,
    rgba(12, 5, 16, 0.15) 0%,
    rgba(38, 10, 36, 0.4) 45%,
    rgba(67, 18, 57, 0.78) 100%
  );
  z-index: 1;
  transition: background 0.4s ease;
}

.service-card__link {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.service-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.5s ease;
}

.service-card__text {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px 26px;
  display: grid;
  gap: 12px;
  color: #fff;
  text-align: start;
}

.service-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
  padding: 6px 18px;
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.4px;
  width: fit-content;
}

.service-card__title {
  font-size: 22px;
  font-weight: var(--font-weight-black);
  line-height: 1.4;
}

.service-card__excerpt {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.4s ease, margin-top 0.4s ease;
}

.service-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: var(--font-weight-bold);
  font-size: 14px;
  color: #ffe6f3;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.4s ease;
}

.service-card__cta i {
  font-size: 13px;
  transition: transform 0.35s ease;
}

/* Service Card Hover States */
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 34px 70px -30px rgba(74, 22, 61, 0.55);
}

.service-card:hover::before {
  background: linear-gradient(
    185deg,
    rgba(32, 9, 29, 0.18) 0%,
    rgba(68, 25, 59, 0.55) 50%,
    rgba(123, 51, 102, 0.88) 100%
  );
}

.service-card:hover .service-card__image {
  transform: scale(1.12);
}

.service-card:hover .service-card__excerpt {
  max-height: 100px;
  opacity: 1;
  margin-top: 0.5rem;
}

.service-card:hover .service-card__cta {
  max-height: 50px;
  opacity: 1;
  margin-top: 0.75rem;
  transform: translateX(-6px);
  color: var(--accent);
}

.service-card:hover .service-card__cta i {
  transform: translateX(-4px);
}

/* Services Actions */
.services-actions {
  margin-top: 36px;
  text-align: center;
}

/* ========================================
   Projects - المشاريع
   ======================================== */
.projects {
  background: var(--surface);
  padding: 5rem 0;
}

.projects .container {
  max-width: 1400px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  margin-top: 3rem;
}

.project-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 310px;
  color: #fff;
  box-shadow: 0 24px 52px rgba(54, 29, 53, 0.28);
  transition: transform 0.45s ease, box-shadow 0.45s ease;
  cursor: pointer;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    195deg,
    rgba(18, 8, 22, 0.1) 0%,
    rgba(33, 12, 28, 0.32) 42%,
    rgba(12, 4, 11, 0.82) 100%
  );
  z-index: 1;
  transition: background 0.45s ease;
}

.project-card__link {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.project-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  transition: transform 1.5s ease;
  filter: saturate(108%);
}

.project-card__text {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 2.5rem 2rem;
  z-index: 2;
  display: grid;
  gap: 1rem;
}

.project-card__title {
  font-size: 1.75rem;
  font-weight: var(--font-weight-black);
  line-height: 1.3;
  color: white;
}

.project-card__meta {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: var(--font-weight-semibold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-card__meta::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.project-card__details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  display: grid;
  gap: 10px;
  transition: max-height 0.8s ease, opacity 0.45s ease;
}

.project-card__excerpt {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.95);
}

.project-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: var(--font-weight-bold);
  background: var(--accent);
  color: var(--primary-dark);
  border: none;
  width: fit-content;
  transition: all 0.35s ease;
}

.project-card__cta i {
  font-size: 12px;
  transition: transform 0.45s ease;
}

/* Project Card Hover States */
@media (hover: hover) and (pointer: fine) {
  .project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 32px 64px rgba(54, 29, 53, 0.38);
  }

  .project-card:hover::before {
    background: linear-gradient(
      205deg,
      rgba(18, 8, 22, 0.04) 0%,
      rgba(33, 12, 28, 0.28) 35%,
      rgba(12, 4, 11, 0.9) 100%
    );
  }

  .project-card:hover .project-card__image {
    transform: scale(1.18);
  }

  .project-card:hover .project-card__details {
    max-height: 260px;
    opacity: 1;
  }

  .project-card:hover .project-card__cta {
    background: var(--accent-dark);
    color: white;
    transform: translateY(-2px);
  }

  .project-card:hover .project-card__cta i {
    transform: translateX(-4px);
  }
}

/* Projects Actions */
.projects-actions {
  margin-top: 3rem;
  text-align: center;
}

/* Simple Project Card Variant */
.project-card.simple {
  background: var(--surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: grid;
  transition: all 0.4s ease;
  position: relative;
  min-height: auto;
  color: var(--text);
}

.project-card.simple::before {
  display: none;
}

.project-card.simple:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.project-card.simple img {
  height: 320px;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.4s ease;
}

.project-card.simple:hover img {
  transform: scale(1.05);
}

.project-card.simple .body {
  padding: 2rem;
}

.project-card.simple h4 {
  font-size: 1.5rem;
  font-weight: var(--font-weight-black);
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
}

.project-card.simple span {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: var(--font-weight-semibold);
}
