/* Authentication Styles */

/* Auth Modals */
.auth-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease-out;
}

.auth-modal-content {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease-out;
}

.auth-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.auth-modal-header h2 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.5rem;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s ease;
}

.close-modal:hover {
  color: var(--text-color);
}

.auth-modal-body {
  padding: 1.5rem;
}

/* Auth Forms */
.auth-modal form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-modal .form-group {
  margin-bottom: 0.5rem;
}

.auth-modal label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.auth-modal .input-icon {
  position: relative;
}

.auth-modal .input-icon i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.auth-modal input {
  width: 100%;
  padding: 0.8rem;
  padding-left: 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  transition: var(--transition);
}

.auth-modal input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.auth-error {
  color: #e74c3c;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  min-height: 1.2rem;
}

.forgot-password {
  color: var(--primary-color);
  font-size: 0.9rem;
  text-align: right;
  display: block;
  margin-top: 0.5rem;
}

.btn-block {
  width: 100%;
  margin-top: 0.5rem;
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--text-light);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border-color);
}

.auth-divider span {
  padding: 0 1rem;
  font-size: 0.9rem;
}

/* Google Button */
.btn-google {
  width: 100%;
  background-color: white;
  color: #333;
  border: 1px solid #ddd;
  padding: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: var(--transition);
}

.btn-google:hover {
  background-color: #f8f8f8;
  box-shadow: var(--shadow-sm);
}

.btn-google i {
  color: #4285F4;
  font-size: 1.2rem;
}

/* Auth Footer */
.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--primary-color);
  font-weight: 500;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  position: relative;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f0f2f5;
  color: var(--primary-color);
  font-size: 1.5rem;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
  position: relative;
}

.user-name {
  font-weight: 500;
  color: var(--text-color);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* User dropdown menu */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 180px;
  background-color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.user-profile.active .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--text-color);
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
  text-decoration: none;
}

.dropdown-item i {
  margin-right: 0.5rem;
  color: var(--text-light);
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.dropdown-item:hover {
  background-color: rgba(74, 108, 247, 0.05);
  color: var(--primary-color);
}

.dropdown-item:hover i {
  color: var(--primary-color);
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.9rem;
  padding: 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
}

.btn-logout:hover {
  color: var(--primary-color);
}

/* Mobile User Profile */
.user-profile.mobile {
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

.user-profile.mobile .user-info {
  align-items: center;
}

.user-profile.mobile .user-name {
  margin-bottom: 0.5rem;
}

.user-profile.mobile .btn-logout {
  padding: 0.5rem 1rem;
  background-color: var(--primary-color);
  color: white;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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