:root {
    --primary-color: #4CAF50;
    --secondary-color: #8BC34A;
    --dark-green: #2E7D32;
    --darker-green: #1B5E20;
    --background-color: #1a1a1a;
    --darker-bg: #121212;
    --text-color: #e0e0e0;
    --light-gray: #555;
    --border-radius: 4px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --search-highlight-color: #947e00;
    --header-pattern: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29-22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-29c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM60 91c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM35 41c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM12 60c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z' fill='%232e7d32' fill-opacity='0.2' fill-rule='evenodd'/%3E%3C/svg%3E");
}

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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjUiPgo8cmVjdCB3aWR0aD0iNSIgaGVpZ2h0PSI1IiBmaWxsPSIjMDAwMDAwIj48L3JlY3Q+CjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IiMxMTExMTEiIHg9IjEiIHk9IjEiPjwvcmVjdD4KPC9zdmc+');
    padding: 0;
    margin: 0;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    margin-bottom: 2.5rem;
    text-align: center;
    background: linear-gradient(145deg, var(--darker-green), var(--primary-color));
    background-image: var(--header-pattern), linear-gradient(145deg, var(--darker-green), var(--primary-color));
    border-radius: var(--border-radius);
    padding: 1.5rem 1rem;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(76, 175, 80, 0.3);
    position: relative;
    overflow: hidden;
}

header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    pointer-events: none;
}

h1 {
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    text-align: left;
    font-weight: 700;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
    padding: 0 10px;
}

h1::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 60px;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 2px;
}

p {
    text-align: left;
}

mark {
    background-color: var(--search-highlight-color);
    color: var(--text-color);
    border-radius: 3px;
}

.search-container {
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.search-bar {
    display: flex;
    gap: 0;
    flex: 1;
    min-width: 300px;
    position: relative;
    background: var(--darker-bg);
    border-radius: var(--border-radius);
    border: 2px solid #3a3a3a;
    transition: all 0.2s ease;
    overflow: hidden;
    height: 48px;
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    z-index: 1;
    font-size: 0.9em;
}

#searchInput {
    width: 100%;
    padding: 0 1.5rem 0 2.5rem;
    font-size: 1rem;
    border: none;
    background: #1e1e1e;
    transition: all 0.2s ease;
    font-family: inherit;
    color: #f0f0f0;
    outline: none;
    height: 100%;
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.2);
}

#resultCount {
    text-align: right;
    font-size: 0.9rem;
    color: #272727;
    margin-top: 0.5rem;
    font-style: italic;
}

#searchButton {
    padding: 0 1.25rem;
    font-size: 1rem;
    background: #3a3a3a;
    color: #aaa;
    border: none;
    border-left: 2px solid #2a2a2a;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

#searchButton i {
    transition: all 0.2s ease;
}

#searchButton:hover {
    background: #444;
    color: #fff;
}

#searchButton:active {
    background: #333;
    transform: translateY(1px);
}

.sort-options {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1e1e1e;
    border-radius: var(--border-radius);
    padding: 0 12px;
    height: 48px;
    border: 2px solid #3a3a3a;
    transition: all 0.2s ease;
}

.sort-options i {
    color: #777;
    font-size: 0.9em;
}

#sortBy {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    padding: 0.5rem 1.5rem 0.5rem 0.5rem;
    cursor: pointer;
    outline: none;
    width: 160px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

#sortBy option {
    background: var(--darker-bg);
    color: var(--text-color);
    padding: 8px 12px;
}

#sortBy:focus {
    color: #fff;
}

#sortBy:hover {
    color: #fff;
}

#sortBy option:checked {
    background-color: var(--primary-color);
    color: white;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.9rem;
    user-select: none;
    transition: color 0.2s ease;
}

.filter-checkbox:hover {
    color: #fff;
}

.filter-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: var(--darker-bg);
    border: 2px solid #3a3a3a;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.filter-checkbox:hover .checkmark {
    border-color: #555;
}

.filter-checkbox input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-checkbox input:checked ~ .checkmark:after {
    display: block;
}

#sortBy {
    padding: 0 24px 0 8px;
    border: none;
    background-color: transparent;
    font-size: 14px;
    cursor: pointer;
    color: #f0f0f0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23777%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    height: 100%;
    transition: all 0.2s ease;
    font-weight: 500;
}

#sortBy:hover, #sortBy:focus {
    color: #fff;
    outline: none;
}

#sortBy option {
    background: #2a2a2a;
    color: #f0f0f0;
    padding: 8px;
}

#loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: var(--light-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#loading::before {
    content: '⛏️';
    font-size: 2rem;
    animation: mining 1.5s ease-in-out infinite;
}

@keyframes mining {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-btn {
    background: rgba(30, 30, 30, 0.8);
    color: var(--text-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    min-width: 2.5rem;
    text-align: center;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    border-color: var(--primary-color);
}

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

.ellipsis {
    color: var(--text-color);
    padding: 0 0.5rem;
    user-select: none;
}

.article {
    background: rgba(30, 30, 30, 0.8);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

.article:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(76, 175, 80, 0.3);
    background: rgba(40, 40, 40, 0.9);
}

.article h2 {
    color: #fff;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article h2::before {
    content: '📄';
    font-size: 1.2em;
}

.article a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 1rem;
    transition: all 0.2s ease;
    background: rgba(76, 175, 80, 0.1);
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.article a::after {
    content: '→';
    transition: transform 0.2s ease;
}

.article a:hover {
    background: rgba(76, 175, 80, 0.2);
    transform: translateX(4px);
}

.article a:hover::after {
    transform: translateX(2px);
}

.article a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
        text-align: center;
    }
    
    h1::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-bar {
        min-width: 100%;
    }
    
    .sort-options {
        justify-content: space-between;
        padding: 10px;
    }
    
    .article {
        padding: 1.25rem;
    }
}
