:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --text: #212529;
    --text-light: #6c757d;
    --background: #ffffff;
    --surface: #f8f9fa;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --success: #4bb543;
    --success-light: #5ac552;
    --error: #e63946;
    --warning: #ff9f1c;
}

[data-theme="dark"] {
    --primary: #4895ef;
    --primary-light: #4361ee;
    --secondary: #3a0ca3;
    --text: #f8f9fa;
    --text-light: #adb5bd;
    --background: #121212;
    --surface: #1e1e1e;
    --border: #343a40;
    --shadow: rgba(0, 0, 0, 0.3);
    --success: #4bb543;
    --success-light: #5ac552;
    --error: #e63946;
    --warning: #ff9f1c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
    padding: 0;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 3.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    z-index: 10;
}

.hero {
    text-align: center;
    padding: 40px 0 30px;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

/* Redesigned Fact Display Section */
.fact-display-section {
    max-width: 900px;
    margin: 0 auto 60px;
}

.fact-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--background) 100%);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 30px var(--shadow);
    text-align: center;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.fact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.fact-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.fact-header h3 {
    color: var(--primary);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.fact-text-container {
    position: relative;
    margin-bottom: 35px;
}

.fact-text {
    min-height: 140px;
    font-size: 1.3rem;
    padding: 30px;
    border-radius: 12px;
    background-color: var(--background);
    color: inherit;
    line-height: 1.7;
    text-align: center;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: rgba(67, 97, 238, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(67, 97, 238, 0.2);
}

.section {
    padding: 40px 0;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 40px;
    color: var(--text);
}

.features {
    background-color: var(--surface);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.feature-card {
    background-color: var(--background);
    border-radius: 12px;
    padding: 25px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
}

/* Add stronger shadows in light mode */
[data-theme="light"] .feature-card {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.faq-item {
    margin-bottom: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Add shadows to FAQ in light mode */
[data-theme="light"] .faq-item {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.faq-question {
    padding: 18px;
    background-color: var(--surface);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.faq-question:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

.faq-answer {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer.active {
    padding: 18px;
    max-height: 500px;
}

.faq-icon {
    transition: transform 0.3s;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    margin-bottom: 20px;
    color: var(--text);
    line-height: 1.7;
}

.about-content h2 {
    margin: 30px 0 15px;
    color: var(--text);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: var(--success);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(150%);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.notification.show {
    transform: translateX(0);
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Fact Loading Animation */
.fact-loading {
    display: inline-block;
    width: 100%;
    text-align: center;
}

.fact-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        color: rgba(0,0,0,0);
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    40% {
        color: var(--primary);
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    60% {
        text-shadow:
            .25em 0 0 var(--primary),
            .5em 0 0 rgba(0,0,0,0);
    }
    80%, 100% {
        text-shadow:
            .25em 0 0 var(--primary),
            .5em 0 0 var(--primary);
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .fact-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .fact-text {
        min-height: 120px;
        padding: 25px 20px;
        font-size: 1.1rem;
    }

    .fact-card {
        padding: 30px 20px;
    }
    
    .theme-toggle {
        right: 1rem;
        top: 3rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .fact-card {
        padding: 25px 15px;
    }
    
    .fact-text {
        padding: 20px 15px;
        min-height: 100px;
        font-size: 1rem;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.7rem;
    }
}

@media (min-width: 992px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}