/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Landing Page Styles */
.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
    position: relative;
}

.flash-messages {
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.brain-animation {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brain-icon {
    font-size: 5rem;
    position: relative;
    z-index: 2;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.pulse-ring-2 {
    animation-delay: 1s;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.main-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.info-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.features {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    margin: 3rem 0;
    box-shadow: var(--shadow-xl);
}

.features h2 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.features-list {
    list-style: none;
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.features-list li {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem 0;
    background: var(--bg-light);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.features-list li:hover {
    background: #e0e7ff;
}

.feature-icon {
    font-size: 1.75rem;
    margin-right: 1rem;
}

.start-button {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: white;
    color: var(--primary-color);
    padding: 1.25rem 3rem;
    border-radius: 50px;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    margin: 2rem 0;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.start-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.2), transparent);
    transition: left 0.5s ease;
}

.start-button:hover::before {
    left: 100%;
}

.start-button:hover {
    transform: scale(1.05);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
}

.start-button .arrow {
    transition: transform 0.3s ease;
}

.start-button:hover .arrow {
    transform: translateX(5px);
}

.disclaimer {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    max-width: 800px;
    margin: 2rem auto;
    line-height: 1.5;
}

/* Test Page Styles */
.test-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    min-height: 100vh;
}

.progress-bar-container {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
}

.timer {
    font-weight: 600;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.question-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
}

.question-visual {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.question-category {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.options-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-card {
    position: relative;
    cursor: pointer;
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-light);
    border: 3px solid transparent;
    border-radius: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    font-weight: 600;
    color: var(--primary-color);
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    font-weight: 500;
    color: var(--text-dark);
}

.checkmark {
    opacity: 0;
    font-size: 1.5rem;
    color: var(--success-color);
    transition: opacity 0.3s ease;
}

.option-card:hover .option-content {
    background: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.option-card.selected .option-content {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.option-card.selected .checkmark {
    opacity: 1;
}

.option-card.selected .option-letter {
    background: var(--primary-color);
    color: white;
}

.option-card.clicked .option-content {
    transform: scale(0.98);
}

.submit-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.25rem 2rem;
    border: none;
    border-radius: 15px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-button .arrow {
    transition: transform 0.3s ease;
}

.submit-button:hover:not(:disabled) .arrow {
    transform: translateX(5px);
}

/* Results Page Styles */
.results-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.results-header {
    text-align: center;
    margin-bottom: 3rem;
}

.trophy-animation {
    font-size: 5rem;
    animation: trophy 1s ease;
}

@keyframes trophy {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.results-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin: 1rem 0;
}

.results-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
}

.score-display {
    margin: 2rem 0;
}

.iq-score-card {
    background: white;
    padding: 3rem 2rem;
    border-radius: 25px;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.iq-label {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.iq-number {
    font-size: 5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0.5rem 0;
}

.iq-interpretation {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-top: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.95rem;
}

.interpretation-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin: 2rem 0;
}

.interpretation-card h3 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.interpretation-card p {
    color: var(--text-light);
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.iq-scale {
    margin-top: 2rem;
    position: relative;
}

.scale-header {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.scale-bar {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.scale-segment {
    flex: 1;
    padding: 1rem 0.5rem;
    text-align: center;
    color: white;
    font-weight: 600;
}

.scale-segment span {
    display: block;
    font-size: 0.95rem;
}

.scale-segment small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.segment-low { background: #94a3b8; }
.segment-avg { background: #60a5fa; }
.segment-high { background: #34d399; }
.segment-superior { background: #fbbf24; }
.segment-genius { background: #f97316; }

.scale-marker {
    position: absolute;
    top: 100%;
    transform: translateX(-50%);
    text-align: center;
}

.marker-arrow {
    font-size: 1.5rem;
    color: var(--accent-color);
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.marker-label {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.action-button {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    border-radius: 15px;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.action-button.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.action-button.secondary {
    background: white;
    color: var(--primary-color);
}

.action-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.share-section {
    text-align: center;
    margin: 2rem 0;
}

.share-section p {
    color: white;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.share-btn {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 1rem 2rem;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.share-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Rankings Section */
.rankings-section {
    margin: 4rem auto;
    max-width: 900px;
    width: 100%;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.rankings-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.rankings-subtitle {
    text-align: center;
    color: #555;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    font-size: 1rem;
}

.rankings-table-container,
.comparison-table-container,
.leaderboard-container,
.famous-rankings-container {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}

.rankings-table,
.comparison-table,
.leaderboard-table,
.famous-rankings-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.rankings-table thead tr,
.comparison-table thead tr {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.rankings-table th,
.comparison-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.rankings-table tbody tr,
.comparison-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.rankings-table tbody tr:hover,
.comparison-table tbody tr:hover {
    background: #f8f9ff;
    transform: translateX(5px);
}

.you-row,
.you-rank-row {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%) !important;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.4);
}

.you-row:hover,
.you-rank-row:hover {
    background: linear-gradient(135deg, #fdcb6e 0%, #ffeaa7 100%) !important;
    transform: scale(1.02) !important;
}

.rank-cell,
.position-cell {
    padding: 1rem;
    font-weight: 600;
    color: #764ba2;
    font-size: 1rem;
}

.you-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    animation: pulse 2s infinite;
}

.you-marker {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.name-cell {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.person-icon {
    font-size: 1.5rem;
}

.person-name {
    font-weight: 500;
    color: #2d3436;
}

.iq-cell {
    padding: 1rem;
    text-align: center;
}

.iq-score,
.iq-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    display: inline-block;
    min-width: 60px;
}

.field-cell {
    padding: 1rem;
    color: #636e72;
    font-size: 0.9rem;
}

/* Rankings comparison on results page */
.rankings-comparison {
    margin: 3rem auto;
    max-width: 900px;
    width: 100%;
    padding: 0 1rem;
}

.rankings-comparison h2 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.comparison-subtitle {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Dashboard Rankings */
.dashboard-rankings {
    margin-top: 3rem;
    width: 100%;
}

.user-rank-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
}

.rank-icon {
    font-size: 2rem;
}

.rank-text {
    flex: 1;
    font-size: 1.1rem;
}

.rank-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.leaderboard-container,
.famous-rankings-container {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}

.leaderboard-table,
.famous-rankings-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.leaderboard-table thead tr,
.famous-rankings-table thead tr {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.leaderboard-table th,
.famous-rankings-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.leaderboard-table tbody tr,
.famous-rankings-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.leaderboard-table tbody tr:hover,
.famous-rankings-table tbody tr:hover {
    background: #f8f9ff;
}

.medal {
    font-size: 1.5rem;
}

.user-icon {
    font-size: 1.2rem;
    opacity: 0.7;
}

.username {
    font-weight: 500;
    color: #2d3436;
}

.iq-badge-famous {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-weight: 700;
    display: inline-block;
    min-width: 50px;
    text-align: center;
}

.tests-cell {
    color: #636e72;
    padding: 1rem;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .question-card {
        padding: 1rem;
    }
    
    /* Hide visual icon on mobile to save space */
    .question-visual {
        display: none;
    }
    
    /* Make category badge smaller on mobile */
    .question-category {
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
        margin-bottom: 1rem;
    }
    
    /* Optimize test container for mobile */
    .test-container {
        padding: 0.75rem 0.5rem;
    }
    
    .progress-bar-container {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .iq-number {
        font-size: 3.5rem;
    }
    
    .results-title {
        font-size: 2rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-button {
        width: 100%;
    }
    
    .scale-bar {
        flex-direction: column;
    }
    
    .scale-segment {
        padding: 0.75rem 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    .stat-card {
        padding: 1.5rem 1rem;
    }
    
    .stat-icon {
        font-size: 2rem;
        margin-bottom: 0.3rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    .rankings-section {
        padding: 1rem;
        margin: 2rem 0.5rem;
    }
    
    .rankings-section h2 {
        font-size: 1.5rem;
    }
    
    .rankings-subtitle {
        font-size: 0.9rem;
    }
    
    .rankings-table-container,
    .comparison-table-container,
    .leaderboard-container,
    .famous-rankings-container {
        padding: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .rankings-table,
    .comparison-table,
    .leaderboard-table,
    .famous-rankings-table {
        font-size: 0.85rem;
        min-width: 100%;
    }
    
    .rankings-table th,
    .comparison-table th,
    .leaderboard-table th,
    .famous-rankings-table th {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .rankings-table td,
    .comparison-table td,
    .leaderboard-table td,
    .famous-rankings-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .rank-cell,
    .position-cell {
        padding: 0.75rem 0.3rem;
        font-size: 0.85rem;
    }
    
    .name-cell {
        padding: 0.75rem 0.5rem;
        gap: 0.5rem;
    }
    
    .person-name,
    .username {
        font-size: 0.85rem;
    }
    
    .field-cell {
        font-size: 0.75rem;
    }
    
    .person-icon,
    .user-icon {
        font-size: 1rem;
    }
    
    .iq-score,
    .iq-badge,
    .iq-badge-famous {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        min-width: 50px;
    }
    
    .you-badge,
    .you-marker {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .medal {
        font-size: 1.2rem;
    }
    
    .user-rank-banner {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .rank-text {
        font-size: 0.95rem;
    }
    
    .rank-badge {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }
    
    .leaderboard-container,
    .famous-rankings-container {
        max-height: 400px;
    }
    
    .rankings-comparison h2 {
        font-size: 1.5rem;
    }
    
    .comparison-subtitle {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .brain-icon {
        font-size: 3.5rem;
    }
    
    .brain-animation {
        width: 120px;
        height: 120px;
    }
    
    .card-icon {
        font-size: 2rem;
    }
    
    .question-visual {
        font-size: 3rem;
    }
    
    .features {
        padding: 1.5rem;
    }
    
    .features-list li {
        padding: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin: 1rem 0;
    }
    
    .stat-card {
        padding: 1.25rem 0.75rem;
    }
    
    .stat-icon {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .rankings-section {
        padding: 0.5rem;
        margin: 1.5rem 0.25rem;
    }
    
    .rankings-section h2 {
        font-size: 1.3rem;
    }
    
    .rankings-subtitle {
        font-size: 0.85rem;
    }
    
    .rankings-table-container,
    .comparison-table-container,
    .leaderboard-container,
    .famous-rankings-container {
        padding: 0.25rem;
        border-radius: 15px;
    }
    
    .rankings-table,
    .comparison-table,
    .leaderboard-table,
    .famous-rankings-table {
        font-size: 0.75rem;
    }
    
    .rankings-table th,
    .comparison-table th,
    .leaderboard-table th,
    .famous-rankings-table th {
        padding: 0.6rem 0.3rem;
        font-size: 0.7rem;
    }
    
    .rankings-table td,
    .comparison-table td,
    .leaderboard-table td,
    .famous-rankings-table td {
        padding: 0.6rem 0.3rem;
        font-size: 0.75rem;
    }
    
    .name-cell {
        gap: 0.3rem;
    }
    
    .person-name,
    .username {
        font-size: 0.75rem;
    }
    
    .field-cell {
        font-size: 0.7rem;
    }
    
    .person-icon,
    .user-icon {
        font-size: 0.9rem;
    }
    
    .iq-score,
    .iq-badge,
    .iq-badge-famous {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        min-width: 45px;
    }
    
    .you-badge,
    .you-marker {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
    
    .rank-cell,
    .position-cell {
        padding: 0.6rem 0.2rem;
        font-size: 0.75rem;
    }
    
    .medal {
        font-size: 1rem;
    }
    
    .user-rank-banner {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .rank-icon {
        font-size: 1.5rem;
    }
    
    .rank-text {
        font-size: 0.85rem;
    }
    
    .rank-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.8rem;
    }
    
    .rankings-comparison h2 {
        font-size: 1.3rem;
    }
    
    .comparison-subtitle {
        font-size: 0.85rem;
    }
}

/* Custom Letter Filter */
/* This is used in the template to convert numbers to letters */

/* User Menu Styles */
.user-menu {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    z-index: 100;
}

.user-greeting {
    color: white;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.user-menu-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.user-menu-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.user-menu-link.register {
    background: white;
    color: var(--primary-color);
}

.user-menu-link.register:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Authentication Styles */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: white;
    padding: 3rem;
    border-radius: 25px;
    box-shadow: var(--shadow-xl);
    max-width: 450px;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounceIn 0.6s ease;
}

.auth-header h2 {
    color: var(--text-dark);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-light);
    font-size: 1rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.auth-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 15px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.auth-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-footer .back-link {
    display: inline-block;
    color: var(--text-light);
    margin-top: 1rem;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #dcfce7;
    color: #16a34a;
    border-left: 4px solid #16a34a;
}

.alert-error {
    background: #fee2e2;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.alert-warning {
    background: #fef3c7;
    color: #d97706;
    border-left: 4px solid #d97706;
}

.alert-info {
    background: #dbeafe;
    color: #2563eb;
    border-left: 4px solid #2563eb;
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.dashboard-title h1 {
    color: var(--text-dark);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard-title p {
    color: var(--text-light);
    font-size: 1rem;
}

.dashboard-actions {
    display: flex;
    gap: 1rem;
}

.dash-button {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.dash-button.secondary {
    background: var(--bg-light);
    color: var(--text-dark);
}

.dash-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stats-overview {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.stats-overview h2 {
    color: var(--text-dark);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.quick-actions {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.quick-actions h2 {
    color: var(--text-dark);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.history-section {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.history-section h2 {
    color: var(--text-dark);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.history-table {
    overflow-x: auto;
}

.history-table table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    background: var(--bg-light);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

.history-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.history-table td.highlight {
    font-weight: 700;
    color: var(--primary-color);
}

.history-table tr:hover {
    background: var(--bg-light);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state p {
    color: var(--text-light);
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* Mobile responsive for auth and dashboard */
@media (max-width: 768px) {
    .user-menu {
        top: 1rem;
        right: 1rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    .user-greeting {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .dashboard-actions {
        width: 100%;
        justify-content: center;
    }
    
    .history-table {
        font-size: 0.9rem;
    }
    
    .history-table th,
    .history-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Button Group Styles */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.primary-button {
    background: white !important;
    color: var(--primary-color) !important;
}

.secondary-button {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 2px solid white !important;
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

.back-link {
    display: inline-block;
    color: white;
    text-decoration: none;
    margin-top: 2rem;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.back-link:hover {
    transform: translateX(-5px);
}

/* Practice Mode Styles */
.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.practice-info-left,
.practice-info-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.practice-mode-badge {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.practice-stats {
    color: var(--text-light);
    font-weight: 500;
}

.finish-button {
    background: var(--warning-color);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.finish-button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.difficulty-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.difficulty-easy {
    background: #dcfce7;
    color: #16a34a;
}

.difficulty-medium {
    background: #fef3c7;
    color: #d97706;
}

.difficulty-hard {
    background: #fee2e2;
    color: #dc2626;
}

/* Feedback Styles */
.feedback-container {
    max-width: 800px;
    margin: 0 auto;
}

.feedback-header {
    text-align: center;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
}

.feedback-header.correct {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.feedback-header.incorrect {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

.feedback-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-animation {
    color: white;
    animation: successPop 0.5s ease;
}

.error-animation {
    color: white;
    animation: errorShake 0.5s ease;
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.feedback-title {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.feedback-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
}

.question-review {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.question-visual-small {
    font-size: 2rem;
}

.question-review h3 {
    color: var(--text-dark);
    font-size: 1.25rem;
    margin: 0;
    flex: 1;
}

.answer-summary {
    margin-bottom: 1.5rem;
}

.answer-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.answer-row.correct-answer {
    background: #dcfce7;
    border-left: 4px solid #16a34a;
}

.answer-row.wrong-answer {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
}

.answer-label {
    font-weight: 600;
    color: var(--text-light);
    min-width: 120px;
}

.answer-value {
    flex: 1;
    font-weight: 600;
    color: var(--text-dark);
}

.answer-icon {
    font-size: 1.5rem;
}

.explanation-section {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.explanation-section h4 {
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.explanation-text {
    color: var(--text-dark);
    line-height: 1.8;
    margin: 0;
}

.question-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.meta-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-light);
    color: var(--text-dark);
}

.feedback-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-button.large {
    flex: 2;
    min-width: 200px;
}

.action-button.practice {
    background: linear-gradient(135deg, var(--warning-color), #fbbf24);
    color: white;
}

.encouragement {
    padding: 1.25rem;
    border-radius: 12px;
    margin-top: 1rem;
    font-weight: 500;
}

.encouragement.success {
    background: #dcfce7;
    color: #16a34a;
}

.encouragement.good {
    background: #dbeafe;
    color: #2563eb;
}

.encouragement.improve {
    background: #fef3c7;
    color: #d97706;
}

/* Mobile adjustments for practice mode */
@media (max-width: 768px) {
    .practice-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .practice-info-left,
    .practice-info-right {
        justify-content: space-between;
        width: 100%;
    }
    
    .question-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .feedback-actions {
        flex-direction: column;
    }
    
    .action-button.large {
        width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group .start-button {
        width: 100%;
    }
}
