/*
 * Component Styles - Reusable UI components and elements
 * This file contains styles for buttons, forms, cards, and other
 * reusable UI components used throughout the website.
 */

/* Login Button - Prominent call-to-action button for login forms */
.btn-login {
  display: block;
  width: 100%;
  padding: 16px;
  background-color: #0056b3;
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 86, 179, 0.3);
}

.btn-login:hover {
  background-color: #003d82;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 86, 179, 0.4);
}

/* CTA Buttons container - Centered container for call-to-action buttons */
.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-top: 40px;
}

/* Base styles for primary and secondary buttons */
.btn-primary,
.btn-secondary {
  padding: 14px 32px;
  border: none;
  border-radius: 30px;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  text-align: center;
  min-width: 180px;
}

/* Primary button styling - White background with blue text */
.btn-primary {
  background-color: #fff;
  color: #0056b3;
  font-weight: 600;
}

/* Primary button hover effect - Light blue background and lift effect */
.btn-primary:hover {
  background-color: #f0f5ff;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Secondary button styling - Transparent background with white border and text */
.btn-secondary {
  background-color: transparent;
  color: #fff;
  border: 2px solid #fff;
}

/* Secondary button hover effect - Semi-transparent white background and lift effect */
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments for call-to-action buttons */
@media (max-width: 768px) {
  .cta-buttons {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 300px;
  }
}

/* Form elements - Input fields, labels, and form containers */
.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #222;
}

.form-control {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid #ddd;
  border-radius: 30px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: #fff;
}

.form-control:focus {
  border-color: #0056b3;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

/* Form Error Styles - Reusable validation error messages and states */

/* Form-level error - Error message shown at the top of a form */
.form-error {
  background: #fee2e2;
  border: 2px solid #fca5a5;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #b91c1c;
  font-weight: 500;
  animation: shake 0.4s ease-in-out;
}

.form-error i {
  font-size: 18px;
  flex-shrink: 0;
}

/* Field-level error - Error message shown below individual form fields */
.field-error {
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 6px;
  padding-left: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: shake 0.4s ease-in-out;
}

.field-error i {
  font-size: 14px;
  flex-shrink: 0;
}

/* Input error state - Visual indicator for invalid input fields */
.input-error,
.form-control.input-error {
  border-color: #fca5a5 !important;
  background-color: #fef2f2;
}

.input-error:focus,
.form-control.input-error:focus {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
}

/* Shake animation - Visual feedback for error states */
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

/* Input with icon - Form field with decorative icon
 * NOTE: Main styling is in styles.css which positions icons OUTSIDE the input box (left: -30px)
 * This file only adds padding for inputs that use the .form-control class
 * Do NOT add .input-with-icon i positioning here as it conflicts with styles.css
 */
.input-with-icon .form-control {
  padding-left: 50px;
}

/* Organization cards - Client/organization display cards */
.organization-card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  padding: 30px;
  border: 1px solid rgba(0, 86, 179, 0.08);
  transition: all 0.3s ease;
}

.organization-card:hover {
  box-shadow: 0 12px 35px rgba(0, 86, 179, 0.12);
  transform: translateY(-5px);
}

/* Header section of organization cards - Contains name and type */
.org-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.org-header h4 {
  margin: 0;
  font-size: 1.3rem;
  color: #222;
  font-weight: 600;
}

.org-type {
  background-color: #0056b3;
  color: white;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

.org-stats {
  margin-bottom: 25px;
}

.org-stats p {
  margin: 12px 0;
  display: flex;
  align-items: center;
  color: #555;
  font-size: 0.95rem;
}

.org-stats i {
  width: 25px;
  color: #0056b3;
}

/* Action buttons container - Holds the View and Manage buttons */
.org-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

/* Individual action buttons - View Details and Manage */
.org-actions button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: 0.85rem;
  min-width: 100px;
}

/* Fallback for browsers that don't support gap */
.org-actions button > * {
  margin: 0 3px;
}

/* Ensure Font Awesome icons are displayed correctly */
.org-actions button i {
  display: inline-block;
  width: 1em;
  text-align: center;
}

/* Fix for secondary buttons inside organization cards - ensure text is visible */
.organization-card .btn-secondary {
  color: #0056b3;
  border-color: #0056b3;
}

.organization-card .btn-secondary:hover {
  background-color: rgba(0, 86, 179, 0.15);
  color: #003d82;
  border-color: #003d82;
}

/* Modal Styles - Popup dialogs for detailed views */

/* Modal overlay - Semi-transparent background that covers the entire screen */
.modal {
  display: block;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

/* Modal content container - White box that appears in the center of the screen */
.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 600px;
  animation: slideIn 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

/* Modal header - Contains title and close button */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  border-bottom: 1px solid #eee;
  background-color: #f8f9fa;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  color: #222;
  font-size: 1.4rem;
}

.close-modal {
  font-size: 1.8rem;
  font-weight: bold;
  cursor: pointer;
  color: #999;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: #333;
}

/* Modal body - Contains the main content */
.modal-body {
  padding: 30px;
}

/* Modal footer - Contains action buttons */
.modal-footer {
  padding: 20px 30px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  background-color: #f8f9fa;
  border-radius: 0 0 12px 12px;
}

/* Fix for buttons inside modals - ensure text is visible */
.modal .btn-primary,
.modal .btn-secondary {
  color: #0056b3;
  border-color: #0056b3;
}

.modal .btn-primary:hover,
.modal .btn-secondary:hover {
  background-color: rgba(0, 86, 179, 0.15);
  color: #003d82;
  border-color: #003d82;
}

/* Animations - Smooth transitions and effects */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Status badges - Visual indicators for different statuses */
.status-active {
  background-color: #28a745;
  color: white;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-pending {
  background-color: #ffc107;
  color: #212529;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-expired {
  background-color: #dc3545;
  color: white;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Lookup Progress Bar - Animated progress indicator for API lookups */
.lookup-progress {
  text-align: center;
  padding: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.lookup-progress-text {
  font-weight: 600;
  color: var(--primary-blue);
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.lookup-progress-bar-wrapper {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.lookup-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-blue) 0%, #0090ff 50%, var(--primary-blue) 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  transition: width 0.1s linear;
  animation: progressShimmer 1.5s linear infinite;
}

@keyframes progressShimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.lookup-progress-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 10px;
}

.lookup-countdown {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}

/* Password Strength Indicator - Real-time feedback for password security level */
.password-strength {
  margin-top: 12px;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* Progress bar container */
.password-strength-bar-wrapper {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

/* Progress bar fill with smooth transitions */
.password-strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  transition:
    width 0.3s ease,
    background-color 0.3s ease;
}

/* Strength level colors */
.password-strength-bar.strength-weak {
  background-color: #dc3545;
}

.password-strength-bar.strength-fair {
  background-color: #ff8800;
}

.password-strength-bar.strength-good {
  background-color: #ffc107;
}

.password-strength-bar.strength-strong {
  background-color: #28a745;
}

/* Strength label text */
.password-strength-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.password-strength-label-text {
  color: var(--text-secondary);
}

.password-strength-level {
  font-weight: 600;
  text-transform: capitalize;
}

/* Strength level label colors */
.password-strength-level.level-weak {
  color: #dc3545;
}

.password-strength-level.level-fair {
  color: #ff8800;
}

.password-strength-level.level-good {
  color: #b8860b;
}

.password-strength-level.level-strong {
  color: #28a745;
}

/* Tips list for password improvement suggestions */
.password-strength-tips {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.password-strength-tips-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.password-strength-tips ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.password-strength-tips li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 3px 0 3px 18px;
  position: relative;
}

.password-strength-tips li::before {
  content: '\2022';
  color: var(--primary-blue);
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* Hide tips when password is strong */
.password-strength-tips.no-tips {
  display: none;
}
