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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 40px;
}

.screen {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease-out;
}

.screen.active {
    display: block;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Landing Page */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 10px;
    border-radius: 10px;
}

.logo:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.logo span {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    font-size: 1.5rem;
    color: #667eea;
}

.header-content p {
    font-size: 1.2rem;
    color: #666;
}

.login-btn {
    padding: 12px 24px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.stats-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin: 40px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.stats-preview.bottom-stats {
    margin-top: 60px;
    margin-bottom: 20px;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.stat {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.stat .number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.stat .label {
    color: #666;
    font-size: 0.9rem;
}

.cta-button {
    display: block;
    width: 100%;
    padding: 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.cta-button:hover {
    transform: translateY(-2px);
}

/* Books Showcase Section */
.books-showcase {
    margin: 50px 0;
}

.books-showcase h2 {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
    font-size: 2.2rem;
}

.showcase-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.books-grid-home {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    max-width: none;
}

.book-card-home {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.book-card-home:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-color: #667eea;
    background: white;
}

.book-card-home .book-cover {
    width: 100px;
    height: 130px;
    margin: 0 auto 15px;
}

.book-card-home h3 {
    margin-bottom: 5px;
    color: #333;
    font-size: 1.1rem;
}

.book-card-home .author {
    color: #667eea;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.book-stats {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.book-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #888;
    font-size: 0.8rem;
}

.book-stats i {
    color: #667eea;
}

.view-all-section {
    text-align: center;
    margin-top: 40px;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 35px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.view-all-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Learning Science Section */
.learning-science-section {
    margin: 60px 0;
    padding: 40px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
}

.learning-science-section h2 {
    text-align: center;
    margin-bottom: 40px;
    color: #333;
    font-size: 2.2rem;
}

.science-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    padding: 0;
}

.science-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.science-card:hover {
    transform: translateY(-5px);
}

.science-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 1.5rem;
}

.science-card h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3rem;
}

.science-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.science-tip {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #2196f3;
    text-align: left;
    font-size: 0.9rem;
    color: #1976d2;
}

.research-backing {
    text-align: center;
    padding: 30px;
    background: white;
    margin: 0;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.research-backing h3 {
    margin-bottom: 15px;
    color: #333;
}

.research-backing p {
    color: #666;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Daily Tip */
.daily-tip {
    background: linear-gradient(135deg, #e8f5e8, #f1f8e9);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    border-left: 4px solid #4caf50;
}

.tip-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #2e7d32;
    font-weight: bold;
}

.tip-header i {
    font-size: 1.2rem;
}

.tip-content p {
    color: #1b5e20;
    line-height: 1.5;
    margin: 0;
}

/* Learning Tips Screen */
.tips-header {
    text-align: center;
    margin-bottom: 40px;
}

.tips-header h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
    color: #333;
}

.tips-header p {
    color: #666;
    font-size: 1.1rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.tip-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    position: relative;
}

.tip-card:hover {
    transform: translateY(-5px);
}

.tip-number {
    position: absolute;
    top: -15px;
    left: 25px;
    width: 30px;
    height: 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.tip-card h3 {
    margin: 10px 0 15px;
    color: #333;
    font-size: 1.2rem;
}

.tip-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.tip-example {
    background: #f0f4ff;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    font-size: 0.9rem;
    color: #4a5568;
}

.research-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.research-section h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
}

.research-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.fact {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.fact i {
    color: #667eea;
    font-size: 1.2rem;
}

.fact span {
    color: #333;
    font-size: 0.9rem;
}

/* Screen Header Navigation */
.screen-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.logo-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 8px;
    color: #667eea;
    font-weight: bold;
}

.logo-nav:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.logo-nav i {
    font-size: 1rem;
}

.logo-nav span {
    font-size: 1.2rem;
}

/* Quiz Top Bar Layout */
.quiz-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Footer */
.app-footer {
    margin-top: 60px;
    padding: 30px 0;
    background: #f8f9fa;
    border-radius: 20px 20px 0 0;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-content p {
    margin-bottom: 10px;
    color: #666;
    font-size: 0.9rem;
}

.footer-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.footer-content a:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

/* Enhanced Book Card */
.enhanced-book {
    position: relative;
}

.lesson-badge {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    margin: 10px 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.book-options {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.option-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.lesson-btn {
    background: #4CAF50;
    color: white;
}

.lesson-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.quiz-btn {
    background: #667eea;
    color: white;
}

.quiz-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* Enhanced home book card */
.enhanced-home {
    position: relative;
}

.book-options-home {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.enhanced-home:hover .book-options-home {
    display: flex;
}

.enhanced-home:hover .book-cover,
.enhanced-home:hover h3,
.enhanced-home:hover .author,
.enhanced-home:hover .book-stats,
.enhanced-home:hover .lesson-badge {
    opacity: 0.3;
}

/* Lessons Screen */
.lessons-header {
    margin-bottom: 40px;
}

.book-info-header {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
}

.book-cover.small {
    width: 60px;
    height: 80px;
}

.book-cover.small .book-title {
    font-size: 0.6rem;
}

.book-cover.small .book-icon {
    font-size: 1.2rem;
}

.book-details h2 {
    margin-bottom: 5px;
    color: #333;
}

.book-details .author {
    color: #667eea;
    font-weight: bold;
    margin-bottom: 10px;
}

.book-details .description {
    color: #666;
    line-height: 1.5;
}

.lessons-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

.lesson-card {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.lesson-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.lesson-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
    border-left-color: #ccc;
}

.lesson-card.locked:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.lesson-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.lesson-content {
    flex: 1;
}

.lesson-content h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.3rem;
}

.lesson-summary {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.lesson-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.lesson-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #888;
    font-size: 0.9rem;
}

.lesson-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 0.9rem;
}

.lesson-status.completed {
    color: #4CAF50;
}

.lesson-status.current {
    color: #FF9800;
}

.lesson-status.locked {
    color: #999;
}

.lessons-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Lesson Detail Screen */
.lesson-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.back-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.lesson-progress {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lesson-content-area {
    max-width: 800px;
    margin: 0 auto;
}

.lesson-title-section {
    margin-bottom: 30px;
}

.lesson-title-section h1 {
    margin-bottom: 15px;
    color: #333;
    font-size: 2.2rem;
}

.lesson-meta-info {
    display: flex;
    gap: 25px;
    color: #666;
    font-size: 0.9rem;
}

.lesson-meta-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.lesson-summary-box {
    background: #e3f2fd;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border-left: 4px solid #2196f3;
}

.lesson-summary-box h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #1976d2;
}

.lesson-summary-box ul {
    list-style: none;
    padding: 0;
}

.lesson-summary-box li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
}

.lesson-summary-box li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
}

.lesson-content-text {
    line-height: 1.7;
    margin-bottom: 40px;
}

.lesson-content-text h3 {
    margin: 30px 0 15px;
    color: #333;
    font-size: 1.4rem;
}

.lesson-content-text h4 {
    margin: 20px 0 10px;
    color: #667eea;
    font-size: 1.2rem;
}

.concept-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #667eea;
}

.example-box {
    background: #fff3e0;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #FF9800;
}

.homework-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.homework-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    color: #333;
}

.homework-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #4CAF50;
}

.homework-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.homework-number {
    width: 25px;
    height: 25px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.homework-header h4 {
    flex: 1;
    margin: 0;
    color: #333;
}

.homework-type {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.homework-description {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.homework-example {
    background: #e8f5e8;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #2e7d32;
}

.lesson-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.lesson-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.lesson-nav-btn:hover:not(:disabled) {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.lesson-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.lesson-complete-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    font-size: 1rem;
}

.lesson-complete-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

/* Recent Badges Preview */
.recent-badges-preview {
    margin: 50px 0;
    text-align: center;
}

.recent-badges-preview h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.5rem;
}

.community-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.community-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-radius: 15px;
    color: white;
    transition: transform 0.2s;
}

.community-badge:hover {
    transform: translateY(-3px);
}

.community-badge.gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.community-badge.silver {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
}

.community-badge.bronze {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
}

.community-badge i {
    font-size: 2rem;
}

.community-badge span {
    font-weight: bold;
}

.community-badge small {
    opacity: 0.8;
    font-size: 0.8rem;
}

/* CTA Section */
.cta-section {
    text-align: center;
    margin-top: 50px;
}

.cta-section .cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: auto;
    padding: 20px 40px;
    margin-bottom: 15px;
}

.cta-subtitle {
    color: #666;
    font-size: 1rem;
}

/* Login Screen */
.login-container {
    max-width: 400px;
    margin: 0 auto;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #333;
}

.login-header p {
    color: #666;
    font-size: 1.1rem;
}

.demo-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 10px;
    margin-bottom: 25px;
    color: #1976d2;
    font-size: 0.9rem;
}

.demo-notice i {
    color: #2196f3;
}

.login-form .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-submit-btn {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.login-submit-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.login-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #ffebee;
    color: #c62828;
    border-radius: 10px;
    margin-bottom: 20px;
}

.login-error.hidden {
    display: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #dc3545;
    margin-bottom: 0;
}

.modal-body {
    text-align: center;
    margin-bottom: 30px;
}

.modal-body p {
    margin-bottom: 10px;
    color: #333;
}

.modal-warning {
    color: #dc3545;
    font-weight: bold;
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.modal-btn.cancel {
    background: #6c757d;
    color: white;
}

.modal-btn.cancel:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.modal-btn.confirm {
    background: #dc3545;
    color: white;
}

.modal-btn.confirm:hover {
    background: #c82333;
    transform: translateY(-1px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Profile Setup */
.setup-header {
    text-align: center;
    margin-bottom: 40px;
}

.setup-header h2 {
    margin-bottom: 10px;
    color: #333;
}

.setup-header p {
    color: #666;
    font-size: 1.1rem;
}

.setup-form {
    max-width: 500px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.goal-options {
    display: grid;
    gap: 15px;
}

.goal-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.goal-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.goal-btn.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.goal-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #667eea;
}

.goal-btn.selected .goal-icon {
    color: white;
}

.goal-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.goal-desc {
    font-size: 0.9rem;
    opacity: 0.8;
}

.setup-complete-btn {
    width: 100%;
    padding: 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 20px;
}

.setup-complete-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.setup-complete-btn:not(:disabled):hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* Profile */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.avatar {
    width: 60px;
    height: 60px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-info h2 {
    margin-bottom: 5px;
}

.user-info p {
    color: #666;
}

.level-badge {
    margin-left: auto;
    background: #ffd700;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
}

.badges-section {
    margin-bottom: 30px;
}

.badges-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.badges {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 15px;
    border-radius: 15px;
    text-align: center;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.badge i {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.badge span {
    font-size: 0.9rem;
}

.badge.earned {
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.badge.earned.gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.badge.earned.silver {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
}

.badge.earned.bronze {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
}

.badge.earned.purple {
    background: linear-gradient(135deg, #9C27B0, #673AB7);
}

.badge.earned.blue {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.badge.locked {
    background: #f0f0f0;
    color: #999;
    border: 2px dashed #ddd;
}

.badge:hover {
    transform: translateY(-3px) scale(1.05);
}

.badge.earned:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.badge.earned::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.badge.earned:hover::before {
    animation: shine 0.5s ease-in-out;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); opacity: 0; }
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.book-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.book-cover {
    width: 120px;
    height: 160px;
    margin: 0 auto 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.book-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 50%);
    pointer-events: none;
}

.book-cover .book-title {
    font-size: 0.9rem;
    line-height: 1.2;
    padding: 8px;
    z-index: 1;
}

.book-cover .book-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    z-index: 1;
}

/* Book-specific covers */
.book-cover.rich-dad {
    background: linear-gradient(135deg, #2E7D32, #4CAF50);
}

.book-cover.thinking-fast {
    background: linear-gradient(135deg, #1976D2, #2196F3);
}

.book-cover.atomic-habits {
    background: linear-gradient(135deg, #F57C00, #FF9800);
}

.book-cover.mindset {
    background: linear-gradient(135deg, #7B1FA2, #9C27B0);
}

.book-cover.sapiens {
    background: linear-gradient(135deg, #5D4037, #795548);
}

.book-cover.deep-work {
    background: linear-gradient(135deg, #303F9F, #3F51B5);
}

.book-cover.psychology-money {
    background: linear-gradient(135deg, #C62828, #F44336);
}

.book-cover.power-now {
    background: linear-gradient(135deg, #00796B, #009688);
}

/* Neuroscience Books */
.book-cover.behave {
    background: linear-gradient(135deg, #8E24AA, #AB47BC);
}

.book-cover.predictably-irrational {
    background: linear-gradient(135deg, #E91E63, #F06292);
}

.book-cover.brain-that-changes {
    background: linear-gradient(135deg, #673AB7, #9575CD);
}

/* AI Books */
.book-cover.life-3-0 {
    background: linear-gradient(135deg, #37474F, #607D8B);
}

.book-cover.human-compatible {
    background: linear-gradient(135deg, #455A64, #78909C);
}

.book-cover.prompt-engineering-guide {
    background: linear-gradient(135deg, #1565C0, #42A5F5);
}

.book-cover.generative-ai-handbook {
    background: linear-gradient(135deg, #6A1B9A, #BA68C8);
}

.book-cover.agentic-ai-systems {
    background: linear-gradient(135deg, #BF360C, #FF5722);
}

/* Category Badges */
.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 12px;
    margin-bottom: 10px;
}

.category-badge.neuroscience {
    background: linear-gradient(45deg, #E91E63, #F06292);
    color: white;
}

.category-badge.ai {
    background: linear-gradient(45deg, #37474F, #607D8B);
    color: white;
}

.category-badge.ai-eng {
    background: linear-gradient(45deg, #1565C0, #42A5F5);
    color: white;
}

.category-badge.finance {
    background: linear-gradient(45deg, #2E7D32, #4CAF50);
    color: white;
}

.category-badge.self-improvement {
    background: linear-gradient(45deg, #F57C00, #FF9800);
    color: white;
}

.category-badge.psychology {
    background: linear-gradient(45deg, #1976D2, #2196F3);
    color: white;
}

.category-badge.history {
    background: linear-gradient(45deg, #5D4037, #795548);
    color: white;
}

.category-badge.productivity {
    background: linear-gradient(45deg, #303F9F, #3F51B5);
    color: white;
}

.category-badge.mindfulness {
    background: linear-gradient(45deg, #00796B, #009688);
    color: white;
}E91E63, #F06292);
    color: white;
}

.category-badge.ai {
    background: linear-gradient(45deg, #37474F, #607D8B);
    color: white;
}

.category-badge.ai-eng {
    background: linear-gradient(45deg, #1565C0, #42A5F5);
    color: white;
}

.category-badge.finance {
    background: linear-gradient(45deg, #2E7D32, #4CAF50);
    color: white;
}

.category-badge.self-improvement {
    background: linear-gradient(45deg, #F57C00, #FF9800);
    color: white;
}

.category-badge.psychology {
    background: linear-gradient(45deg, #1976D2, #2196F3);
    color: white;
}

.category-badge.history {
    background: linear-gradient(45deg, #5D4037, #795548);
    color: white;
}

.category-badge.productivity {
    background: linear-gradient(45deg, #303F9F, #3F51B5);
    color: white;
}

.category-badge.mindfulness {
    background: linear-gradient(45deg, #00796B, #009688);
    color: white;
}

.book-card h3 {
    margin-bottom: 5px;
    color: #333;
    font-size: 1.1rem;
}

.book-author {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-style: italic;
}

.progress {
    margin-top: 15px;
}

.progress-bar-container {
    background: #e0e0e0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    transition: width 0.3s ease;
}

.progress span {
    font-size: 0.9rem;
    color: #666;
}

/* Quiz Interface */
.quiz-header {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.quiz-top-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.quit-quiz-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.quit-quiz-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.book-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.book-title-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#current-book {
    font-weight: bold;
    font-size: 1.2rem;
    color: #333;
}

#current-author {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quiz-stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
}

.question-card h3 {
    margin-bottom: 25px;
    font-size: 1.3rem;
    line-height: 1.5;
}

.answers {
    display: grid;
    gap: 15px;
}

.answer-btn {
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.answer-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.answer-btn.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.answer-btn.correct {
    border-color: #4CAF50;
    background: #4CAF50;
    color: white;
}

.answer-btn.incorrect {
    border-color: #f44336;
    background: #f44336;
    color: white;
}

.feedback {
    margin-top: 25px;
    padding: 20px;
    background: #e8f5e8;
    border-radius: 10px;
    border-left: 4px solid #4CAF50;
}

.feedback.hidden {
    display: none;
}

.feedback-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.feedback-icon {
    font-size: 1.5rem;
}

.next-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
}

/* Results */
.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.score-circle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border-radius: 50%;
    color: white;
    margin: 20px 0;
}

.score {
    font-size: 1.5rem;
    font-weight: bold;
}

.percentage {
    font-size: 1rem;
}

.badge-earned {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 20px;
    margin-bottom: 25px;
    font-weight: bold;
    color: white;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
    animation: badgeGlow 2s ease-in-out infinite alternate;
}

.badge-icon {
    font-size: 2rem;
    animation: bounce 1s ease-in-out infinite alternate;
}

@keyframes badgeGlow {
    0% { box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3); }
    100% { box-shadow: 0 12px 35px rgba(255, 215, 0, 0.5); }
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.next-review {
    text-align: center;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 10px;
    margin-bottom: 25px;
}

/* Leaderboard */
.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.tab {
    flex: 1;
    padding: 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.tab.active {
    background: #667eea;
    color: white;
}

.leaderboard-list {
    display: grid;
    gap: 15px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    transition: transform 0.2s;
}

.leaderboard-item:hover {
    transform: translateX(5px);
}

.leaderboard-item.current-user {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.rank {
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gold-medal {
    color: #FFD700;
}

.silver-medal {
    color: #C0C0C0;
}

.bronze-medal {
    color: #CD7F32;
}

.user {
    flex: 1;
}

.user .name {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.user .level {
    font-size: 0.9rem;
    opacity: 0.8;
}

.score {
    font-weight: bold;
}

/* Navigation Buttons */
.nav-button {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-button:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.nav-button.secondary {
    background: #6c757d;
}

.nav-button.secondary:hover {
    background: #5a6268;
}

/* Responsive */
@media (max-width: 1024px) {
    .app {
        max-width: 900px;
        padding: 20px 30px;
    }
    
    .books-grid-home {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 25px;
    }
    
    .science-cards {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .app {
        max-width: 100%;
        padding: 15px 20px;
    }
    
    .screen {
        padding: 25px;
    }
    
    header {
        flex-direction: column;
        text-align: center;
        padding: 0;
    }
    
    .logo span {
        font-size: 2.5rem;
    }
    
    .stats-preview {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: none;
    }
    
    .books-grid-home {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 20px;
    }
    
    .book-card-home {
        padding: 15px;
    }
    
    .book-card-home .book-cover {
        width: 80px;
        height: 100px;
    }
    
    .science-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .community-badges {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .book-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .badges {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .app {
        padding: 10px 15px;
    }
    
    .screen {
        padding: 20px;
    }
    
    .books-grid-home {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 15px;
    }
}