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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-bg: #ecf0f1;
    --dark-text: #2c3e50;
    --light-text: #7f8c8d;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: var(--light-bg);
}

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

/* Header Styles */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 60px 20px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.hero .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Language Selector */
.language-selector {
    display: flex;
    align-items: center;
}

.language-select {
    padding: 10px 15px;
    font-size: 1rem;
    border: 2px solid white;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.language-select:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.language-select option {
    background-color: var(--primary-color);
    color: white;
}

/* Filters Section */
.filters {
    margin: 40px 0 30px;
}

.filters h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--secondary-color);
    background-color: white;
    color: var(--secondary-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

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

/* Fallacies Grid */
.fallacies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.fallacy-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 450px;
}

.fallacy-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.fallacy-card.hidden {
    display: none;
}

.fallacy-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background-color: var(--light-bg);
}

.fallacy-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.fallacy-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    line-height: 1.3;
}

.fallacy-description {
    font-size: 0.9rem;
    color: var(--dark-text);
    margin-bottom: 10px;
    line-height: 1.5;
}

.fallacy-example {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--light-text);
    margin-bottom: 15px;
    padding: 8px 12px;
    background-color: rgba(236, 240, 241, 0.5);
    border-left: 3px solid var(--light-bg);
    border-radius: 4px;
    line-height: 1.4;
}

.fallacy-tag {
    display: inline-block;
    padding: 5px 12px;
    background-color: var(--light-bg);
    color: var(--secondary-color);
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    align-self: flex-start;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.modal-content {
    background-color: white;
    margin: 20px;
    padding: 0;
    border-radius: 15px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.close-btn {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    padding: 10px 20px;
    line-height: 1;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--accent-color);
}

.modal-body {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow-y: auto;
}

#modalImage {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    background-color: var(--light-bg);
}

.modal-text {
    padding: 30px;
}

#modalTitle {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

#modalDescription {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark-text);
    margin-bottom: 20px;
}

#modalDescription p {
    margin-bottom: 15px;
}

.modal-example {
    font-style: italic;
    font-size: 0.95rem;
    color: var(--light-text);
    padding: 10px 15px;
    border-left: 3px solid var(--light-bg);
    background-color: rgba(236, 240, 241, 0.3);
}

.modal-tag {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
}

footer p {
    opacity: 0.8;
    font-size: 0.9rem;
}

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

    .hero h1 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .fallacies-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .modal-body {
        flex-direction: column;
    }

    #modalTitle {
        font-size: 1.5rem;
    }

    #modalDescription {
        font-size: 1rem;
    }

    .modal-text {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .fallacies-grid {
        grid-template-columns: 1fr;
    }

    .filter-btn {
        font-size: 0.85rem;
        padding: 8px 16px;
    }
}
