:root {
    --bg-primary: #e6dff1;
    --card-bg: #ffffff;
    --card-secondary: #dcd1ef;
    --text-dark: #1c1c1e;
    --text-muted: #6c6c70;
    --btn-dark: #2d1b4e;
    --btn-light: #ffffff;
    --border-color: #d1c5e6;
    --shadow: 0 4px 20px rgba(45, 27, 78, 0.08);
    --radius-lg: 24px;
    --radius-pill: 50px;
    --font-main: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-primary);
    font-family: var(--font-main);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

a {
    color: var(--btn-dark);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* Layout */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px 20px 90px 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    box-shadow: 0 -2px 15px rgba(0,0,0,0.08);
    border-radius: 20px 20px 0 0;
    z-index: 9999;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: space-around;
    padding: 10px 0 12px 0;
    margin: 0;
    box-sizing: border-box;
}

.nav-links li {
    flex: 1;
}

.nav-links a {
    font-weight: 600;
    color: #6c757d;
    background: transparent;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    text-decoration: none;
}

.nav-links a i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--btn-dark);
}

/* Cards & Containers */
.glass-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.title-section {
    margin-bottom: 24px;
}

.title-section h1 {
    font-size: 2rem;
    line-height: 1.2;
}

.title-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Buttons */
.btn-primary {
    background-color: var(--btn-dark);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    padding: 12px 24px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
    text-align: center;
    width: 100%;
}

.btn-primary:hover, .btn-primary:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(45, 27, 78, 0.2);
    color: #fff;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-control {
    width: 100%;
    padding: 14px 20px 14px 45px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background-color: var(--card-bg);
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text-dark);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--btn-dark);
}

.form-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Alerts */
.flashes {
    list-style: none;
    margin-bottom: 20px;
}

.flashes li {
    background-color: #ffcccc;
    color: #cc0000;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* Error texts */
.error-text {
    color: #e53935;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
    margin-left: 15px;
}

/* Home Quiz Grid */
.home-quiz-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.home-quiz-card {
    background: #ffffff;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    height: 160px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.home-quiz-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.home-quiz-title {
    margin: 0;
    font-size: 1.05rem;
    color: #1f2937;
    line-height: 1.3;
    font-weight: 600;
    z-index: 2;
    position: relative;
}

.home-quiz-img {
    position: absolute;
    bottom: -5px;
    right: -10px;
    width: 110px;
    height: 110px;
    object-fit: contain;
    z-index: 1;
}

.home-quiz-card.no-image::after {
    content: '';
    position: absolute;
    bottom: -25px;
    right: -25px;
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, rgba(246, 211, 101, 0.8) 0%, rgba(253, 160, 133, 0.8) 100%);
    border-radius: 50%;
    z-index: 1;
}

/* Options list in questions */
.options-list {
    list-style: none;
    margin: 20px 0;
}

.options-list li {
    margin-bottom: 12px;
}

.options-list label {
    display: block;
    padding: 14px 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.options-list input[type="radio"] {
    display: none;
}

.options-list input[type="radio"]:checked + label {
    background-color: var(--btn-dark);
    color: white;
    border-color: var(--btn-dark);
}

.qnum {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ques-heading {
    font-size: 1.5rem;
    margin: 15px 0 25px 0;
}

/* Images */
.hero-img {
    width: 100%;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

/* Leaderboard */
.leaderboard-title-wrapper {
    text-align: center;
    margin: 10px 0 25px 0;
}

.leaderboard-title {
    color: var(--btn-dark);
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
}

.leaderboard-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 5px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.leaderboard-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #ffffff;
    flex-shrink: 0;
}

.rank-1 { background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%); box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4); }
.rank-2 { background: linear-gradient(135deg, #E0E0E0 0%, #BDBDBD 100%); box-shadow: 0 4px 10px rgba(189, 189, 189, 0.4); }
.rank-3 { background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 100%); box-shadow: 0 4px 10px rgba(255, 154, 158, 0.4); color: #fff; }
.rank-other { background: #f0f0f0; color: #7f8c8d; font-size: 1rem; font-weight: 600; }

.leaderboard-user-info {
    flex-grow: 1;
    margin-left: 15px;
}

.leaderboard-username {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3e50;
    margin: 0;
}

.leaderboard-points {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color, #2575fc);
    text-align: right;
    min-width: 60px;
}

/* Categories / Tags */
.category-filter-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 24px;
    justify-content: center;
    flex-wrap: wrap;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.category-filter-container::-webkit-scrollbar {
    display: none;
}

.category-pill {
    text-decoration: none !important;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-dark);
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.category-pill:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(45, 27, 78, 0.08);
    color: var(--btn-dark);
}

.category-pill.active {
    background: linear-gradient(135deg, var(--btn-dark) 0%, #4a2c7e 100%);
    color: var(--btn-light) !important;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(45, 27, 78, 0.25);
}

@media (min-width: 768px) {
    .app-container {
        max-width: 600px;
        padding: 40px 20px;
    }
}
