/* quiz/css/auth-style.css (COMPLETE) */

/* =================================== */
/* 1. User Actions Container           */
/* =================================== */
.user-actions-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    z-index: 1001; /* Make sure it's above other top-level elements */
    background-color: rgba(255, 255, 255, 0.5);
    padding: 5px 15px;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.auth-button {
    padding: 8px 16px;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    font-size: 14px;
    border: 1px solid transparent;
    border-radius: 50px;
    background-color: transparent;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-button.primary {
    background-color: #6C63FF;
    color: #fff;
}

.auth-button:hover {
    transform: translateY(-1px);
}

.auth-button.primary:hover {
    background-color: #574fdc;
}

.welcome-text {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-right: 10px;
}

body.dark-mode .user-actions-container {
    background-color: rgba(30, 30, 30, 0.5);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
body.dark-mode .welcome-text,
body.dark-mode .auth-button {
    color: #eee;
}
body.dark-mode .auth-button.primary {
    background-color: #8a82ff;
    color: #111;
}

/* Helper class to hide elements */
.hidden {
    display: none !important;
}

/* =================================== */
/* 2. Modal Styles (Overlay & Content) */
/* =================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}
.modal-content {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
}
.modal-content h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    text-align: center;
    font-size: 28px;
}
.modal-content p {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
}
.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s ease;
}
.close-modal-btn:hover { color: #333; }
.modal-content.large { max-width: 600px; }


/* =================================== */
/* 3. Form Styles inside Modals        */
/* =================================== */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
    text-align: left;
}
.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus {
    outline: none;
    border-color: #6C63FF;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}
.auth-button.full-width {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    background-color: #6C63FF;
    color: #fff;
    border: none;
}
.auth-button.full-width:hover { background-color: #574fdc; }

.error-message {
    color: #D8000C;
    background-color: #FFD2D2;
    border: 1px solid #D8000C;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
}

/* =================================== */
/* 4. Payment Modal Specific Styles    */
/* =================================== */
.payment-tabs {
  display: flex;
  margin-bottom: 20px;
  border-radius: 8px;
  background-color: #f0f0f0;
  padding: 5px;
}
.payment-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background-color: transparent;
  cursor: pointer;
  font-weight: 600;
  color: #555;
  border-radius: 6px;
  transition: background-color 0.3s, color 0.3s;
  font-family: 'Roboto', sans-serif;
}
.payment-tab.active {
  background-color: #6C63FF;
  color: white;
}
.payment-details { display: none; }
.payment-details.active { display: block; }
.payment-details h3 {
  text-align: left;
  font-size: 18px;
  margin-top: 0;
  color: #333;
}
.payment-details p {
  text-align: left;
  margin-bottom: 12px;
  color: #555;
}
.payment-card-info {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}
.payment-card-info p {
  margin: 0;
  text-align: left;
}
.card-number {
  font-family: monospace;
  font-size: 22px;
  font-weight: 600;
  color: #333;
  margin: 10px 0 !important;
  letter-spacing: 2px;
  text-align: center;
}
.card-holder {
  text-align: right !important;
  font-size: 14px;
  color: #777;
}
.payment-final-step {
  font-size: 15px;
  line-height: 1.6;
}
.payment-final-step a {
  color: #6C63FF;
  font-weight: 600;
  text-decoration: none;
}
.activation-note {
  font-size: 13px;
  color: #888;
  font-style: italic;
  text-align: center !important;
  margin-top: 25px;
}
/* Add this to the bottom of quiz/css/auth-style.css */

/* Leaderboard button on subject screen */
.leaderboard-button {
    background: linear-gradient(145deg, #ffc107, #ffeb3b);
    color: #333;
    border-color: #ffc107;
    font-size: 24px;
    line-height: 1.4;
}

body.dark-mode .leaderboard-button {
    background: linear-gradient(145deg, #a07900, #c4a62c);
    color: #fff;
    border-color: #a07900;
}

/* Leaderboard modal content */
#leaderboard-content {
    max-height: 60vh; /* Make the list scrollable if it's too long */
    overflow-y: auto;
    padding-right: 10px; /* Space for the scrollbar */
    margin-top: 20px;
}

.leaderboard-loading {
    font-size: 18px;
    color: #888;
    padding: 40px 0;
    text-align: center;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    background-color: #f9f9f9;
}

.leaderboard-item:nth-child(1) { background-color: #ffd700; font-weight: bold; } /* Gold */
.leaderboard-item:nth-child(2) { background-color: #c0c0c0; } /* Silver */
.leaderboard-item:nth-child(3) { background-color: #cd7f32; } /* Bronze */

.leaderboard-rank {
    font-size: 16px;
    font-weight: bold;
    color: #555;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.leaderboard-name {
    flex-grow: 1;
    font-size: 18px;
    font-weight: 500;
    padding-left: 15px;
}

.leaderboard-diamonds {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
    display: flex;
    align-items: center;
    gap: 5px;
}
/* Add this to the bottom of quiz/css/auth-style.css */

/* User's personal rank display at the bottom of the leaderboard */
#user-rank-display {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed #ddd;
}

/* We can reuse the same styles as the main list for consistency */
#user-rank-display .leaderboard-item {
    background-color: #e0e0ff; /* Highlight the user's own rank */
    border: 2px solid #6C63FF;
}