/* Profile Component Styles */

/* Container and Layout */
.profile-container {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 120px);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--primary-color);
}

.page-header h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 32px;
  font-weight: 600;
}

.page-actions {
  display: flex;
  gap: 12px;
}

/* Content Area */
.profile-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.profile-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 30px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
  color: white;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.profile-info h2 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 600;
}

.profile-role {
  margin: 0 0 4px 0;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
}

.profile-username {
  margin: 0;
  font-size: 14px;
  opacity: 0.8;
}

/* Profile Details */
.profile-details {
  padding: 30px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.detail-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-group.full-width {
  grid-column: 1 / -1;
}

.detail-group label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  color: var(--text-primary);
  font-size: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.text-muted {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: normal;
}

/* Profile forms and modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: opacity 0.3s ease;
  opacity: 0;
  backdrop-filter: blur(4px);
}

.modal.show {
  display: block;
  opacity: 1;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--surface-color);
  border-radius: 12px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease forwards;
  margin: 2rem;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--error-color);
}

/* Form styles for modals - more specific selectors to override main.css */
.modal .modal-content form {
  padding: 1.5rem;
}

.modal .form-group {
  margin-bottom: 1.5rem;
}

.modal .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.modal .form-input,
.modal .form-textarea,
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="tel"],
.modal input[type="number"],
.modal textarea {
  width: 100% !important;
  padding: 0.75rem !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 6px !important;
  font-size: 1rem !important;
  font-family: inherit !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
  box-sizing: border-box !important;
}

.modal .form-input:focus,
.modal .form-textarea:focus,
.modal input:focus,
.modal textarea:focus {
  outline: none !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.modal .form-textarea,
.modal textarea {
  resize: vertical !important;
  min-height: 80px !important;
}

.modal .form-actions {
  display: flex !important;
  gap: 1rem !important;
  justify-content: flex-end !important;
  margin-top: 2rem !important;
  padding-top: 1rem !important;
  border-top: 1px solid var(--border-color) !important;
}

.modal .btn,
.modal button {
  padding: 0.75rem 1.5rem !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  overflow: hidden !important;
}

.modal .btn-primary {
  background: var(--primary-color) !important;
  color: white !important;
}

.modal .btn-primary:hover {
  background: var(--primary-dark) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

.modal .btn-secondary {
  background: var(--secondary-color) !important;
  color: white !important;
}

.modal .btn-secondary:hover {
  background: #475569 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3) !important;
}

.modal .btn:disabled,
.modal button:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Password change form specific styles */
.form-help {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.field-error {
  color: var(--error-color);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  min-height: 1rem;
  transition: all 0.3s ease;
}

/* Disabled form groups */
.form-group.disabled {
  opacity: 0.7;
}

.form-group.disabled input {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

/* Button spinner animation */
.btn-spinner {
  animation: rotate 1s linear infinite;
  display: inline-block;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .profile-container {
    padding: 1rem;
  }
  
  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }
  
  .profile-avatar {
    margin-bottom: 1rem;
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    text-align: center;
    width: 100%;
  }
  
  .page-actions {
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
  }
  
  .page-actions button {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .modal-content {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions .btn {
    width: 100%;
  }
}

@media (min-width: 768px) {
  .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
  }
  
  .page-actions {
    display: flex;
    gap: 1rem;
  }
  
  .profile-container {
    align-items: stretch;
  }
  
  .profile-content {
    align-items: stretch;
  }
}
