/*************************************************************************************************
Rights Managed License Pricing Calculator Component Styles
WCAG 2.2 AA Compliant with Modern Accessibility Features
*************************************************************************************************/

/* Themes variables - manually included since @import doesn't work in CSS folder */

/* ==================================================================
   MODAL OVERLAY AND TRANSITIONS
   ================================================================== */

.calculator-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 2010;
  cursor: pointer;
}

/* Modal Transitions */
.modal-fade-enter-active,
.modal-fade-leave-active {
  transition: opacity 0.3s ease;
}

.modal-fade-enter-from,
.modal-fade-leave-to {
  opacity: 0;
}

.modal-slide-enter-active,
.modal-slide-leave-active {
  transition: all 0.3s ease;
}

.modal-slide-enter-from,
.modal-slide-leave-to {
  opacity: 0;
  transform: translateY(-30px) scale(0.95);
}

/* ==================================================================
   CALCULATOR MODAL
   ================================================================== */

.calculator-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  max-width: 900px;
  max-height: 90vh;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 2015;
  overflow: hidden;
  display: flex;
  flex-direction: column;

  /* Accessibility: Ensure modal is visible and accessible */
  &:focus {
    outline: 3px solid #000000;
    outline-offset: 2px;
  }
}

/* ==================================================================
   MODAL HEADER
   ================================================================== */

.calculator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, #000000 0%, #222 100%);
  color: white;
  border-bottom: 1px solid #555555;
  flex-shrink: 0;
}

.calculator-title {
  margin: 0;
  font-size: 2rem;
  /* font-weight: 600; */
  line-height: 1.3;
  color: white;
}

.calculator-close-btn {
  background: transparent;
  border: 2px solid transparent;
  color: white;
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;

  /* Accessibility: Ensure adequate touch target */
  min-width: 44px;
  min-height: 44px;

  &:hover,
  &:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    outline: none;
  }

  &:focus-visible {
    outline: 3px solid #4dabf7 !important;
    outline-offset: 2px !important;
  }
}

/* ==================================================================
   MODAL BODY
   ================================================================== */

.calculator-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  line-height: 1.6;

  /* Custom scrollbar for webkit browsers */
  &::-webkit-scrollbar {
    width: 8px;
  }

  &::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  &::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;

    &:hover {
      background: #bbb;
    }
  }
}

.calculator-description {
  border-left: 4px solid #000000;
  /* background: #d1ecf1; */
  /* border-color: #bee5eb;
  color: #0c5460; */
}

/* ==================================================================
   ITEM INFORMATION
   ================================================================== */

.calculator-item-info {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 6px;
  border: 1px solid #e9ecef;

  .badge {
    font-size: 0.875rem;
    padding: 6px 10px;
  }

  strong {
    color: #495057;
    margin-right: 8px;
  }
}

/* ==================================================================
   FORM SECTIONS
   ================================================================== */

.calculator-section {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease;

  &:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  &:focus-within {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
    border-color: #000000;
  }
}

.section-title {
  margin: 0 0 16px 0;
  color: #333;
  font-weight: 600;
  display: flex;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 2px solid #e9ecef;

  i {
    color: #000000;
  }
}

/* ==================================================================
   FORM CONTROLS
   ================================================================== */

.form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 6px;
  display: block;

  &.required::after {
    content: " *";
    color: #A70606;
  }
}

.form-select,
.form-control {
  border: 2px solid #555555;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: white;

  /* Accessibility: Ensure adequate touch target */
  min-height: 44px;

  &:focus {
    /* border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25); */
    outline: none;
  }

  &:hover:not(:disabled) {
    border-color: #adb5bd;
  }

  &[aria-invalid="true"] {
    border-color: #A70606;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
  }
}

.form-text {
  margin-top: 4px;
  font-size: 0.875rem;
  color: #6c757d;
}

/* Country Checkboxes */
.country-checkboxes {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 12px;
  background: #f8f9fa;

  .form-check {
    margin-bottom: 8px;

    &:last-child {
      margin-bottom: 0;
    }
  }
}

.form-check-input {
  margin-right: 8px;

  /* Accessibility: Ensure adequate touch target */
  min-width: 20px;
  min-height: 20px;

  &:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
  }
}

.form-check-label {
  cursor: pointer;
  line-height: 1.4;
  user-select: none;
}

/* ==================================================================
   PRICE DISPLAY
   ================================================================== */

.calculator-price-display {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 2px solid #28a745;
  border-radius: 8px;
  padding: 20px;
  margin: 24px 0;

  .price-amount {
    color: #155724;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }

  h3 {
    color: #155724;
    margin-bottom: 8px;
  }
}

/* ==================================================================
   FORM ACTIONS
   ================================================================== */

.calculator-actions {
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
  flex-shrink: 0;

  .btn {
    /* Accessibility: Ensure adequate touch target */
    min-height: 44px;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;

    &:focus-visible {
      outline: 3px solid #007bff !important;
      outline-offset: 2px !important;
    }

    &:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
  }

  .btn-primary {
    &:hover:not(:disabled) {
      background: #000000;
      transform: translateY(-1px);
      box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    }
  }
}

/* ==================================================================
   HELP SECTION
   ================================================================== */

.calculator-help {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;

  summary {
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.2s ease;

    &:hover {
      background: #e9ecef;
    }

    &:focus {
      outline: 3px solid #007bff;
      outline-offset: 2px;
    }
  }

  ul {
    margin: 12px 0 0 0;
    padding-left: 20px;

    li {
      margin-bottom: 8px;
      line-height: 1.5;
    }
  }

  a {
    color: #000000;
    text-decoration: underline;

    &:hover,
    &:focus {
      color: #0056b3;
      text-decoration: none;
    }

    &:focus-visible {
      outline: 2px solid #007bff;
      outline-offset: 2px;
    }
  }
}

/* ==================================================================
   ACCESSIBILITY ENHANCEMENTS
   ================================================================== */

/* Screen Reader Only Content */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Loading States */
.fa-spin {
  animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .calculator-modal {
    border: 3px solid black !important;
    background: white !important;
  }

  .calculator-header {
    background: black !important;
    color: white !important;
    border-bottom: 2px solid black !important;
  }

  .calculator-section {
    border: 2px solid black !important;
  }

  .form-select,
  .form-control {
    border: 2px solid black !important;

    &:focus {
      outline: 4px solid blue !important;
      outline-offset: 2px !important;
    }
  }

  .btn {
    border: 2px solid black !important;

    &:focus,
    &:hover {
      outline: 4px solid blue !important;
      outline-offset: 2px !important;
    }
  }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .modal-fade-enter-active,
  .modal-fade-leave-active,
  .modal-slide-enter-active,
  .modal-slide-leave-active {
    transition: none !important;
  }
}

/* Dark Mode Support */
/* @media (prefers-color-scheme: dark) {
  .calculator-modal {
    background: #2d3748;
    color: #e2e8f0;
  }

  .calculator-header {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  }

  .calculator-section {
    background: #374151;
    border-color: #4a5568;
  }

  .calculator-item-info {
    background: #374151;
    border-color: #4a5568;
  }

  .form-select,
  .form-control {
    background: #374151;
    border-color: #4a5568;
    color: #e2e8f0;

    &:focus {
      border-color: #63b3ed;
      box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.25);
    }
  }

  .country-checkboxes {
    background: #374151;
    border-color: #4a5568;
  }

  .calculator-help summary {
    background: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
  }
} */

/* ==================================================================
   RESPONSIVE DESIGN
   ================================================================== */

/* Tablet */
@media (max-width: 768px) {
  .calculator-modal {
    width: 98%;
    max-height: 95vh;
    margin: 2.5vh auto;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
  }

  .calculator-header {
    padding: 16px 20px;
  }

  .calculator-title {
    font-size: 1.1rem;
  }

  .calculator-body {
    padding: 20px 16px;
  }

  .calculator-section {
    padding: 16px;
  }

  .calculator-actions {
    flex-direction: column;

    .btn {
      width: 100%;
      margin-bottom: 12px;

      &:last-child {
        margin-bottom: 0;
      }
    }
  }
}

/* Mobile */
@media (max-width: 576px) {
  .calculator-modal {
    width: 100%;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    margin: 0;
    top: 0;
    left: 0;
    transform: none;
    position: fixed;
  }

  .calculator-header {
    padding: 12px 16px;
  }

  .calculator-title {
    font-size: 1rem;
  }

  .calculator-close-btn {
    width: 40px;
    height: 40px;
  }

  .calculator-body {
    padding: 16px 12px;
  }

  .calculator-section {
    padding: 12px;
    margin-bottom: 16px;
  }

  .section-title {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .calculator-price-display {
    padding: 16px;

    .price-amount {
      font-size: 2rem;
    }
  }

  /* Stack form fields on mobile */
  .row .col-md-6,
  .row .col-md-4 {
    margin-bottom: 16px;
  }
}

/* Enhanced touch targets on mobile */
@media (pointer: coarse) {
  .form-select,
  .form-control,
  .btn,
  .form-check-input {
    min-height: 48px;
  }

  .calculator-close-btn {
    min-width: 48px;
    min-height: 48px;
  }

  .form-check-input {
    min-width: 24px;
    min-height: 24px;
  }
}

/* Print Styles */
@media print {
  .calculator-modal-overlay {
    display: none !important;
  }

  .calculator-modal {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    box-shadow: none !important;
    border: 2px solid black !important;
  }

  .calculator-header {
    background: #f5f5f5 !important;
    color: black !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .calculator-close-btn {
    display: none !important;
  }

  .calculator-actions {
    display: none !important;
  }
}

/* ==================================================================
   VISUAL INDICATORS FOR COMPLETED FIELDS
   ================================================================== */

/* Completed Section Styling */
.completed-section {
  background-color: rgba(40, 167, 69, 0.05);
  border-left: 4px solid #28a745;
  padding-left: 1rem;
  transition: all 0.3s ease;
  position: relative;
}

.completed-section .section-title {
  color: #155724;
}

/* Completed Field Styling */
.completed-field {
  border-color: #28a745 !important;
  background-color: rgba(40, 167, 69, 0.05);
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
}

.completed-field:focus {
  border-color: #28a745 !important;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* Check mark animation */
.fa-check-circle {
  animation: checkPop 0.3s ease-in-out;
}

@keyframes checkPop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Progress indicator for better UX */
.completed-section::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #28a745, #20c997);
  border-radius: 0 2px 2px 0;
}

/* Subtle hover effect for incomplete sections */
.calculator-section:not(.completed-section):hover {
  background-color: rgba(0, 123, 255, 0.02);
  border-left: 2px solid rgba(0, 123, 255, 0.2);
  padding-left: 1rem;
  transition: all 0.2s ease;
}

/* Enhanced focus states for better accessibility */
.form-select:focus, .form-control:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

/* Input group completed styling */
.input-group .completed-field + .input-group-text {
  background-color: rgba(40, 167, 69, 0.05);
  border-color: #28a745;
  color: #155724;
}

/* High contrast mode enhancements for completion indicators */
@media (prefers-contrast: high) {
  .completed-section {
    border-left: 6px solid #000 !important;
    background-color: #fff !important;
  }

  .completed-field {
    border-color: #000 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25) !important;
  }

  .fa-check-circle {
    color: #000 !important;
  }
}

/* Reduced motion preferences for completion animations */
@media (prefers-reduced-motion: reduce) {
  .fa-check-circle {
    animation: none !important;
  }

  .completed-section::before {
    transition: none !important;
  }

  .completed-field {
    transition: none !important;
  }
}