/* ========================================
   صفحة المكاتب - offices.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;
  --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);
}

.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;
}

/* Offices Header */
.offices-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;
}

.offices-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;
}

.offices-header-content {
  position: relative;
  z-index: 1;
}

.offices-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);
}

.offices-header-icon svg {
  stroke: var(--text-light);
}

.offices-header-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.offices-header-description {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.9);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

.offices-section {
  padding: 3rem 0;
}

.offices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (max-width: 991px) {
  .offices-grid {
    grid-template-columns: 1fr;
  }
}

.office-card {
  background: var(--bg-white);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(13, 45, 74, 0.08);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 1px solid rgba(13, 45, 74, 0.08);
}

.office-card::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;
  transition: opacity 0.5s;
  z-index: 0;
}

.office-card:hover {
  box-shadow: 0 20px 60px rgba(13, 45, 74, 0.2);
  transform: translateY(-12px) scale(1.02);
  border-color: rgba(13, 45, 74, 0.15);
}

.office-card:hover::before {
  opacity: 1;
}

.office-card-header {
  background: linear-gradient(135deg, var(--gov-primary) 0%, var(--gov-secondary) 100%);
  color: var(--text-light);
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.office-header-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 0%, transparent 50%);
  animation: headerPulse 4s ease-in-out infinite;
}

@keyframes headerPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.office-icon {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  position: relative;
  z-index: 1;
  border: 3px solid rgba(255,255,255,0.3);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transition: all 0.4s;
}

.office-card:hover .office-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

.office-icon svg {
  stroke: var(--text-light);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.office-card-header h3 {
  color: var(--text-light);
  margin: 0 0 0.75rem 0;
  font-size: 1.75rem;
  font-weight: 800;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
  text-align: center !important;
  width: 100%;
  display: block;
}

.office-badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.badge-main {
  background: rgba(255,255,255,0.25);
  color: var(--text-light);
  border: 2px solid rgba(255,255,255,0.4);
}

.badge-branch {
  background: rgba(255,255,255,0.2);
  color: var(--text-light);
  border: 2px solid rgba(255,255,255,0.3);
}

.office-card-body {
  padding: 2.5rem 2rem;
  position: relative;
  z-index: 1;
}

.office-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding: 1.25rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(13, 45, 74, 0.02) 0%, rgba(26, 73, 113, 0.02) 100%);
  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;
}

.office-info-item::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--gov-primary), var(--gov-secondary));
  transform: scaleY(0);
  transition: transform 0.4s;
}

.office-info-item:hover {
  background: linear-gradient(135deg, rgba(13, 45, 74, 0.05) 0%, rgba(26, 73, 113, 0.05) 100%);
  border-color: rgba(13, 45, 74, 0.15);
  transform: translateX(-4px);
  box-shadow: 0 4px 12px rgba(13, 45, 74, 0.08);
}

.office-info-item:hover::before {
  transform: scaleY(1);
}

.office-info-item:last-child {
  margin-bottom: 0;
}

.office-info-item svg {
  width: 22px;
  height: 22px;
  stroke: var(--gov-primary);
  flex-shrink: 0;
  margin-top: 0.25rem;
  transition: all 0.3s;
}

.office-info-item:hover svg {
  stroke: var(--gov-secondary);
  transform: scale(1.1);
}

.office-info-item .info-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.office-info-item .info-label {
  font-size: 0.875rem;
  color: var(--text-medium);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.office-info-item .info-value {
  color: var(--text-dark);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 500;
}

.phone-link {
  color: var(--gov-primary) !important;
  text-decoration: none;
  transition: all 0.3s;
  font-weight: 600;
}

.phone-link:hover {
  color: var(--gov-secondary) !important;
  text-decoration: none;
}

.office-card-footer {
  padding: 0 2rem 2rem;
  position: relative;
  z-index: 1;
}

.office-map-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--gov-primary) 0%, var(--gov-secondary) 100%);
  color: var(--text-light);
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(13, 45, 74, 0.2);
  position: relative;
  overflow: hidden;
}

.office-map-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;
}

.office-map-btn:hover::before {
  width: 300px;
  height: 300px;
}

.office-map-btn svg {
  stroke: var(--text-light);
  position: relative;
  z-index: 1;
  transition: transform 0.3s;
}

.office-map-btn span {
  position: relative;
  z-index: 1;
}

.office-map-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(13, 45, 74, 0.3);
}

.office-map-btn:hover svg:first-child {
  transform: scale(1.2);
}

.office-map-btn:hover svg:last-child {
  transform: translateX(-4px);
}

.office-map-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 45, 74, 0.25);
}

/* No Offices Placeholder */
.no-offices-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(247,250,252,0.95));
  border-radius: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  word-break: break-word;
}

.no-offices-placeholder::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(13, 45, 74, 0.03) 0%, transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}

.no-offices-placeholder .placeholder-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
  background: linear-gradient(135deg, rgba(13, 45, 74, 0.05), rgba(26, 73, 113, 0.05));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.no-offices-placeholder .placeholder-icon svg {
  stroke: var(--gov-secondary);
  opacity: 0.6;
}

.no-offices-placeholder h3 {
  font-size: 1.75rem;
  color: var(--gov-primary);
  margin-bottom: 1rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.no-offices-placeholder p {
  font-size: 1.125rem;
  color: var(--text-medium);
  line-height: 1.8;
  margin: 0 0 1.5rem 0;
  position: relative;
  z-index: 1;
  max-width: 100%;
  word-wrap: break-word;
  word-break: break-word;
  padding: 0 1rem;
}

.no-offices-placeholder .placeholder-hint {
  font-size: 1rem;
  color: var(--text-medium);
  margin-top: 1rem;
  position: relative;
  z-index: 1;
}

.no-offices-placeholder .placeholder-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, var(--gov-primary), var(--gov-secondary));
  color: var(--text-light);
  border-radius: 2rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 1.5rem;
  transition: all 0.3s;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 12px rgba(13, 45, 74, 0.2);
}

.no-offices-placeholder .placeholder-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 45, 74, 0.3);
}

.no-offices-placeholder .placeholder-btn svg {
  stroke: var(--text-light);
}

.no-offices-placeholder .placeholder-decoration {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem auto 0;
  position: relative;
  z-index: 1;
}

.no-offices-placeholder .decoration-circle {
  width: 8px;
  height: 8px;
  background: var(--gov-primary);
  border-radius: 50%;
  animation: bounce 1.5s ease-in-out infinite;
}

.no-offices-placeholder .decoration-circle:nth-child(2) {
  animation-delay: 0.2s;
}

.no-offices-placeholder .decoration-circle:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.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) {
  .offices-header {
    padding: 3rem 0;
  }
  
  .offices-header-icon {
    width: 80px;
    height: 80px;
  }
  
  .offices-header-icon svg {
    width: 50px;
    height: 50px;
  }
  
  .offices-header-title {
    font-size: 2rem;
  }
  
  .offices-header-description {
    font-size: 1rem;
  }
  
  .office-card-header {
    padding: 2rem 1.5rem;
  }
  
  .office-icon {
    width: 70px;
    height: 70px;
  }
  
  .office-icon svg {
    width: 35px;
    height: 35px;
  }
  
  .office-card-header h3 {
    font-size: 1.375rem;
  }
  
  .office-card-body {
    padding: 2rem 1.5rem;
  }
  
  .office-info-item {
    padding: 1rem;
    gap: 1rem;
  }
  
  .office-card-footer {
    padding: 0 1.5rem 1.5rem;
  }
  
  .no-offices-placeholder {
    padding: 2rem 1rem;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .no-offices-placeholder .placeholder-icon {
    width: 100px;
    height: 100px;
  }
  
  .no-offices-placeholder .placeholder-icon svg {
    width: 60px;
    height: 60px;
  }
  
  .no-offices-placeholder h3 {
    font-size: 1.5rem;
  }
  
  .no-offices-placeholder p {
    font-size: 0.95rem;
    padding: 0 0.5rem;
    max-width: 100%;
  }
  
  .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;
  }
  
  .offices-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
