/* ========================================
   BRQ Cars Booking - Premium Design System
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
  /* Saudi-Inspired Color Palette */
  --brq-primary: #006c35;
  --brq-primary-light: #00843f;
  --brq-primary-dark: #005029;
  --brq-accent: #d4af37;
  --brq-accent-light: #f4d47a;
  --brq-orange: #ff6b35;
  --brq-orange-light: #ff8c61;
  --brq-blue: #0066cc;
  --brq-blue-dark: #004d99;

  /* Neutrals */
  --brq-bg: #f8fafb;
  --brq-bg-alt: #f0f4f8;
  --brq-white: #ffffff;
  --brq-border: #e1e8ed;
  --brq-border-dark: #cbd5e0;
  --brq-text: #1a202c;
  --brq-text-light: #4a5568;
  --brq-muted: #718096;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 40px -7px rgba(0, 0, 0, 0.15), 0 8px 16px -4px rgba(0, 0, 0, 0.08);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--brq-primary) 0%, var(--brq-primary-light) 100%);
  --gradient-accent: linear-gradient(135deg, var(--brq-accent) 0%, var(--brq-accent-light) 100%);
  --gradient-orange: linear-gradient(135deg, #ff6b35 0%, #ff8c61 100%);
  --gradient-blue: linear-gradient(135deg, #0066cc 0%, #0088ff 100%);
  --gradient-mesh: radial-gradient(at 0% 0%, rgba(0, 108, 53, 0.15) 0, transparent 50%),
    radial-gradient(at 100% 0%, rgba(212, 175, 55, 0.15) 0, transparent 50%),
    radial-gradient(at 100% 100%, rgba(255, 107, 53, 0.1) 0, transparent 50%);
}

/* ========================================
   Global Styles
   ======================================== */

* {
  box-sizing: border-box;
}

body.brq-booking {
  font-family: 'Tajawal', 'Noto Kufi Arabic', Tahoma, Arial, sans-serif;
  background: var(--brq-bg);
  background-image: var(--gradient-mesh);
  background-attachment: fixed;
  color: var(--brq-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.brq-shell {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 24px;
  direction: rtl;
}

/* ========================================
   Container & Main Layout
   ======================================== */

.brq-container {
  background: var(--brq-white);
  border: 1px solid var(--brq-border);
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
  padding: 32px;
  direction: rtl;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
}

.brq-container::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  height: 400px;
  background: var(--gradient-accent);
  opacity: 0.05;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   Title & Header Section
   ======================================== */

.brq-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.brq-title h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideInRight 0.5s ease-out;
}

.brq-title>div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brq-tag {
  background: var(--gradient-orange);
  color: var(--brq-white);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.8s ease-out;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brq-tag:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.brq-price-indicator {
  color: var(--brq-accent);
  font-weight: 800;
  font-size: 24px;
  animation: fadeIn 0.8s ease-out 0.2s both;
  text-shadow: 0 2px 4px rgba(212, 175, 55, 0.2);
}

/* Car Image in Header */
.brq-car-image-header {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--brq-primary);
  background: linear-gradient(135deg, rgba(0, 108, 53, 0.05) 0%, rgba(212, 175, 55, 0.05) 100%);
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.6s ease-out;
}

.brq-car-image-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .brq-car-image-header {
    width: 100px;
    height: 100px;
  }
}

/* ========================================
   Subbar
   ======================================== */

.brq-subbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(0, 108, 53, 0.05) 0%, rgba(212, 175, 55, 0.05) 100%);
  border-radius: 16px;
  border: 1px solid var(--brq-border);
  position: relative;
  z-index: 1;
}

.brq-pill.small {
  padding: 6px 14px;
  font-size: 13px;
  background: var(--gradient-orange);
  color: var(--brq-white);
  border-radius: 999px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.brq-price-line {
  color: var(--brq-text-light);
  font-weight: 700;
  font-size: 18px;
  margin: 0;
  flex: 1;
}

/* ========================================
   Layout Grid
   ======================================== */

.brq-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  position: relative;
  z-index: 1;
  margin-bottom: 32px;
  /* Space before summary */
}

@media (max-width: 1200px) {
  .brq-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 968px) {
  .brq-layout {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Main Content Area (Map/Visual)
   ======================================== */

.brq-main {
  background: var(--brq-white);
  border: 2px solid var(--brq-border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  min-height: 550px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* Map Header */
.brq-map-header {
  background: linear-gradient(135deg, rgba(0, 108, 53, 0.05) 0%, rgba(212, 175, 55, 0.05) 100%);
  border-bottom: 2px solid var(--brq-border);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  z-index: 10;
  flex-shrink: 0;
}

.brq-map-title {
  font-weight: 800;
  font-size: 18px;
  color: var(--brq-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brq-map-title::before {
  content: '📍';
  font-size: 20px;
}

/* Map Toggle Buttons */
.brq-map-toggle {
  display: inline-flex;
  gap: 8px;
  background: var(--brq-white);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--brq-border);
}

.brq-map-toggle button {
  border: none;
  background: transparent;
  color: var(--brq-text-light);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.brq-map-toggle button:hover {
  color: var(--brq-primary);
  background: rgba(0, 108, 53, 0.05);
}

.brq-map-toggle button.active {
  background: var(--gradient-primary);
  color: var(--brq-white);
  box-shadow: var(--shadow-md);
}

/* Map Container */
.brq-map {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 400px;
  position: relative;
  z-index: 1;
}

/* Map Footer (Help Text) */
.brq-map-footer {
  background: linear-gradient(135deg, rgba(0, 108, 53, 0.03) 0%, rgba(212, 175, 55, 0.03) 100%);
  border-top: 2px solid var(--brq-border);
  padding: 12px 20px;
  text-align: center;
  color: var(--brq-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 10;
  flex-shrink: 0;
}

.brq-map-footer::before {
  content: 'ℹ️';
  font-size: 14px;
}

/* ========================================
   Booking Summary Section
   ======================================== */

.brq-booking-summary {
  background: var(--brq-white);
  border: 2px solid var(--brq-border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 550px;
}

.brq-summary-header {
  background: linear-gradient(135deg, rgba(0, 108, 53, 0.08) 0%, rgba(212, 175, 55, 0.08) 100%);
  border-bottom: 2px solid var(--brq-border);
  padding: 16px 20px;
  font-weight: 800;
  font-size: 18px;
  color: var(--brq-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brq-summary-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex: 1;
}

.brq-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(0, 108, 53, 0.02) 0%, rgba(212, 175, 55, 0.02) 100%);
  border-radius: 10px;
  border: 1px solid var(--brq-border);
  transition: all 0.3s ease;
  gap: 12px;
}

.brq-summary-item:hover {
  background: linear-gradient(135deg, rgba(0, 108, 53, 0.05) 0%, rgba(212, 175, 55, 0.05) 100%);
  transform: translateX(-2px);
  box-shadow: var(--shadow-sm);
}

.brq-summary-label {
  font-weight: 700;
  color: var(--brq-text);
  font-size: 14px;
  white-space: nowrap;
}

.brq-summary-value {
  color: var(--brq-text-light);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  word-break: break-word;
  flex: 1;
}

.brq-summary-value:not(:empty) {
  color: var(--brq-primary);
  font-weight: 600;
}

/* Map Placeholder (if map not loaded) */
.brq-map-placeholder {
  text-align: center;
  color: var(--brq-muted);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  padding: 20px;
}

.brq-map-placeholder svg {
  width: 120px;
  height: 120px;
  margin-bottom: 16px;
  opacity: 0.3;
  animation: float 3s ease-in-out infinite;
}

.brq-map-placeholder h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--brq-text-light);
  margin: 0 0 8px;
}

.brq-map-placeholder p {
  font-size: 14px;
  margin: 0;
  opacity: 0.7;
}

/* Responsive Map */
@media (max-width: 768px) {
  .brq-main {
    min-height: 400px;
  }

  .brq-map-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
  }

  .brq-map-toggle {
    width: 100%;
  }

  .brq-map-toggle button {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
  }

  .brq-map-title {
    font-size: 16px;
  }

  .brq-map {
    min-height: 300px;
  }

  .brq-booking-summary {
    max-height: none;
  }

  .brq-summary-header {
    font-size: 16px;
  }

  .brq-summary-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .brq-summary-value {
    text-align: right;
  }
}

/* ========================================
   Sidebar / Form
   ======================================== */

.brq-sidebar {
  background: var(--brq-white);
  border: 2px solid var(--brq-border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.brq-sidebar::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 108, 53, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.brq-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
}

/* ========================================
   Form Fields
   ======================================== */

.brq-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brq-label {
  text-align: right;
  font-weight: 700;
  color: var(--brq-text);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s ease;
}

.brq-label::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: height 0.3s ease;
}

.brq-input {
  position: relative;
}

.brq-input input,
.brq-input select {
  width: 100%;
  border: 2px solid var(--brq-border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--brq-white);
  outline: none;
  color: var(--brq-text);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
}

.brq-input select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  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='%23006c35' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 16px center;
  padding-left: 40px;
}

.brq-input select option {
  color: var(--brq-text);
  background: var(--brq-white);
  padding: 10px;
}

.brq-input input::placeholder {
  color: var(--brq-muted);
  opacity: 0.7;
}

.brq-input input:focus,
.brq-input select:focus {
  border-color: var(--brq-primary);
  background: var(--brq-white);
  box-shadow: 0 0 0 4px rgba(0, 108, 53, 0.1);
  transform: translateY(-1px);
}

.brq-input input:hover,
.brq-input select:hover {
  border-color: var(--brq-border-dark);
}

/* Input with Icon */
.brq-with-icon input {
  padding-right: 44px;
  padding-left: 16px;
}

.brq-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px !important;
  height: 20px !important;
  color: var(--brq-primary);
  pointer-events: none;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.brq-input:focus-within .brq-icon {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

/* ========================================
   Segment Control (Service Selection)
   ======================================== */

.brq-segment {
  display: inline-flex;
  background: var(--brq-bg-alt);
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--brq-border);
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.brq-segment button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 20px;
  cursor: pointer;
  color: var(--brq-text-light);
  font-weight: 700;
  font-size: 15px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  font-family: inherit;
  z-index: 1;
}

.brq-segment button:hover {
  color: var(--brq-primary);
  background: rgba(0, 108, 53, 0.05);
}

.brq-segment button.active {
  background: var(--gradient-primary);
  color: var(--brq-white);
  box-shadow: var(--shadow-md);
}

/* ========================================
   Pick & Drop Fields
   ======================================== */

.brq-pd {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: slideDown 0.4s ease-out;
  padding: 20px;
  background: linear-gradient(135deg, rgba(0, 108, 53, 0.03) 0%, rgba(212, 175, 55, 0.03) 100%);
  border-radius: 16px;
  border: 2px dashed var(--brq-border);
  margin-top: 8px;
}

/* ========================================
   Actions / Submit Button
   ======================================== */

.brq-actions {
  display: flex;
  justify-content: stretch;
  margin-top: 12px;
}

.brq-actions .brq-btn {
  flex: 1;
  background: var(--gradient-primary);
  color: var(--brq-white);
  border: none;
  border-radius: 14px;
  padding: 16px 28px;
  cursor: pointer;
  font-weight: 800;
  font-size: 16px;
  font-family: inherit;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.brq-actions .brq-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.brq-actions .brq-btn:hover::before {
  width: 300px;
  height: 300px;
}

.brq-actions .brq-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.brq-actions .brq-btn:active {
  transform: translateY(0);
}

/* ========================================
   Helper Text
   ======================================== */

.brq-help {
  color: var(--brq-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.brq-help::before {
  content: 'ℹ️';
  font-size: 14px;
}

.brq-error {
  color: #dc2626;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
}

/* ========================================
   Animations & Keyframes
   ======================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    max-height: 1000px;
    transform: translateY(0);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
  .brq-shell {
    margin: 20px auto;
    padding: 0 16px;
  }

  .brq-container {
    padding: 20px;
    border-radius: 16px;
  }

  .brq-title h2 {
    font-size: 24px;
  }

  .brq-layout {
    gap: 20px;
  }

  .brq-main {
    min-height: 300px;
    order: 2;
  }

  .brq-sidebar {
    order: 1;
    padding: 20px;
  }

  .brq-segment button {
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* ========================================
   Loading State
   ======================================== */

.brq-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.brq-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  border: 3px solid var(--brq-border);
  border-top-color: var(--brq-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}