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

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: #333;
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-link {
    color: #ccc;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: white;
    background: #007bff;
}

.tag-filter-bar {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 15px 20px;
}

.tag-filter-header {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    font-size: 14px;
}

.tag-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-nav-btn {
    background: white;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tag-nav-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.tag-nav-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.tag-nav-btn.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.content {
    padding: 20px;
    min-height: 400px;
}

.controls {
    text-align: center;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.question-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.question-number {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.question-tag {
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 500;
}

.question-text {
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

.question-image {
    margin: 15px 0;
    text-align: center;
}

.question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.answer-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.answer-text {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
    border-left: 3px solid #28a745;
    white-space: pre-wrap;
    line-height: 1.5;
}

.reference-link {
    margin-top: 10px;
}

.reference-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.reference-link a:hover {
    text-decoration: underline;
}

.hidden {
    display: none;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}

.error {
    background: #dc3545;
    color: white;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    text-align: center;
    font-weight: 500;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Responsive design */
@media (max-width: 600px) {
    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .tag-filter-bar {
        padding: 10px 15px;
    }
    
    .tag-nav-links {
        justify-content: center;
    }
    
    .question-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .controls {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .controls .btn {
        width: 100%;
        max-width: 200px;
    }
}