/**
 * Amelia Restricted Access - Frontend Styles
 */

/* Modal Overlay */
.ara-modal {
  position: fixed;
  z-index: 2111111112 !important; /* Higher than Amelia's 2111111111 !important */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

/* Modal Content Container */
.ara-modal-content {
  position: relative;
  background-color: #ffffff;
  margin: 5% auto;
  padding: 0;
  border: none;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: araModalSlideIn 0.3s ease-out;
}

@keyframes araModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Header */
.ara-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e5e5e5;
  background-color: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

.ara-modal-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333333;
  line-height: 1.4;
}

/* Close Button */
.ara-close {
  color: #666666;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s ease;
  background: none;
  border: none;
}

.ara-close:hover,
.ara-close:focus {
  color: #333333;
}

/* Modal Body */
.ara-modal-body {
  padding: 24px;
}

.ara-modal-body p {
  margin: 0 0 20px 0;
  color: #555555;
  line-height: 1.6;
  font-size: 14px;
}

/* Form Styles */
#ara-access-form {
  margin: 0;
}

#ara-access-code-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

#ara-access-code-input:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

#ara-access-code-input::placeholder {
  color: #999999;
}

/* Error Message */
.ara-error {
  margin-top: 12px;
  padding: 10px 12px;
  background-color: #fff2f2;
  border: 1px solid #ff6b6b;
  border-radius: 4px;
  color: #d63031;
  font-size: 14px;
}

/* Modal Footer */
.ara-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px 24px;
  background-color: #f8f9fa;
  border-radius: 0 0 8px 8px;
}

/* Button Styles */
.ara-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  line-height: 1.4;
  min-width: 80px;
}

.ara-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
}

/* Primary Button */
.ara-btn-primary {
  background-color: #007cba;
  color: #ffffff;
}

.ara-btn-primary:hover {
  background-color: #005a87;
}

.ara-btn-primary:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

/* Secondary Button */
.ara-btn-secondary {
  background-color: #ffffff;
  color: #555555;
  border: 1px solid #ddd;
}

.ara-btn-secondary:hover {
  background-color: #f5f5f5;
  border-color: #bbb;
}

/* Responsive Design */
@media (max-width: 768px) {
  .ara-modal-content {
    margin: 10% auto;
    width: 95%;
    max-width: none;
  }

  .ara-modal-header,
  .ara-modal-body,
  .ara-modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ara-modal-footer {
    flex-direction: column-reverse;
  }

  .ara-btn {
    width: 100%;
    margin-bottom: 8px;
  }

  .ara-btn:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 480px) {
  .ara-modal-content {
    margin: 5% auto;
  }

  .ara-modal-header h4 {
    font-size: 16px;
  }

  #ara-access-code-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .ara-modal-content {
    border: 2px solid #000000;
  }

  .ara-modal-header {
    border-bottom: 2px solid #000000;
  }

  #ara-access-code-input {
    border: 2px solid #000000;
  }

  .ara-btn {
    border: 2px solid #000000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .ara-modal-content {
    animation: none;
  }

  .ara-btn,
  #ara-access-code-input,
  .ara-close {
    transition: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .ara-modal-content {
    background-color: #2d3748;
    color: #e2e8f0;
  }

  .ara-modal-header {
    background-color: #1a202c;
    border-bottom-color: #4a5568;
  }

  .ara-modal-header h4 {
    color: #e2e8f0;
  }

  .ara-modal-footer {
    background-color: #1a202c;
  }

  .ara-close {
    color: #a0aec0;
  }

  .ara-close:hover {
    color: #e2e8f0;
  }

  .ara-modal-body p {
    color: #cbd5e0;
  }

  #ara-access-code-input {
    background-color: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
  }

  #ara-access-code-input:focus {
    border-color: #63b3ed;
    box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.2);
  }

  #ara-access-code-input::placeholder {
    color: #a0aec0;
  }

  .ara-error {
    background-color: #742a2a;
    border-color: #e53e3e;
    color: #fed7d7;
  }

  .ara-btn-secondary {
    background-color: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
  }

  .ara-btn-secondary:hover {
    background-color: #2d3748;
    border-color: #a0aec0;
  }
}
