/* ==========================================================================
   Contact Page — New Industrial Dark Design System (آنا نیرو)
   Matches Products, Solutions & Nova Product Theme
   ========================================================================== */

@font-face {
  font-family: 'Sahel';
  src: url('/static/Font/Sahel.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'Koodak';
  src: url('/static/Font/B_Koodak.ttf') format('truetype');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ana-bg-deep: #06111f;
  --ana-bg-darker: #030b18;
  --ana-surface: #0a1a2e;
  --ana-surface-alt: #081424;
  --ana-surface-input: #05101e;
  --ana-border: rgba(80, 140, 200, 0.26);
  --ana-border-subtle: rgba(255, 255, 255, 0.09);
  --ana-border-hover: rgba(0, 162, 255, 0.45);
  --ana-gold: #f5b800;
  --ana-gold-hover: #ffc400;
  --ana-cyan: #00a2ff;
  --ana-cyan-soft: #7ec8e3;
  --ana-text-white: #ffffff;
  --ana-text-body: #cbd5e1;
  --ana-text-muted: #94a3b8;
}

::selection {
  background-color: #ff8c00;
  color: #ffffff;
}

::-moz-selection {
  background-color: #ff8c00;
  color: #ffffff;
}

/* ==== Flash Messages ==== */
.flash-messages {
  direction: rtl;
  position: fixed;
  top: 96px;
  right: 24px;
  z-index: 9999;
  max-width: 400px;
  width: auto;
}

.flash-message {
  background: var(--ana-surface);
  color: var(--ana-text-white);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  animation: slideInRight 0.35s ease;
  border: 1px solid var(--ana-border);
  border-right: 4px solid;
  min-width: 280px;
  font-family: 'Sahel', 'Vazirmatn', sans-serif;
  font-size: 14.5px;
}

.flash-success {
  border-right-color: #22c55e;
}

.flash-success .material-icons {
  color: #22c55e;
}

.flash-error {
  border-right-color: #ef4444;
}

.flash-error .material-icons {
  color: #ef4444;
}

.flash-message .material-icons {
  font-size: 20px;
}

.flash-message.fade-out {
  animation: fadeOut 0.4s ease forwards;
}

/* ==== Base Page Container ==== */
.contact-page {
  direction: rtl;
  background-color: var(--ana-bg-deep);
  color: var(--ana-text-white);
  font-family: 'Sahel', 'Vazirmatn', sans-serif;
  padding-top: 80px; /* Fixed header offset */
  overflow-x: hidden;
}

.contact-shell {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
  box-sizing: border-box;
}

/* ==========================================================================
   1. Hero / Header Band
   ========================================================================== */
.contact-hero {
  position: relative;
  padding: 56px 0 48px;
  background: linear-gradient(108deg, #1b3558 0%, #0d2238 45%, #06111f 100%);
  border-bottom: 1px solid var(--ana-border);
  overflow: hidden;
}

.contact-hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

.contact-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  text-align: right;
}

.contact-accent-bar {
  display: inline-block;
  width: 48px;
  height: 4px;
  background-color: var(--ana-gold);
  border-radius: 2px;
  margin-bottom: 14px;
}

.contact-hero-inner h1 {
  margin: 0 0 14px;
  font-family: 'Koodak', 'Sahel', sans-serif;
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 800;
  color: var(--ana-text-white);
  line-height: 1.35;
}

.contact-subtitle {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.9;
  color: var(--ana-text-body);
}

/* ==========================================================================
   2. Main Contact Workspace
   ========================================================================== */
.contact-workspace {
  padding: 56px 0 76px;
  background-color: var(--ana-bg-deep);
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1.48fr);
  gap: 28px;
  align-items: stretch;
}

/* ---- Right Column: Contact Channels ---- */
.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.channel-card {
  flex: 1;
  background-color: var(--ana-surface-alt);
  border: 1px solid var(--ana-border);
  border-right: 3px solid var(--ana-cyan);
  border-radius: 4px;
  padding: 24px 26px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.channel-card:hover {
  border-color: var(--ana-border-hover);
  border-right-color: var(--ana-gold);
  background-color: var(--ana-surface);
}

.channel-icon {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  background-color: rgba(0, 162, 255, 0.1);
  border: 1px solid rgba(0, 162, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.channel-card:hover .channel-icon {
  background-color: rgba(245, 184, 0, 0.12);
  border-color: rgba(245, 184, 0, 0.4);
}

.channel-icon .material-icons {
  font-size: 22px;
  color: var(--ana-cyan);
  transition: color 0.2s ease;
}

.channel-card:hover .channel-icon .material-icons {
  color: var(--ana-gold);
}

.channel-body {
  flex: 1;
  min-width: 0;
}

.channel-body h3 {
  margin: 0 0 8px;
  font-family: 'Koodak', 'Sahel', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ana-text-white);
}

.channel-body p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ana-text-body);
}

.channel-ltr {
  direction: ltr;
  display: inline-block;
  text-align: right;
  font-weight: 600;
  color: var(--ana-cyan-soft) !important;
}

/* ---- Left Column: Contact Form Panel ---- */
.contact-form-panel {
  background-color: var(--ana-surface);
  border: 1px solid var(--ana-border);
  border-radius: 6px;
  padding: 36px 40px;
}

.form-panel-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.form-panel-header h3 {
  margin: 0;
  font-family: 'Koodak', 'Sahel', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--ana-gold);
  white-space: nowrap;
}

.form-header-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(270deg, rgba(245, 184, 0, 0.35) 0%, rgba(245, 184, 0, 0.04) 100%);
}

.form-row-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-row-grid .form-group {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-family: 'Koodak', 'Sahel', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ana-text-white);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  background-color: var(--ana-surface-input);
  border: 1px solid var(--ana-border);
  border-radius: 4px;
  color: var(--ana-text-white);
  font-family: 'Sahel', 'Vazirmatn', sans-serif;
  font-size: 14.5px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-group input:hover,
.form-group textarea:hover {
  border-color: rgba(126, 200, 227, 0.45);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--ana-gold);
  background-color: #030b16;
  box-shadow: 0 0 0 2px rgba(245, 184, 0, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 132px;
  line-height: 1.8;
}

/* ---- Custom Select Dropdown ---- */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  height: 45px;
  padding: 0 14px;
  background-color: var(--ana-surface-input);
  border: 1px solid var(--ana-border);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: rgba(126, 200, 227, 0.45);
}

.custom-select-trigger:focus,
.custom-select-trigger.active {
  outline: none;
  border-color: var(--ana-gold);
  background-color: #030b16;
  box-shadow: 0 0 0 2px rgba(245, 184, 0, 0.2);
}

.selected-text {
  font-size: 14px;
  color: var(--ana-text-muted);
}

.custom-select-trigger.has-value .selected-text {
  color: var(--ana-text-white);
}

.arrow-icon {
  font-size: 20px;
  color: var(--ana-text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.custom-select-trigger.active .arrow-icon {
  transform: rotate(180deg);
  color: var(--ana-gold);
}

.custom-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background-color: #071426;
  border: 1px solid var(--ana-border);
  border-radius: 4px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  overflow: hidden;
  max-height: 0;
}

.custom-options.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  max-height: 280px;
  overflow-y: auto;
}

.custom-option {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--ana-border-subtle);
  transition: background-color 0.15s ease, color 0.15s ease;
  position: relative;
}

.custom-option:last-child {
  border-bottom: none;
}

.custom-option:hover,
.custom-option.key-focus {
  background-color: rgba(0, 162, 255, 0.12);
}

.custom-option.selected {
  background-color: rgba(245, 184, 0, 0.12);
  border-right: 3px solid var(--ana-gold);
}

.option-icon {
  font-size: 19px;
  color: var(--ana-text-muted);
  transition: color 0.15s ease;
}

.custom-option:hover .option-icon,
.custom-option.key-focus .option-icon {
  color: var(--ana-cyan);
}

.custom-option.selected .option-icon {
  color: var(--ana-gold);
}

.option-text {
  font-size: 14px;
  color: var(--ana-text-body);
  flex: 1;
}

.custom-option:hover .option-text,
.custom-option.selected .option-text {
  color: var(--ana-text-white);
}

/* ---- Submit Button ---- */
.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 210px;
  padding: 12px 32px;
  background-color: var(--ana-gold);
  border: 1px solid #d49b00;
  border-radius: 6px;
  color: #06111f;
  font-family: 'Koodak', 'Sahel', sans-serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.submit-btn:hover {
  background-color: var(--ana-gold-hover);
  border-color: var(--ana-gold);
  color: #000000;
}

.submit-btn:active {
  transform: scale(0.99);
}

.submit-btn .material-icons {
  font-size: 19px;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
  .contact-shell {
    padding: 0 24px;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-channels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .channel-card:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .contact-page {
    padding-top: 70px;
  }

  .contact-hero {
    padding: 40px 0 36px;
  }

  .contact-workspace {
    padding: 40px 0 56px;
  }

  .contact-channels,
  .form-row-grid {
    grid-template-columns: 1fr;
  }

  .contact-form-panel {
    padding: 26px 20px;
  }

  .submit-btn {
    width: 100%;
  }

  .flash-messages {
    right: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
    top: 82px;
  }

  .flash-message {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .contact-shell {
    padding: 0 16px;
  }

  .channel-card {
    padding: 18px 16px;
  }
}
