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

/* Hide content in different languages initially */
[lang] {
    display: none;
}

/* Language switcher styles */
.language-switcher {
    background-color: #333;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.language-switcher label {
    color: white;
    font-family: 'Patrick Hand', cursive;
    margin-right: 10px;
    font-size: 1.1rem;
}

#language-selector {
    font-family: 'Patrick Hand', cursive;
    padding: 8px 15px;
    border-radius: 5px;
    background-color: #fff;
    border: 2px solid #e91e63;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#language-selector:hover {
    background-color: #ffeb3b;
    border-color: #ff5722;
    transform: scale(1.05);
}

#language-selector:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.3);
}

body {
    font-family: 'Patrick Hand', cursive;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    font-size: 18px;
}

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

header {
    background-color: #ffeb3b;
    text-align: center;
    padding: 40px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

h1, h2, h3 {
    font-family: 'Caveat', cursive;
    font-weight: 700;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: #333;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
}

h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #333;
}

.math-problem {
    font-size: 2.5rem;
    background-color: white;
    display: inline-block;
    padding: 20px 40px;
    border-radius: 10px;
    border: 3px solid #333;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.2);
    margin: 20px 0;
    transform: rotate(-2deg);
}

.math-problem h2 {
    font-size: 3.5rem;
    margin: 0;
    font-weight: 700;
}

.alt-notation {
    font-size: 1.8rem;
    margin: 5px 0 0;
    font-weight: 500;
    font-family: 'Caveat', cursive;
    color: #666;
    font-style: italic;
}

section {
    margin-bottom: 50px;
    background-color: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #e91e63;
    border-bottom: 3px dashed #e91e63;
    padding-bottom: 10px;
}

p {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.answer-container, .explanation-container, .problem-container, .meme-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}

.answer-box, .explanation-box, .problem-box, .meme-box {
    background-color: #f5f5f5;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.1);
    flex: 1 1 45%;
    min-width: 300px;
    transform: rotate(1deg);
    border: 2px solid #333;
}

.answer-box:nth-child(even), .explanation-box:nth-child(even), 
.problem-box:nth-child(even), .meme-box:nth-child(even) {
    transform: rotate(-1deg);
}

.answer-box h3 {
    text-align: center;
    background-color: #4caf50;
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.answer-box:nth-child(2) h3 {
    background-color: #2196f3;
}

ol, ul {
    margin-left: 30px;
    margin-bottom: 15px;
}

.meme-box {
    background-color: #fff3cd;
    text-align: center;
    padding: 25px;
    font-size: 1.5rem;
    font-weight: bold;
}

.meme-caption {
    font-size: 1.2rem;
    font-style: italic;
    margin-top: 15px;
    color: #666;
}

.qa-container details {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 5px solid #3f51b5;
}

.qa-container summary {
    font-weight: bold;
    cursor: pointer;
    font-size: 1.3rem;
    color: #3f51b5;
    padding: 5px 0;
}

.qa-container details p {
    padding: 10px;
    background: white;
    border-radius: 5px;
    margin-top: 10px;
}

footer {
    background-color: #333;
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: 50px;
}

footer p {
    margin: 5px 0;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .answer-container, .explanation-container, .problem-container, .meme-container {
        flex-direction: column;
    }
    
    .math-problem h2 {
        font-size: 2.5rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
}
