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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

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

header {
    background-color: #4CAF50;
    color: white;
    padding: 1rem 0;
}

header h1 {
    margin-bottom: 1rem;
}

header a {
    color: white;
    text-decoration: none;
}

nav ul {
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
}

nav ul li {
    margin-right: 1rem;
}

main {
    padding: 2rem 0;
}

footer {
    background-color: #333;
    color: white;
    padding: 1rem 0;
    margin-top: 2rem;
}

footer a {
    color: white;
    text-decoration: none;
}

footer p {
    margin-top: 1rem;
    text-align: center;
}

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }

    nav ul li {
        margin-bottom: 0.5rem;
    }
    .container {
        padding: 0 10px;
    }
    h1 {
        font-size: 24px;
    }
    h2 {
        font-size: 20px;
    }
    .question-image {
        max-width: 100%;
        height: auto;
    }
    .answer {
        padding: 8px;
    }
    .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Existing styles */
h1, h2, h3 {
    color: #333;
    margin-bottom: 1rem;
}

.question-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.answer {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.answer:hover {
    background-color: #f0f0f0;
}

.correct {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.explanation {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 5px solid #007bff;
}

.tags {
    margin-top: 20px;
}

.tag {
    display: inline-block;
    padding: 5px 10px;
    margin-right: 5px;
    background-color: #e9ecef;
    border-radius: 20px;
    font-size: 0.9em;
}

.btn {
    display: inline-block;
    background: #4CAF50;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    margin-top: 20px;
}

.btn:hover {
    background: #45a049;
}

.btn-deselect {
    background: #f44336;
}

.btn-deselect:hover {
    background: #d32f2f;
}

.selected {
    font-weight: bold;
}

.correct-answer {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.incorrect-answer {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.result {
    margin-top: 20px;
    font-weight: bold;
    font-size: 18px;
}

.breadcrumb {
    margin-bottom: 20px;
    font-size: 12px;
    line-height: 1.4;
    word-wrap: break-word;
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
    font-size: 12px;
}

@media (max-width: 768px) {
    .breadcrumb {
        font-size: 11px;
    }
    
    .breadcrumb a {
        font-size: 11px;
    }
}

.rating {
    margin-top: 20px;
}

.star {
    font-size: 24px;
    color: #ccc;
    cursor: pointer;
}

.star.active {
    color: #ffd700;
}

.related-questions {
    margin-top: 40px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a, .pagination strong {
    padding: 5px 10px;
    border: 1px solid #ddd;
    margin: 0 4px;
    text-decoration: none;
    color: black;
    background-color: #fff;
    transition: background-color 0.3s, color 0.3s;
}

.pagination a:hover {
    background-color: #4CAF50;
    color: white;
}

.pagination a:first-child,
.pagination a:last-child {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.pagination a:first-child:hover,
.pagination a:last-child:hover {
    background-color: #45a049;
}

.search-container {
    margin: 20px 0;
}

#search-box {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 2px solid #4CAF50;
    border-radius: 5px;
}

.ui-autocomplete {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
}

a {
    text-decoration: none;
    color: black;
}

a:hover {
    text-decoration: none;
}

/* Override any specific link styles that might have been set elsewhere */
.breadcrumb a,
.tag,
nav a,
.question-list a,
table a {
    color: black;
    text-decoration: none;
}

/* Ensure buttons and other interactive elements are still distinguishable */
.btn,
.btn-nav,
.pagination a {
    color: white;
}

/* Keep footer links white for better contrast */
footer a {
    color: white;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.category-item:hover {
    background-color: #f0f0f0;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.category-item span {
    text-align: center;
    font-weight: bold;
}

.vote-buttons {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    align-items: center;
}

.vote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vote-btn:hover {
    background: #f5f5f5;
}

.vote-btn.upvote:hover {
    color: #4CAF50;
    border-color: #4CAF50;
}

.vote-btn.downvote:hover {
    color: #f44336;
    border-color: #f44336;
}

.vote-count {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

