/* 
 * Secure ID Verification System Stylesheet
 * RTL support for Arabic interface
 * Black & Gold Theme - Cleaned & Optimized
 * Version 2.0
 */

/* ==========================================================================
   Base Layout & Typography
   ========================================================================== */

body {
  direction: rtl;
  text-align: right;
  font-family: "Tajawal", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #ffffff;
  line-height: 1.6;
  background-color: #000000;
  background-image: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.9)),
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M0,0 L100,100 M100,0 L0,100" stroke="%23333" stroke-width="0.5" fill="none"/></svg>');
  background-size: auto, 20px 20px;
}

.container {
  max-width: 1000px;
}

/* ==========================================================================
     Bootstrap RTL Fixes
     ========================================================================== */

.input-group > .input-group-text:first-child {
  border-radius: 0 0.375rem 0.375rem 0;
  border-left: 0;
  border-right: 1px solid #c9a55a;
  background-color: #c9a55a;
  color: #000;
}

.input-group > .form-control:last-child {
  border-radius: 0.375rem 0 0 0.375rem;
  border-left: 1px solid #c9a55a;
  border-right: 0;
}

.form-control {
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 1px solid #c9a55a;
}

.form-control:focus {
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-color: #c9a55a;
  box-shadow: 0 0 0 0.25rem rgba(201, 165, 90, 0.25);
}

.form-text {
  color: #c9a55a;
}

/* RTL icon and margin fixes */
.fa,
.fas {
  margin-left: 0.5rem;
  margin-right: 0 !important;
}

.ms-2 {
  margin-right: 0.5rem !important;
  margin-left: 0 !important;
}

.me-2 {
  margin-left: 0.5rem !important;
  margin-right: 0 !important;
}

.me-3 {
  margin-left: 1rem !important;
  margin-right: 0 !important;
}

.ms-3 {
  margin-right: 1rem !important;
  margin-left: 0 !important;
}

/* ==========================================================================
     Header & Branding
     ========================================================================== */

.text-center h1 {
  color: #c9a55a;
  font-weight: bold;
  margin-bottom: 1.5rem;
}

.text-center i.fas.fa-shield-alt {
  color: #c9a55a;
}

.slogan-container {
  text-align: center;
  padding: 30px 0;
  margin-bottom: 30px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 1px solid #c9a55a;
}

.slogan-primary {
  font-size: 2.5rem;
  font-weight: bold;
  color: #c9a55a;
  margin-bottom: 1rem;
}

.slogan-secondary {
  font-size: 1.2rem;
  color: #fff;
  max-width: 800px;
  margin: 0 auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #c9a55a;
}

.site-logo {
  max-width: 150px;
  height: auto;
}

.nav-item {
  color: #c9a55a;
  text-decoration: none;
  padding: 10px 15px;
  transition: all 0.3s ease;
  font-weight: bold;
}

.nav-item:hover {
  color: #fff;
}

/* ==========================================================================
     Cards & Steps
     ========================================================================== */

.step-card {
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  border: 1px solid #c9a55a;
  background-color: rgba(20, 20, 20, 0.7);
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.step-card:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 3px 10px rgba(201, 165, 90, 0.3);
}

.step-card.inactive {
  opacity: 0.7;
}

.step-card .card-header {
  padding: 1rem 1.5rem;
  border-bottom: none;
  background: linear-gradient(to right, #c9a55a, #dcb978);
  color: #000;
  font-weight: 600;
}

.step-card .card-body {
  padding: 1.5rem;
  color: #fff;
}

.step-number {
  display: inline-block;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  margin-left: 10px;
  margin-right: 0;
  font-weight: bold;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
     Step Indicators
     ========================================================================== */

.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  padding: 1rem 0;
}

.step {
  text-align: center;
  flex: 1;
  position: relative;
}

.step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #333;
  color: #777;
  margin: 0 auto 10px;
  z-index: 2;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.step.active .step-icon {
  background-color: #c9a55a;
  color: #000;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(201, 165, 90, 0.6);
}

.step.completed .step-icon {
  background-color: #c9a55a;
  color: #000;
}

.step-label {
  font-size: 14px;
  color: #c9a55a;
  font-weight: 500;
}

.step.active .step-label {
  color: #c9a55a;
  font-weight: bold;
}

.step.completed .step-label {
  color: #c9a55a;
}

.step-line {
  position: absolute;
  top: 25px;
  height: 3px;
  background-color: #333;
  width: 100%;
  right: 50%;
  z-index: 1;
}

.step:last-child .step-line {
  display: none;
}

.step.completed .step-line {
  background-color: #c9a55a;
}

.step.active .step-line {
  background-color: #c9a55a;
}

/* ==========================================================================
     Identity Confirmation
     ========================================================================== */

.identity-confirmation-box {
  background-color: rgba(20, 20, 20, 0.7);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
  margin: 2rem 0;
  border: 1px solid #c9a55a;
  border-right: 5px solid #c9a55a;
  transition: all 0.3s ease;
}

.identity-confirmation-box:hover {
  box-shadow: 0 0.75rem 1.5rem rgba(201, 165, 90, 0.2);
}

.name-display-container {
  display: flex;
  align-items: center;
}

.identity-icon {
  font-size: 2.5rem;
  color: #c9a55a;
  margin-left: 1.5rem;
}

.identity-details {
  flex-grow: 1;
}

.identity-label {
  font-size: 1rem;
  color: #c9a55a;
  margin-bottom: 0.5rem;
}

.identity-value {
  font-size: 1.75rem;
  font-weight: 600;
  color: #fff;
  word-break: break-word;
}

/* ==========================================================================
     Text Direction Classes
     ========================================================================== */

.text-rtl {
  direction: rtl;
  text-align: right;
}

.text-ltr {
  direction: ltr;
  text-align: left;
}

/* ==========================================================================
     Upload Components
     ========================================================================== */

.upload-container {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.custom-file-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2rem;
  background-color: rgba(20, 20, 20, 0.7);
  border: 2px dashed #c9a55a;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.custom-file-upload:hover {
  border-color: #c9a55a;
  background-color: rgba(201, 165, 90, 0.1);
}

.custom-file-upload input[type="file"] {
  display: none;
}

.custom-file-upload i {
  color: #c9a55a;
}

.custom-file-upload span {
  margin-top: 0.5rem;
  font-weight: 500;
  color: #fff;
}

.upload-status {
  position: absolute;
  top: 0;
  right: 0;
  background-color: rgba(40, 167, 69, 0.8);
  color: white;
  padding: 3px 8px;
  border-radius: 0 0 0 8px;
  font-size: 12px;
}

/* ==========================================================================
     Preview Styling
     ========================================================================== */

.preview-container {
  background-color: rgba(20, 20, 20, 0.7);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #c9a55a;
  margin-bottom: 20px;
  position: relative;
}

.preview-title {
  text-align: center;
  margin-bottom: 1rem;
  color: #c9a55a;
}

.preview-image-wrapper {
  display: flex;
  justify-content: center;
  position: relative;
  transition: transform 0.2s;
}

.preview-image-wrapper:hover {
  transform: scale(1.02);
}

.preview-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  border: 1px solid #c9a55a;
}

.merged-preview {
  max-width: 100%;
  overflow: hidden;
  border: 2px solid #ddd;
  background-color: #f9f9f9;
  border-radius: 4px;
  padding: 10px;
}

#merged-canvas {
  max-width: 100%;
  height: auto;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
     Requirements Box
     ========================================================================== */

.requirements-box {
  background-color: rgba(20, 20, 20, 0.7);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border: 1px solid #c9a55a;
  border-right: 3px solid #c9a55a;
}

.requirements-box ul {
  margin-bottom: 0;
  padding-right: 1.25rem;
  color: #fff;
}

.requirements-box li {
  margin-bottom: 0.5rem;
}

.requirements-box li:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
     Action Buttons
     ========================================================================== */

.action-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn {
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  font-weight: 500;
  transition: all 0.2s ease;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
}

.btn-primary,
.btn-info,
.btn-warning,
.btn-success {
  background: linear-gradient(135deg, #c9a55a 0%, #9e7c0a 100%);
  border-color: #c9a55a;
  color: #000;
  border: none;
}

.btn-primary:hover,
.btn-info:hover,
.btn-warning:hover,
.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 165, 90, 0.4);
  filter: brightness(1.1);
  background: linear-gradient(135deg, #c9a55a 10%, #9e7c0a 90%);
  color: #000;
}

.btn-primary:active,
.btn-info:active,
.btn-warning:active,
.btn-success:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-primary:disabled {
  background-color: #8c7b4d;
  border-color: #8c7b4d;
  color: #333;
}

.btn-outline-secondary {
  color: #c9a55a;
  border-color: #c9a55a;
  background: transparent;
  transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
  background-color: rgba(201, 165, 90, 0.1);
  border-color: #c9a55a;
  color: #f5e6b8;
  box-shadow: 0 0 15px rgba(201, 165, 90, 0.2);
}

/* ==========================================================================
     Verification Status Styling
     ========================================================================== */

.verification-status {
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  background-color: rgba(20, 20, 20, 0.7);
  border: 1px solid #c9a55a;
}

.verification-status.completed,
.verification-status.partial,
.verification-status.pending {
  border-right: 5px solid #c9a55a;
  color: #fff;
}

.verification-status i {
  color: #c9a55a;
}

/* ==========================================================================
     Completion Step
     ========================================================================== */

.completion-container {
  padding: 2rem 1rem;
}

.completion-icon {
  animation: scaleIn 0.5s ease;
  color: #c9a55a;
}

.reference-box {
  background-color: rgba(20, 20, 20, 0.7);
  border-radius: 8px;
  border: 1px solid #c9a55a;
  width: fit-content;
  margin: 0 auto;
  color: #fff;
  padding: 15px;
}

/* ==========================================================================
     Security Info
     ========================================================================== */

.security-info {
  background-color: rgba(20, 20, 20, 0.7);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid #c9a55a;
  border-right: 3px solid #c9a55a;
}

/* ==========================================================================
     Alerts
     ========================================================================== */

.alert-info {
  background-color: rgba(20, 20, 20, 0.7);
  border: 1px solid #c9a55a;
  color: #fff;
  border-right: 4px solid #c9a55a;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  animation: fadeIn 0.4s ease-in-out;
}

.alert-danger {
  background-color: rgba(20, 20, 20, 0.7);
  border-color: #dc3545;
  color: #fff;
  border-right: 4px solid #dc3545;
  padding: 15px;
}

.alert-success {
  background-color: rgba(76, 175, 80, 0.1);
  border-color: #4caf50;
  color: #ffffff;
  border-right: 4px solid #4caf50;
}

/* ==========================================================================
     Background Animation
     ========================================================================== */

.particles-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
}

#waveCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.page-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.6) 100%
  );
}

/* ==========================================================================
     Loading Overlay
     ========================================================================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loader {
  width: 80px;
  height: 80px;
  border: 5px solid #1a1a1a;
  border-top: 5px solid #c9a55a;
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
  box-shadow: 0 0 20px rgba(201, 165, 90, 0.4);
}

/* ==========================================================================
     Validation Feedback
     ========================================================================== */

.result-header {
  border-radius: 0.75rem;
  background-color: rgba(20, 20, 20, 0.6);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.result-header.success {
  background-color: rgba(76, 175, 80, 0.1);
  border: 1px solid #4caf50;
}

.result-header.error {
  background-color: rgba(255, 82, 82, 0.1);
  border: 1px solid #ff5252;
}

.result-icon {
  font-size: 2.2rem;
  transition: all 0.3s ease;
}

.result-icon.success {
  color: #4caf50;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.4);
}

.result-icon.error {
  color: #ff5252;
  text-shadow: 0 0 10px rgba(255, 82, 82, 0.4);
}

.result-message {
  line-height: 1.6;
}

.validation-details {
  background-color: rgba(20, 20, 20, 0.7);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  border: 1px solid rgba(201, 165, 90, 0.3);
  animation: fadeIn 0.5s ease-in-out;
}

.rejection-item {
  background-color: rgba(255, 82, 82, 0.1);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 1rem;
  border-right: 3px solid #ff5252;
  transition: all 0.3s ease;
}

.rejection-item:last-child {
  margin-bottom: 0;
}

.rejection-item:hover {
  background-color: rgba(255, 82, 82, 0.15);
  transform: translateX(-3px);
}

.rejection-item i {
  color: #ff5252;
}

/* ==========================================================================
     Photo Guides
     ========================================================================== */

.preview-guide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.face-center-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(201, 165, 90, 0.7);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(201, 165, 90, 0.5);
}

.face-center-guide:before,
.face-center-guide:after {
  content: "";
  position: absolute;
  background-color: rgba(201, 165, 90, 0.7);
}

.face-center-guide:before {
  top: 50%;
  left: -15px;
  right: -15px;
  height: 1px;
}

.face-center-guide:after {
  left: 50%;
  top: -15px;
  bottom: -15px;
  width: 1px;
}

.face-size-guide {
  position: absolute;
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  border: 1px dashed rgba(201, 165, 90, 0.5);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2) inset;
}

.guide-text-top,
.guide-text-bottom {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  color: #c9a55a;
  font-size: 0.8rem;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
  font-weight: bold;
}

.guide-text-top {
  top: 5px;
}

.guide-text-bottom {
  bottom: 5px;
}

.toggle-guide-btn {
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(30, 30, 30, 0.7);
  color: #c9a55a;
  border: 1px solid #c9a55a;
  border-radius: 15px;
  padding: 2px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-guide-btn:hover {
  background-color: #9e7c0a;
  color: black;
}

/* ==========================================================================
     Face Metrics
     ========================================================================== */

.face-metrics {
  background-color: rgba(20, 20, 20, 0.7);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  border: 1px solid rgba(201, 165, 90, 0.3);
  transition: all 0.3s ease;
}

.face-metrics:hover {
  background-color: rgba(30, 30, 30, 0.8);
  border-color: rgba(201, 165, 90, 0.5);
}

.metrics-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.metrics-item i {
  color: #c9a55a;
  margin-left: 0.5rem;
}

.metrics-label {
  font-weight: 500;
  margin-left: 0.5rem;
}

.metrics-value {
  font-weight: 600;
}

/* ==========================================================================
     Tooltips
     ========================================================================== */

.requirements-tooltip {
  position: relative;
  display: inline-block;
  margin-right: 5px;
  cursor: help;
}

.requirements-tooltip i {
  color: #c9a55a;
}

.requirements-tooltip .tooltip-content {
  visibility: hidden;
  position: absolute;
  width: 250px;
  background-color: rgba(26, 26, 26, 0.95);
  border: 1px solid #c9a55a;
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 10px;
  z-index: 5;
  top: 25px;
  right: 0;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.8rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.requirements-tooltip:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}

/* ==========================================================================
     Validation Measurements
     ========================================================================== */

#validation-result-section {
  transition: all 0.3s ease;
}

#validation-result-message {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

#validation-details ul.list-unstyled li {
  background-color: rgba(255, 82, 82, 0.1);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 1rem;
  border-right: 3px solid #ff5252;
  transition: all 0.3s ease;
}

#validation-details ul.list-unstyled li:hover {
  background-color: rgba(255, 82, 82, 0.15);
  transform: translateX(-3px);
}

#validation-measurements .text-gold {
  color: #c9a55a !important;
}

#validation-measurements .bg-light-gray {
  background-color: rgba(20, 20, 20, 0.7);
  border-radius: 8px;
  border: 1px solid rgba(201, 165, 90, 0.3);
  transition: all 0.3s ease;
}

#validation-measurements .bg-light-gray:hover {
  background-color: rgba(30, 30, 30, 0.8);
  border-color: rgba(201, 165, 90, 0.5);
}

/* ==========================================================================
     Animations
     ========================================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

/* ==========================================================================
     Responsive Design - Mobile
     ========================================================================== */

@media (max-width: 768px) {
  .step-label {
    font-size: 12px;
  }

  .step-icon {
    width: 40px;
    height: 40px;
  }

  .step-number {
    width: 24px;
    height: 24px;
    line-height: 24px;
    font-size: 12px;
  }

  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .card-header h5 {
    font-size: 1rem;
  }

  .identity-confirmation-box {
    padding: 1.5rem;
  }

  .identity-icon {
    font-size: 2rem;
    margin-left: 1rem;
  }

  .identity-value {
    font-size: 1.25rem;
  }

  .slogan-primary {
    font-size: 1.8rem;
  }

  .slogan-secondary {
    font-size: 1rem;
    padding: 0 15px;
  }

  .particles-background {
    opacity: 0.5;
  }

  .face-metrics {
    padding: 0.75rem;
  }

  .metrics-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .guide-text-top,
  .guide-text-bottom {
    font-size: 0.7rem;
  }

  .rejection-item {
    padding: 0.75rem;
  }
}

@media (max-width: 576px) {
  .step-indicator {
    flex-wrap: wrap;
  }

  .step {
    flex: 0 0 50%;
    margin-bottom: 15px;
  }

  .step-line {
    display: none;
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-buttons .btn {
    margin-bottom: 0.75rem;
    width: 100%;
  }

  .btn + .btn {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  .custom-file-upload {
    padding: 1.5rem 1rem;
  }

  .requirements-box {
    padding: 1rem;
  }

  .row .col-md-6:first-child {
    margin-bottom: 20px;
  }
}
