/* Authentication Pages Styling */

.auth-container {
  min-height: calc(100vh - 200px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 100px 20px 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-box {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 450px;
  overflow: hidden;
  animation: slideUp 0.5s ease;
}

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

.auth-header {
  background: linear-gradient(135deg, #6b46c1 0%, #553c9a 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.auth-header h1 {
  margin: 0 0 10px 0;
  font-size: 28px;
  font-weight: 700;
}

.auth-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 16px;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
  flex: 1;
  padding: 15px;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: #718096;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.tab-btn:hover {
  color: #6b46c1;
  background: #f7fafc;
}

.tab-btn.active {
  color: #6b46c1;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: #6b46c1;
}

.auth-form {
  display: none;
  padding: 30px;
  animation: fadeIn 0.3s ease;
}

.auth-form.active {
  display: block;
}

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

.auth-form h2 {
  margin: 0 0 25px 0;
  font-size: 24px;
  color: #2d3748;
  text-align: center;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #4a5568;
  font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #6b46c1;
  box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  font-weight: 400;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.error-message {
  color: #e53e3e;
  font-size: 14px;
  margin: 15px 0;
  padding: 10px;
  background: #fff5f5;
  border-left: 3px solid #e53e3e;
  border-radius: 4px;
  display: none;
}

.error-message:not(:empty) {
  display: block;
}

.success-message {
  color: #38a169;
  font-size: 14px;
  margin: 15px 0;
  padding: 10px;
  background: #f0fff4;
  border-left: 3px solid #38a169;
  border-radius: 4px;
  display: none;
}

.success-message:not(:empty) {
  display: block;
}

.auth-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #6b46c1 0%, #553c9a 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.auth-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(107, 70, 193, 0.4);
}

.auth-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.loader {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #6b46c1;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

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

/* User Profile Dropdown in Header */
.user-profile {
  position: relative;
  display: flex;
  align-items: center;
  justify-self: end;
}

.profile-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #6b46c1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.profile-photo:hover {
  border-color: #553c9a;
  transform: scale(1.05);
}

.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  min-width: 250px;
  overflow: hidden;
  z-index: 2000;
  border: 1px solid #e2e8f0;
}

.profile-dropdown.show {
  display: block;
  animation: slideDown 0.2s ease;
}

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

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: linear-gradient(135deg, #6b46c1 0%, #553c9a 100%);
  color: white;
}

.profile-dropdown-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.profile-dropdown-name {
  font-weight: 600;
  font-size: 15px;
}

.profile-dropdown-username {
  font-size: 13px;
  opacity: 0.9;
}

.profile-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  color: #4a5568;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.profile-dropdown-item:hover {
  background: #f7fafc;
  color: #6b46c1;
}

.profile-dropdown-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

/* Discord Auth Button */
.discord-auth-btn {
  width: 100%;
  padding: 14px;
  background: #5865F2;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.discord-auth-btn:hover {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(88, 101, 242, 0.4);
}

.discord-auth-btn svg {
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: #718096;
  font-size: 14px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.auth-divider span {
  padding: 0 15px;
}

/* MyCirkle Badge */
.mycirkle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  border-radius: 50%;
  margin-left: 5px;
  font-size: 12px;
  font-weight: bold;
  color: white;
  box-shadow: 0 2px 8px rgba(255, 165, 0, 0.4);
  cursor: help;
  position: relative;
}

.mycirkle-badge::before {
  content: 'M';
}

.mycirkle-badge:hover::after {
  content: 'MyCirkle Member';
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 10px;
  background: #2d3748;
  color: white;
  font-size: 11px;
  white-space: nowrap;
  border-radius: 4px;
  z-index: 1000;
}

.mycirkle-badge.tier-gold {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.mycirkle-badge.tier-silver {
  background: linear-gradient(135deg, #C0C0C0 0%, #808080 100%);
}

.mycirkle-badge.tier-bronze {
  background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
}

/* Bio Modal */
#bio-modal .modal-content {
  max-width: 500px;
}

/* Dashboard Styling */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 20px 40px;
  min-height: calc(100vh - 200px);
}

.dashboard-header {
  background: linear-gradient(135deg, #6b46c1 0%, #553c9a 100%);
  color: white;
  padding: 40px;
  border-radius: 15px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(107, 70, 193, 0.3);
}

.dashboard-header h1 {
  margin: 0 0 10px 0;
  font-size: 32px;
}

.dashboard-header p {
  margin: 0;
  font-size: 18px;
  opacity: 0.9;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.dashboard-card {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #6b46c1;
}

.dashboard-card h2 {
  margin: 0 0 15px 0;
  color: #6b46c1;
  font-size: 22px;
}

.dashboard-card p {
  color: #718096;
  margin-bottom: 20px;
  line-height: 1.6;
}

.dashboard-btn {
  display: inline-block;
  padding: 12px 24px;
  background: #6b46c1;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 15px;
}

.dashboard-btn:hover {
  background: #553c9a;
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

.dashboard-btn.secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.dashboard-btn.secondary:hover {
  background: #cbd5e0;
}

/* Modal Styling */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.3s ease;
}

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

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

.modal-header {
  padding: 25px;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #718096;
  transition: color 0.2s ease;
}

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

.modal-body {
  padding: 25px;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .dashboard-container > div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .auth-container {
    padding: 80px 15px 20px;
  }

  .auth-box {
    max-width: 100%;
    padding: 30px 20px;
  }

  .auth-header h1 {
    font-size: 24px;
  }

  .dashboard-header h1 {
    font-size: 26px;
  }

  .dashboard-container > div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card {
    padding: 20px;
  }

  .user-profile {
    padding: 6px 12px;
  }

  .profile-photo {
    width: 30px;
    height: 30px;
  }

  .profile-name {
    font-size: 13px;
  }

  .modal-content {
    width: 95%;
    max-width: 500px;
    margin: 5% auto;
  }

  .modal-body {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .auth-box {
    padding: 25px 15px;
  }

  .auth-tabs {
    gap: 10px;
  }

  .tab {
    padding: 10px 20px;
    font-size: 14px;
  }

  .auth-btn {
    padding: 12px;
    font-size: 14px;
  }

  .dashboard-card h2 {
    font-size: 18px;
  }

  .user-profile {
    gap: 8px;
    padding: 5px 10px;
  }

  .profile-photo {
    width: 28px;
    height: 28px;
  }

  .profile-name {
    display: none;
  }
}

  .user-profile {
    padding: 6px 12px;
  }

  .profile-name {
    display: none;
  }

/* Rich Text Editor Styles */
.editor-toolbar {
  display: flex;
  gap: 5px;
  padding: 8px 10px;
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  flex-wrap: wrap;
  align-items: center;
}

.editor-toolbar button {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  min-width: 36px;
}

.editor-toolbar button:hover {
  background: #6b46c1;
  color: white;
  border-color: #6b46c1;
}

.editor-toolbar button:active {
  transform: scale(0.95);
}

.rich-editor {
  width: 100%;
  min-height: 200px;
  padding: 15px;
  border: 2px solid #e2e8f0;
  border-top: 1px solid #e2e8f0;
  border-radius: 0 0 8px 8px;
  font-size: 15px;
  line-height: 1.6;
  transition: all 0.3s ease;
  box-sizing: border-box;
  overflow-y: auto;
  max-height: 400px;
}

.rich-editor:focus {
  outline: none;
  border-color: #6b46c1;
  box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.rich-editor:empty::before {
  content: attr(placeholder);
  color: #a0aec0;
  pointer-events: none;
}

.rich-editor ul,
.rich-editor ol {
  margin: 10px 0;
  padding-left: 25px;
}

.rich-editor li {
  margin: 5px 0;
}

/* @Mention Styles */
.mention-popup {
  position: absolute;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  min-width: 200px;
  display: none;
}

.mention-popup.visible {
  display: block;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mention-item:hover,
.mention-item.selected {
  background: #f3e8ff;
}

.mention-item img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.mention-item-info {
  display: flex;
  flex-direction: column;
}

.mention-item-name {
  font-weight: 600;
  color: #2d3748;
  font-size: 14px;
}

.mention-item-username {
  color: #718096;
  font-size: 12px;
}

.mention-no-results {
  padding: 12px;
  color: #718096;
  font-size: 14px;
  text-align: center;
}

/* Highlighted mention in editor */
.mention {
  color: #6b46c1;
  background: #f3e8ff;
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 600;
}

/* Non-editable mention span */
.mention[contenteditable="false"] {
  user-select: all;
}