/* Authentication styles */

.logo-link {
    text-decoration: none;
    color: inherit;
}

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 16px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.auth-tab:hover {
    color: var(--primary-color);
    background: #f8fafc;
}

.auth-tab.active {
    color: var(--primary-color);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.auth-form {
    display: none;
    padding: 24px;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.error-message {
    color: #ef4444;
    font-size: 0.9rem;
    margin-bottom: 16px;
    min-height: 20px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

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

/* User menu in header */
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
}

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

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-link {
    font-size: 0.8rem;
    color: var(--primary-color);
    text-decoration: none;
}

.user-link:hover {
    text-decoration: underline;
}

/* Header with user */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.header-left h1 {
    margin: 0;
}

.header-left .subtitle {
    margin: 4px 0 0 0;
}

.login-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.login-btn:hover {
    background: var(--primary-dark);
}

/* Leaderboard styles */
.leaderboard-section {
    margin-top: 30px;
    padding: 0 20px;
}

.leaderboard-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.leaderboard-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 20px;
    text-align: center;
}

.leaderboard-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item:hover {
    background: #f8fafc;
}

.leaderboard-item.current-user {
    background: #eef2ff;
}

.rank {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 16px;
}

.rank.gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border-radius: 50%;
}

.rank.silver {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: white;
    border-radius: 50%;
}

.rank.bronze {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
    border-radius: 50%;
}

.player-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.player-name {
    font-weight: 600;
    color: var(--text-primary);
}

.player-stats {
    text-align: right;
}

.player-score {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.player-quizzes {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.empty-leaderboard {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-leaderboard p {
    margin: 10px 0;
}
