:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-bg: #f9f9f9;
    --text-color: #333;
    --white: #ffffff;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

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

/* Header */
header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--secondary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 5px 0;
}

/* Hero Section */
.hero {
    background-color: var(--light-bg);
    padding: 80px 0;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.hero-text p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #666;
}

.hero-image {
    flex: 1;
}

.hero-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
}

.primary-btn {
    background-color: var(--secondary-color);
    color: var(--white);
}

.primary-btn:hover {
    background-color: #2980b9;
}

.secondary-btn {
    background-color: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 8px 20px;
}

.secondary-btn:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* Topics Section */
.topics {
    padding: 80px 0;
}

.topics h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--primary-color);
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.topic-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

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

.topic-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 25px;
}

.card-content h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.card-content p {
    margin-bottom: 20px;
    color: #666;
}

/* Lesson Section */
.lesson-section {
    padding: 80px 0;
    background-color: var(--white);
}

.lesson-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.lesson-text {
    flex: 1;
}

.lesson-text h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.formula-box {
    background-color: var(--light-bg);
    border-left: 5px solid var(--secondary-color);
    padding: 15px;
    font-size: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
    margin: 20px 0;
    font-weight: bold;
}

.lesson-steps {
    list-style: none;
    margin-top: 10px;
}

.lesson-steps li {
    margin-bottom: 5px;
    padding-left: 10px;
    border-left: 2px solid #ddd;
}

.lesson-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

.triangle-container {
    position: relative;
    width: 200px;
    height: 200px;
}

.triangle-shape {
    width: 0;
    height: 0;
    border-bottom: 150px solid var(--accent-color);
    border-right: 200px solid transparent;
}

.label-a { position: absolute; left: -20px; top: 75px; font-weight: bold; }
.label-b { position: absolute; bottom: -25px; left: 100px; font-weight: bold; }
.label-c { position: absolute; top: 60px; left: 110px; font-weight: bold; }

/* Formulas Section */
.formulas-section {
    padding: 80px 0;
    background-color: var(--light-bg);
}

.formulas-section h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.formula-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.formula-table th, .formula-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.formula-table th {
    background-color: var(--primary-color);
    color: var(--white);
}

.formula-table tr:hover {
    background-color: #f1f1f1;
}

/* Quiz Section */
.quiz-section {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.quiz-section h2 {
    margin-bottom: 40px;
}

.quiz-container {
    background: rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.stats {
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-align: right;
}

#question {
    font-size: 2rem;
    margin-bottom: 30px;
    font-weight: bold;
}

.input-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

#answer-input {
    padding: 10px;
    font-size: 1.2rem;
    border-radius: 5px;
    border: none;
    width: 150px;
    text-align: center;
}

.quiz-btn {
    padding: 10px 25px;
    font-size: 1.1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: var(--secondary-color);
    color: var(--white);
    transition: transform 0.2s;
}

.quiz-btn:hover {
    transform: scale(1.05);
    background-color: #2980b9;
}

#new-q-btn {
    margin-top: 20px;
    border-color: var(--white);
    color: var(--white);
}

#new-q-btn:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

#result {
    font-size: 1.2rem;
    font-weight: bold;
    height: 30px;
    margin-top: 10px;
}

/* Glossary Section */
.glossary-section {
    padding: 80px 0;
    background-color: var(--white);
}

.glossary-section h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
}

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

.glossary-item {
    background-color: var(--light-bg);
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    transition: transform 0.2s;
}

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

.glossary-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.glossary-item p {
    font-size: 0.95rem;
    color: #555;
}

/* Study Tips Section */
.tips-section {
    padding: 80px 0;
    background-color: var(--primary-color);
    color: var(--white);
}

.tips-section h2 {
    text-align: center;
    margin-bottom: 50px;
}

.tips-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.tip-card {
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 15px;
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    text-align: center;
    backdrop-filter: blur(5px);
}

.tip-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.tip-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.tip-card p {
    color: #ddd;
    font-size: 1rem;
}

/* Footer */
footer {
    background-color: #222;
    color: #ddd;
    padding: 60px 0 20px;
}

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

.footer-section h4 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #ddd;
    text-decoration: none;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
}
