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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1a1a1a;
    min-height: 100vh;
    margin: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 800px;
    margin: 40px auto;
    background: #2d2d2d;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    width: 90%; /* Responsive width with max-width cap */
}

header {
    background: #1a1a1a;
    color: white;
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid #404040;
}

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

.logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.header-text {
    text-align: left;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.7;
    color: #aaa;
}

.section {
    padding: 30px;
}

.hidden {
    display: none;
}

h2 {
    color: #ffffff;
    margin-bottom: 25px;
    font-size: 1.8em;
}

h3 {
    color: #5fc4c0;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: #5fc4c0;
    color: #1a1a1a;
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(95, 196, 192, 0.4);
    background: #6dd4d0;
}

.btn-secondary {
    background: #3a3a3a;
    color: #ffffff;
    border: 2px solid #4a4a4a;
}

.btn-secondary:hover {
    background: #454545;
    border-color: #5fc4c0;
    transform: translateY(-2px);
}

.btn-back {
    background: transparent;
    border: none;
    color: #5fc4c0;
    font-size: 1em;
    cursor: pointer;
    padding: 10px;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.btn-back:hover {
    color: #6dd4d0;
}

#question-header {
    margin-bottom: 30px;
}

.question-navigation-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 15px;
}

.question-counter {
    color: #999;
    font-size: 0.9em;
    margin: 0;
}

.go-to-question {
    display: flex;
    align-items: center;
    gap: 8px;
}

#go-to-input {
    width: 70px;
    padding: 6px 10px;
    background: #3a3a3a;
    border: 1px solid #5fc4c0;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.9em;
    text-align: center;
}

#go-to-input:focus {
    outline: none;
    border-color: #6dd4d0;
    box-shadow: 0 0 0 2px rgba(95, 196, 192, 0.2);
}

#go-to-input::placeholder {
    color: #666;
}

.btn-go {
    padding: 6px 16px;
    background: #5fc4c0;
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-go:hover {
    background: #6dd4d0;
    transform: translateY(-1px);
}

.question-text {
    background: #3a3a3a;
    padding: 25px;
    border-radius: 8px;
    font-size: 1.2em;
    color: #ffffff;
    margin-bottom: 25px;
    border-left: 4px solid #5fc4c0;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.answer-option {
    padding: 15px 20px;
    background: #3a3a3a;
    color: #ffffff;
    border: 2px solid #4a4a4a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    text-align: left;
}

.answer-option:hover {
    border-color: #5fc4c0;
    background: #454545;
}

.answer-option.selected {
    border-color: #5fc4c0;
    background: #2d4a49;
}

.answer-option.correct {
    border-color: #5fc4c0;
    background: #2d4a49;
    color: #ffffff;
}

.answer-option.incorrect {
    border-color: #ff6b6b;
    background: #4a2d2d;
    color: #ffffff;
}

.answer-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.explanation {
    background: #3a3a2d;
    border: 2px solid #d4af37;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.explanation h4 {
    color: #f5d76e;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.explanation p {
    color: #e8e8e8;
    line-height: 1.6;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.navigation-buttons .btn {
    flex: 1;
}

/* Category buttons grid */
#category-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

/* Class tabs layout */
.class-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.class-tab {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    background: #3a3a3a;
    color: #ffffff;
    border: 2px solid #4a4a4a;
}

.class-tab:hover {
    background: #454545;
    border-color: #5fc4c0;
}

.class-tab.active {
    background: #5fc4c0;
    color: #1a1a1a;
    border-color: #5fc4c0;
    font-weight: 600;
}

/* Topics grid */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.topic-card {
    background: #3a3a3a;
    color: #ffffff;
    border: 2px solid #4a4a4a;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.topic-card:hover {
    border-color: #5fc4c0;
    background: #454545;
    transform: translateY(-2px);
}

.topic-card.highlighted {
    border-color: #5fc4c0;
    background: #2d4a49;
}

.topic-icon {
    font-size: 1.5em;
    min-width: 30px;
    text-align: center;
}

.topic-info {
    flex: 1;
}

.topic-name {
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 5px;
}

/* Download Mobile App Section */
.download-app-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #4a4a4a;
    text-align: center;
}

.download-app-btn {
    display: inline-block;
    padding: 20px 40px;
    background: linear-gradient(135deg, #d94141 0%, #3b5998 100%);
    color: white;
    font-size: 1.3em;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(217, 65, 65, 0.4);
}

.download-app-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(217, 65, 65, 0.6);
    background: linear-gradient(135deg, #3b5998 0%, #d94141 100%);
}

/* Responsive design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 0;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .header-content {
        flex-direction: row;
    }
    
    .logo {
        width: 50px;
        height: 50px;
    }
    
    .section {
        padding: 20px;
    }
    
    h2 {
        font-size: 1.5em;
    }
    
    .question-text {
        font-size: 1em;
        padding: 20px;
    }
    
    .navigation-buttons {
        flex-direction: column;
    }
    
    #category-buttons {
        grid-template-columns: 1fr;
    }
    
    .class-tabs {
        flex-direction: column;
    }
    
    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .question-navigation-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .go-to-question {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Footer */
footer {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 30px 20px;
    text-align: center;
    border-top: 2px solid #404040;
    margin-top: auto; /* Push to bottom */
    width: 100%;
}

.footer-message {
    font-size: 1.2em;
    color: #5fc4c0;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-copyright {
    font-size: 0.9em;
    color: #888;
}
