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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
}

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

header {
    background-color: #4CAF50;
    color: white;
    padding: 20px;
    margin-bottom: 20px;
}

header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
}

header p {
    margin: 0;
    opacity: 0.9;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

#user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    color: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}

#user-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#user-role {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

#logout-btn {
    padding: 8px 16px;
    background-color: white;
    color: #4CAF50;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

#logout-btn:hover {
    background-color: #f0f0f0;
}

.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    background-color: white;
    color: #4CAF50;
    border-radius: 3px;
    font-size: 14px;
    margin-left: 10px;
}

.user-badge {
    display: inline-block;
    padding: 2px 8px;
    background-color: white;
    color: #4CAF50;
    border-radius: 3px;
    font-size: 14px;
    margin-left: 10px;
}

main {
    padding: 20px;
}

.admin-controls,
.filter-controls {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-controls h3,
.filter-controls h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.admin-actions,
.filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-actions button,
.filter-actions button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.admin-actions button:hover,
.filter-actions button:hover {
    background-color: #45a049;
}

.admin-actions button.delete-btn {
    background-color: #f44336;
}

.admin-actions button.delete-btn:hover {
    background-color: #da190b;
}

.filter-actions input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.question-block {
    background-color: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.question-block:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.question-select {
    transform: scale(1.2);
}

.question-title-link {
    flex: 1;
    margin: 0;
    color: #333;
    font-size: 18px;
    cursor: pointer;
}

.question-type-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: #2196F3;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.question-stem {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
}

.question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

.question-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.question-actions button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.question-actions button:hover {
    background-color: #45a049;
}

.question-actions button.edit-btn {
    background-color: #FF9800;
}

.question-actions button.edit-btn:hover {
    background-color: #F57C00;
}

.question-actions button.delete-btn {
    background-color: #f44336;
}

.question-actions button.delete-btn:hover {
    background-color: #da190b;
}

.no-questions {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.auth-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    max-width: 400px;
    margin: 0 auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: #333;
    font-size: 24px;
    margin-bottom: 10px;
}

.auth-header p {
    color: #666;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

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

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-footer a {
    color: #4CAF50;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.hidden {
    display: none !important;
}

.loading-container {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-container {
    text-align: center;
    padding: 40px;
    background-color: #f8d7da;
    border-radius: 8px;
    margin: 20px;
}

.error-container p {
    color: #721c24;
    font-size: 16px;
    margin-bottom: 20px;
}

.error-container button {
    padding: 10px 20px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.question-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.question-detail h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.question-detail .question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.type-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: #2196F3;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.answer-section,
.explanation-section,
.remark-section,
.knowledge-section {
    margin-top: 25px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.answer-section h3,
.explanation-section h3,
.remark-section h3,
.knowledge-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.answer-section h3:hover,
.explanation-section h3:hover,
.remark-section h3:hover {
    color: #4CAF50;
}

.actions {
    margin-top: 30px;
    text-align: center;
}

.actions button {
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.actions button:hover {
    background-color: #45a049;
}

.edit-form {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.edit-form h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
}

.form-actions button[type="submit"] {
    background-color: #4CAF50;
    color: white;
}

.form-actions button[type="button"] {
    background-color: #f5f5f5;
    color: #333;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .admin-actions,
    .filter-actions {
        flex-direction: column;
    }
    
    .admin-actions button,
    .filter-actions button {
        width: 100%;
    }
    
    .question-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .question-actions {
        flex-direction: column;
    }
    
    .question-actions button {
        width: 100%;
    }
}
