/* ======================= GENERAL STYLES & SETUP ======================= */
/* Using your original font and color choices as the base */
:root {
  --bg-dark: #0f172a;
  --bg-medium: #1e293b;
  --text-primary: #d1d8e5;
  --text-secondary: #94a3b8;
  --accent-main: #6366f1;
  --accent-hover: #4f46e5;
  --accent-red: #e53e3e;
  --border-color: #334155;
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
}

.page-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* ======================= LOGIN PAGE STYLES ======================= */


.login-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1100px;
  width: 100%;
  background-color: var(--bg-medium);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}


.welcome-panel {
  padding: 3rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
}

.welcome-logo {
  max-width: 150px;
  margin-bottom: 1.5rem;
}

.welcome-panel h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  color: #fff;
}

.welcome-panel p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.info-steps {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.step h3 {
  color: var(--accent-main);
  margin-bottom: 0.5rem;
}

.good-luck {
  margin-top: 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.login-form-container {
  width: 100%;
  max-width: 350px;
}

.login-form-container h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.login-form-container p {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
  background-color: var(--bg-dark);
  color: var(--text-primary);
}

.password-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  user-select: none;
  font-size: 18px;
}

.login-button {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  background-color: var(--accent-main);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}

.login-button:hover {
  background-color: var(--accent-hover);
}

.error-message {
  color: var(--accent-red);
  text-align: center;
  margin-top: 1rem;
  min-height: 1.2em;
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.login-footer a {
  color: var(--accent-main);
  text-decoration: none;
  font-weight: 500;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* ======================= PROFILE PAGE STYLES ======================= */
#profile-page {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.profile-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-logo {
  height: 40px;
}

.header-logo span {
  font-size: 1.25rem;
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-controls button {
  background-color: var(--bg-medium);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 6px;
  font-weight: 500;
  padding: 8px 16px;
  transition: background-color 0.2s, border-color 0.2s;
}

.header-controls button:hover {
  background-color: var(--border-color);
  border-color: var(--accent-main);
}

#logout-button {
  background-color: var(--accent-red);
  border-color: transparent;
}

#logout-button:hover {
  background-color: #f87171;
  border-color: transparent;
}

.audits-container {
  position: relative;
}

#audits-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background-color: var(--bg-medium);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(217, 63, 63, 0.2);
  z-index: 100;
  padding: 10px;
}

.audit-item {
  background: var(--bg-dark);
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 8px;
  border-left: 4px solid var(--accent-main);
}

/* In styles.css, find and update these rules */

.profile-content {
  width: 100%;
  /* Add a gap to the main content area to space out the major sections */
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* This is the key change for vertical spacing */
}

.card {
  background-color: var(--bg-medium);
  padding: 1.5rem; /* Unified padding */
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  --bg-medium: #1e293b;
  /* Remove margin-bottom from here, as the parent gap will handle it */
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem; /* Unified gap */
  /* Remove margin-top from here */
}

.graphs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem; /* Unified gap */
  /* Remove margin-top from here */
}

.card h2 {
  color: var(--accent-main);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: 1.25rem;
  font-weight: 500;
}

/* User Info Card from previous answer */
#user-info h2 {
  font-size: 1.75rem;
  font-weight: 300;
  text-align: center;
  color: var(--text-primary); /* Overriding generic h2 color */
}
.welcome-username-toggle {
  font-weight: 600;
  color: var(--accent-main);
  cursor: pointer;
  border-bottom: 2px dotted transparent;
  transition: all 0.2s ease-in-out;
}
.welcome-username-toggle:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}
.user-details-panel { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; margin-top: 1rem; }
.user-details-panel.visible { max-height: 250px; }
.user-detail-item { display: flex; justify-content: space-between; padding: 0.75rem 0.25rem; border-bottom: 1px solid var(--border-color); }
.user-detail-item:last-child { border-bottom: none; }
.detail-label { font-weight: 500; color: var(--text-secondary); }

/* Stat Display Circles/Boxes */
.xp-display, .level-display, .audit-display {
  display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 15px;
}
.level-circle, .audit-ratio-box {
  width: 80px; height: 80px; display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: bold; color: white; margin: 0 auto 10px;
}
.level-circle { background: var(--accent-main); border-radius: 50%; }
.audit-ratio-box { border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.2); }
.level-label, .audit-label { font-size: 14px; color: var(--text-secondary); }

.xp-total-box {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* --- THE FIX --- */
  color: #6366f1; 
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease; /* Also transition color */
}
.xp-summary { text-align: center; margin-top: 1rem; }

/* Skills and Graphs */
#skills-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}
.skill-circle svg {
  width: 100px;
  height: 100px;
}
#xp-graph, #audit-graph {
  background-color: var(--bg-dark);
  border-radius: 8px;
  padding: 10px;
}


/* Responsive adjustments */
@media (max-width: 900px) {
  .login-wrapper {
      grid-template-columns: 1fr;
  }
  .welcome-panel {
      display: none;
  }
}
@media (max-width: 600px) {
  .page-container { padding: 1rem; }
  .profile-header { flex-direction: column; gap: 1rem; }
  .stats-grid { grid-template-columns: 1fr; }
}
/* Add this CSS to your stylesheet */

/* Style for the button when there are no audits */
#audits-btn.no-audits {
  background-color: #10b981; /* A nice success green color */
  border-color: #10b981;
}

#audits-btn.no-audits:hover {
    background-color: #059669; /* A darker green on hover */
}

/* Styling for the decorative "No audits" message inside the dropdown */
.no-audits-message {
  padding: 2rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.no-audits-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.1); /* Light green background */
  color: #10b981; /* Success green color */
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  font-size: 2rem;
  font-weight: bold;
  border: 2px solid #10b981;
}

.no-audits-message h3 {
  color: var(--text-primary);
  font-size: 1.25rem;
  margin-top: 0.5rem;
}

.no-audits-message p {
  color: var(--text-secondary);
  max-width: 80%;
  font-size: 0.9rem;
}