/* Authentication Modal Styles for PacksList */

/* Modal Base Styles */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.auth-modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 0 24px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 24px;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #2c3e50;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #95a5a6;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #f8f9fa;
  color: #2c3e50;
}

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

/* Form Styles */
.auth-form {
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #2c3e50;
  font-size: 14px;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  background: #fff !important;
  color: #2c3e50 !important;
}

.form-group input:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
  background: #fff !important;
  color: #2c3e50 !important;
}

.form-group input::placeholder {
  color: #6c757d !important;
  opacity: 1 !important;
}

.form-group input:invalid {
  border-color: #e74c3c;
}

.form-help {
  margin-top: 4px;
  font-size: 12px;
  color: #6c757d;
}

.form-error {
  margin-top: 4px;
  font-size: 12px;
  color: #e74c3c;
  display: none;
}

/* Checkbox Styles */
.checkbox-group {
  margin-bottom: 16px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  font-size: 14px;
  color: #2c3e50;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 2px solid #e9ecef;
  border-radius: 4px;
  margin-right: 12px;
  margin-top: 1px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  position: relative;
}

.checkbox-label input:checked + .checkmark {
  background: #4CAF50;
  border-color: #4CAF50;
}

.checkbox-label input:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  min-height: 44px;
  box-sizing: border-box;
}

.btn-primary {
  background: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

.btn-primary:hover {
  background: #45a049;
  border-color: #45a049;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-outline {
  background: transparent;
  color: #4CAF50;
  border-color: #4CAF50;
}

.btn-outline:hover {
  background: #4CAF50;
  color: white;
}

.btn-link {
  background: none;
  color: #4CAF50;
  border: none;
  padding: 8px 0;
  text-decoration: underline;
  font-size: 13px;
}

.btn-link:hover {
  color: #45a049;
}

/* Form Actions */
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.form-actions .btn {
  width: 100%;
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  text-align: center;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e9ecef;
}

.auth-divider span {
  padding: 0 16px;
  color: #6c757d;
  font-size: 13px;
  background: white;
}

/* Email Verification Modal */
.verification-content {
  text-align: center;
}

.verification-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.verification-content h3 {
  margin: 0 0 12px 0;
  color: #2c3e50;
  font-size: 20px;
}

.verification-content p {
  color: #6c757d;
  line-height: 1.5;
  margin-bottom: 24px;
}

.verification-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

/* Auth Loader */
.auth-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 10001;
  display: none;
  justify-content: center;
  align-items: center;
}

.auth-loader.active {
  display: flex;
}

.loader-content {
  text-align: center;
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#auth-loader-text {
  color: #2c3e50;
  font-weight: 500;
}

/* Auth Messages */
.auth-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10002;
  max-width: 400px;
}

.auth-message {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #4CAF50;
  animation: messageSlideIn 0.3s ease-out;
}

.auth-message-error {
  border-left-color: #e74c3c;
}

.auth-message-success {
  border-left-color: #4CAF50;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Authentication State Indicators */
.auth-required {
  display: none;
}

.auth-required.show {
  display: block;
}

.guest-only {
  display: block;
}

.guest-only.hide {
  display: none;
}

.admin-only {
  display: none;
}

.admin-only.show {
  display: block;
}

/* User Indicator */
#user-indicator {
  color: #6c757d;
  font-size: 12px;
  font-weight: 500;
}

#user-indicator.authenticated {
  color: #4CAF50;
}

/* Auth Buttons in Header */
.auth-button {
  background: none;
  border: 1px solid #e9ecef;
  color: #2c3e50;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-button:hover {
  background: #f8f9fa;
  border-color: #dee2e6;
}

.auth-button-primary {
  background: #4CAF50;
  border-color: #4CAF50;
  color: white;
}

.auth-button-primary:hover {
  background: #45a049;
  border-color: #45a049;
}

/* Responsive Design */
@media (max-width: 480px) {
  .modal-content {
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
    min-height: 100vh;
  }
  
  .modal-header,
  .modal-body {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .auth-messages {
    left: 20px;
    right: 20px;
    max-width: none;
  }
}

@media (max-width: 360px) {
  .form-group input {
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .modal-header h2 {
    font-size: 20px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .modal-content {
    background: #2c3e50;
    color: white;
  }
  
  .modal-header {
    border-bottom-color: #34495e;
  }
  
  .modal-header h2 {
    color: white;
  }
  
  .form-group label {
    color: #ecf0f1;
  }
  
  .form-group input {
    background: #34495e !important;
    border-color: #34495e !important;
    color: white !important;
  }
  
  .form-group input:focus {
    border-color: #4CAF50 !important;
    background: #34495e !important;
    color: white !important;
  }
  
  .form-group input::placeholder {
    color: #bdc3c7 !important;
    opacity: 1 !important;
  }
  
  .auth-divider::before,
  .auth-divider::after {
    background: #34495e;
  }
  
  .auth-divider span {
    background: #2c3e50;
    color: #bdc3c7;
  }
  
  .loader-content {
    background: #2c3e50;
    color: white;
  }
  
  .auth-message {
    background: #2c3e50;
    color: white;
  }
}