/* ========================================
   صفحة التواصل - contact.html
   ======================================== */

:root {
  --gov-primary: #0D2D4A;
  --gov-secondary: #1A4971;
  --text-dark: #1A202C;
  --text-medium: #4A5568;
  --text-light: #FFFFFF;
  --bg-white: #FFFFFF;
  --bg-light: #F7FAFC;
  --border-light: #E2E8F0;
  --border-medium: #CBD5E0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #1e3a5f;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gov-primary), var(--gov-secondary));
  border-radius: 10px;
  border: 2px solid #0a1929;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--gov-secondary), var(--gov-primary));
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Tajawal', sans-serif;
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.6;
  direction: rtl;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  color: var(--gov-primary);
  font-weight: 700;
}

p {
  color: var(--text-medium);
}

a {
  color: var(--gov-primary);
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* شريط التنقل */
.navbar {
  background: linear-gradient(135deg, var(--gov-primary) 0%, var(--gov-secondary) 100%);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand h2 {
  color: var(--text-light);
  margin: 0;
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-menu a {
  color: rgba(255,255,255,0.9);
  font-weight: 500;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-light);
  margin: 3px 0;
}

/* Contact Header */
.contact-header {
  background: linear-gradient(135deg, var(--gov-primary) 0%, var(--gov-secondary) 100%);
  color: var(--text-light);
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact-header::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".1" fill="%23fff"/></svg>');
  background-size: cover;
  opacity: 0.1;
}

.contact-header-content {
  position: relative;
  z-index: 1;
}

.contact-header-icon {
  width: 100px;
  height: 100px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  border: 4px solid rgba(255,255,255,0.3);
}

.contact-header-icon svg {
  stroke: var(--text-light);
}

.contact-header-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.contact-header-description {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.9);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

/* قسم التواصل */
.contact-section {
  padding: 3rem 0;
}

.contact-wrapper {
  max-width: 1000px;
  margin: 0 auto;
}

/* Contact Info Cards */
.contact-info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.contact-info-card {
  background: var(--bg-white);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(13, 45, 74, 0.08);
  border: 1px solid rgba(13, 45, 74, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.contact-info-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--gov-primary), var(--gov-secondary));
  transition: height 0.3s;
}

.contact-info-card:hover {
  box-shadow: 0 12px 32px rgba(13, 45, 74, 0.15);
  transform: translateY(-8px);
}

.contact-info-card:hover::before {
  height: 6px;
}

.info-card-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, rgba(13, 45, 74, 0.1), rgba(26, 73, 113, 0.1));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  transition: all 0.4s;
}

.contact-info-card:hover .info-card-icon {
  background: linear-gradient(135deg, var(--gov-primary), var(--gov-secondary));
  transform: scale(1.1) rotate(5deg);
}

.info-card-icon svg {
  stroke: var(--gov-primary);
  transition: stroke 0.4s;
}

.contact-info-card:hover .info-card-icon svg {
  stroke: var(--text-light);
}

.contact-info-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--gov-primary);
}

.contact-info-card p {
  color: var(--text-medium);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 991px) {
  .contact-info-cards {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* نموذج التواصل */
.contact-form-container {
  background: var(--bg-white);
  border-radius: 1.25rem;
  padding: 3rem;
  box-shadow: 0 4px 20px rgba(13, 45, 74, 0.08);
  border: 1px solid rgba(13, 45, 74, 0.08);
  position: relative;
  overflow: hidden;
}

.contact-form-container::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(13, 45, 74, 0.02) 0%, rgba(26, 73, 113, 0.02) 100%);
  opacity: 0.5;
  z-index: 0;
}

.form-header {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

.form-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gov-primary);
  margin-bottom: 0.75rem;
}

.form-header p {
  color: var(--text-medium);
  font-size: 1rem;
  margin: 0;
}

.contact-form {
  position: relative;
  z-index: 1;
}

.form-group {
  margin-bottom: 1.75rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--text-dark);
  font-size: 0.9375rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group label .required {
  color: #F56565;
  font-weight: 800;
  margin-right: 0.25rem;
}

/* تنبيهات الحقول */
.form-group.error .form-control,
.form-group.error select,
.form-group.error textarea {
  border-color: #F56565;
  background: rgba(245,101,101,0.05);
  animation: shakeField 0.5s ease-out;
}

.form-group.error label {
  color: #F56565;
}

.form-group .field-error {
  display: none;
  color: #F56565;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(245,101,101,0.1);
  border-right: 3px solid #F56565;
  border-radius: 6px;
  animation: slideInRight 0.3s ease-out;
}

.form-group.error .field-error {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group .field-error::before {
  content: '⚠';
  font-size: 1rem;
  font-weight: bold;
}

.form-group.success .form-control,
.form-group.success select,
.form-group.success textarea {
  border-color: #48BB78;
  background: rgba(72,187,120,0.05);
}

.form-group.success .field-success {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #48BB78;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.form-group.success .field-success::before {
  content: '✓';
  font-weight: bold;
}

@keyframes shakeField {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
  20%, 40%, 60%, 80% { transform: translateX(8px); }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: 0.75rem;
  transition: all 0.3s;
  font-family: 'Tajawal', sans-serif;
}

/* تحسين موضع السهم في حقل select */
.form-group select {
  padding-right: 2.5rem;
  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='%230D2D4A' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* تحسين scrollbar للـ select (عند فتح القائمة) */
.form-group select option {
  padding: 0.75rem 1rem;
}

/* تنسيق الخيارات المعطلة */
.form-group select option:disabled {
  color: #94A3B8;
  background: #F1F5F9;
  cursor: not-allowed;
  font-style: italic;
}

/* Scrollbar نحيف وجميل - Webkit (Chrome, Safari, Edge) */
.form-group select::-webkit-scrollbar {
  width: 6px;
}

.form-group select::-webkit-scrollbar-track {
  background: #18446b;
  border-radius: 10px;
}

.form-group select::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gov-primary), var(--gov-secondary));
  border-radius: 10px;
  transition: background 0.3s ease;
}

.form-group select::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--gov-secondary), var(--gov-primary));
}

/* Scrollbar للـ Firefox */
.form-group select {
  scrollbar-width: thin;
  scrollbar-color: var(--gov-primary) #F7FAFC;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gov-primary);
  box-shadow: 0 0 0 4px rgba(13,45,74,0.1);
  transform: translateY(-2px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-medium);
  opacity: 0.6;
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.character-counter {
  text-align: left;
  font-size: 0.875rem;
  color: var(--text-medium);
  margin-top: 0.5rem;
}

.form-message {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  display: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  animation: slideInDown 0.4s ease-out;
}

.form-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: currentColor;
}

.form-message.success {
  background: linear-gradient(135deg, rgba(72,187,120,0.15) 0%, rgba(72,187,120,0.05) 100%);
  border: 2px solid #48BB78;
  color: #2F855A;
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-message.success::after {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #48BB78;
  color: white;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
  animation: scaleIn 0.5s ease-out 0.2s both;
}

.form-message.error {
  background: linear-gradient(135deg, rgba(245,101,101,0.15) 0%, rgba(245,101,101,0.05) 100%);
  border: 2px solid #F56565;
  color: #C53030;
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-message.error::after {
  content: '✕';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #F56565;
  color: white;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
  animation: shake 0.5s ease-out;
}

.form-message.warning {
  background: linear-gradient(135deg, rgba(237,137,54,0.15) 0%, rgba(237,137,54,0.05) 100%);
  border: 2px solid #ED8936;
  color: #C05621;
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-message.warning::after {
  content: '⚠';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #ED8936;
  color: white;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
  animation: pulse 1s ease-in-out infinite;
}

.form-message.info {
  background: linear-gradient(135deg, rgba(66,153,225,0.15) 0%, rgba(66,153,225,0.05) 100%);
  border: 2px solid #4299E1;
  color: #2C5282;
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-message.info::after {
  content: 'ℹ';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #4299E1;
  color: white;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
}

.form-message-content {
  flex: 1;
  text-align: right;
  line-height: 1.6;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    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 pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes messagePulse {
  0%, 100% { 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  50% { 
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    transform: scale(1.02);
  }
}

/* الأزرار */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.125rem 2rem;
  font-size: 1.0625rem;
  font-weight: 700;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Tajawal', sans-serif;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gov-primary) 0%, var(--gov-secondary) 100%);
  color: var(--text-light);
  width: 100%;
  box-shadow: 0 4px 16px rgba(13, 45, 74, 0.2);
}

.btn-primary svg {
  position: relative;
  z-index: 1;
  transition: transform 0.3s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(13, 45, 74, 0.3);
}

.btn-primary:hover svg {
  transform: translateX(5px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary:disabled::before {
  display: none;
}

/* معلومات التواصل */
.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.info-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}

.info-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.info-card i {
  font-size: 2rem;
  color: var(--gov-primary);
  margin-bottom: 1rem;
}

.info-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.info-card p {
  color: var(--text-medium);
  margin: 0;
}

/* رسائل النجاح/الخطأ */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  border-right: 4px solid;
}

.alert-success {
  background: rgba(72,187,120,0.1);
  border-color: #48BB78;
  color: #2F855A;
}

.alert-error {
  background: rgba(245,101,101,0.1);
  border-color: #F56565;
  color: #C53030;
}

/* التذييل */
.footer {
  background: linear-gradient(135deg, var(--gov-primary) 0%, #0a1f33 100%);
  color: var(--text-light);
  padding: 3rem 0 1rem;
  margin-top: auto;
}

.footer h1, .footer h2, .footer h3, .footer h4 {
  color: var(--text-light);
}

.footer p, .footer a {
  color: rgba(255,255,255,0.9);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

/* استجابة الموبايل */
@media (max-width: 767px) {
  .contact-header {
    padding: 3rem 0;
  }
  
  .contact-header-icon {
    width: 80px;
    height: 80px;
  }
  
  .contact-header-icon svg {
    width: 50px;
    height: 50px;
  }
  
  .contact-header-title {
    font-size: 2rem;
  }
  
  .contact-header-description {
    font-size: 1rem;
  }
  
  .contact-info-card {
    padding: 1.5rem;
  }
  
  .info-card-icon {
    width: 60px;
    height: 60px;
  }
  
  .info-card-icon svg {
    width: 24px;
    height: 24px;
  }
  .nav-menu {
    position: fixed;
    right: -100%;
    top: 60px;
    flex-direction: column;
    background: var(--gov-primary);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    padding: 2rem 0;
    z-index: 999;
  }
  
  .nav-menu.active {
    right: 0;
  }
  
  .hamburger {
    display: flex;
  }
  
  .contact-form-container {
    padding: 1.5rem;
  }
  
  .form-control {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
  }
  
  .btn {
    padding: 0.625rem 1.5rem;
  }
  
  .contact-info {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
