/* Global Modal Styles for Authentication */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #f0f0f0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5em;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5em;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-footer button {
  padding: 10px 20px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.modal-tab {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1em;
  font-weight: 500;
  color: #999;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.modal-tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.modal-tab:hover {
  color: #667eea;
}

.tab-icon {
  font-size: 1.1em;
}

.tab-text {
  display: inline;
}

@media (max-width: 640px) {
  .modal-tab {
    padding: 10px 8px;
  }

  .tab-text {
    display: none;
  }
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

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

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

/* Auth buttons in navigation */
.nav-auth-buttons {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.nav-auth-buttons button {
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  font-size: 0.95em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn-login {
  background: transparent;
  color: #667eea;
  border: 2px solid #667eea;
}

.nav-btn-login:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

.nav-btn-signup {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.nav-btn-signup:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
}

.nav-user-menu {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-left: auto;
  flex-wrap: wrap;
}

.user-info-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-email-nav {
  color: #667eea;
  font-weight: 600;
  font-size: 0.95em;
}

.user-badge {
  font-size: 0.85em;
  color: #f39c12;
  font-weight: 500;
}

.nav-buttons-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-btn-profile,
.nav-btn-admin {
  padding: 8px 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9em;
}

.nav-btn-profile:hover,
.nav-btn-admin:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.nav-btn-logout {
  padding: 8px 14px;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn-logout:hover {
  background: #d32f2f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 0.95em;
}

.form-input,
.form-input-icon {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95em;
  transition: all 0.3s;
  box-sizing: border-box;
  font-family: inherit;
}

.form-input-icon {
  padding-left: 40px;
  background-position: 12px center;
  background-repeat: no-repeat;
  background-size: 18px;
}

.form-input:focus,
.form-input-icon:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder,
.form-input-icon::placeholder {
  color: #999;
}

.form-subtitle {
  font-size: 0.85em;
  color: #999;
  margin-top: 4px;
}

.form-button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.form-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.form-button:active {
  transform: translateY(0);
}

.form-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.error-message {
  background: #ffebee;
  color: #c62828;
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  border-left: 4px solid #c62828;
  font-size: 0.9em;
  animation: slideInError 0.3s ease;
}

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

.success-message {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  border-left: 4px solid #2e7d32;
  font-size: 0.9em;
}

.modal-header-subtitle {
  font-size: 0.85em;
  opacity: 0.9;
  margin-top: 4px;
}

/* Responsive styles */
@media (max-width: 768px) {
  .nav-auth-buttons {
    flex-direction: column;
    gap: 8px;
    margin-left: 0;
    margin-top: 10px;
  }

  .nav-auth-buttons button {
    width: 100%;
  }

  .nav-user-menu {
    flex-direction: column;
    gap: 12px;
  }

  .nav-buttons-group {
    width: 100%;
    flex-direction: column;
  }

  .nav-btn-profile,
  .nav-btn-admin,
  .nav-btn-logout {
    width: 100%;
    justify-content: center;
  }

  .modal {
    width: 95%;
    max-height: 95vh;
  }

  .modal-tab {
    font-size: 0.85em;
    padding: 10px 12px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-header h2 {
    font-size: 1.2em;
  }
}
