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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
}

.navbar {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    gap: 2rem;
}

.logo {
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    min-width: fit-content;
    letter-spacing: 0.5px;
}

/* Professional Search Bar */
.search-wrapper {
    display: flex;
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-box-container {
    width: 100%;
    position: relative;
}

.search-input-group {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.search-input-group:focus-within {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.search-icon {
    color: #667eea;
    margin-right: 0.8rem;
    font-size: 1rem;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #333;
    background: transparent;
    width: 100%;
}

.search-input::placeholder {
    color: #999;
    font-size: 0.9rem;
}

.search-filter-toggle {
    cursor: pointer;
    color: #667eea;
    margin-left: 0.8rem;
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.search-filter-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #5568d3;
}

/* Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestion-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: #f9f9f9;
    padding-left: 1.2rem;
}

/* Search Filters */
.search-filters {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 8px;
    padding: 0.8rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: slideDown 0.2s ease;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    color: #333;
}

.filter-option:hover {
    background: #f9f9f9;
}

.filter-option input {
    cursor: pointer;
    margin-right: 0.6rem;
    accent-color: #667eea;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    min-width: fit-content;
}

.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
}

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

.btn-login:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-logout {
    background: #f44336;
    color: white;
}

.btn-logout:hover {
    background: #da190b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-danger {
    background: #f44336;
    color: white;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: #da190b;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-modal-content {
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

.search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
}

.search-modal-header h2 {
    color: #333;
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    color: #333;
    background: #f0f0f0;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.close {
    color: #aaa;
    float: right;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#loginForm input {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

#loginForm input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}

.error {
    color: #f44336;
    text-align: center;
    display: none;
    font-size: 0.9rem;
}

/* Search Results */
.search-results {
    margin-top: 1rem;
}

.search-results h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.search-result-item {
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
    padding: 1.2rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-result-item:hover {
    background: linear-gradient(135deg, #f0f0f0 0%, #f9f9f9 100%);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-result-item h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.search-result-item p {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.result-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-top: 0.8rem;
}

.result-link:hover {
    color: #5568d3;
    gap: 0.6rem;
}

.loading {
    color: #667eea;
    text-align: center;
    font-size: 1.1rem;
    padding: 2rem;
}

.no-results {
    color: #999;
    text-align: center;
    padding: 2rem;
    font-size: 1rem;
}

/* Stats Section */
.stats-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stats-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.stat-card h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

/* Featured Section */
.featured-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.featured-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.featured-subsection {
    margin-bottom: 2rem;
}

.featured-subsection h3 {
    margin-bottom: 1rem;
    color: #555;
    font-size: 1.2rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.featured-item {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.featured-item:hover {
    background: #eee;
    transform: translateY(-2px);
}

.featured-item strong {
    color: #333;
}

.featured-item p {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Featured Link Styling */
.featured-link {
    text-decoration: none;
    display: block;
    color: inherit;
}

.featured-link:hover strong {
    color: #667eea;
}

.featured-link:hover {
    background: #efefef;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Admin Panel */
.admin-panel {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.admin-panel h2 {
    color: #333;
    margin-bottom: 0.5rem;
}

.admin-badge {
    color: #4CAF50;
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem;
    cursor: pointer;
    color: #666;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-group input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}

.feature-form {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.feature-form h4 {
    margin-bottom: 1rem;
    color: #333;
}

.feature-form input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}

.feature-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}

.feature-form .btn {
    width: 100%;
}

.list, .manage-list {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.list-item, .manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: white;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    border-left: 3px solid #667eea;
}

.manage-section {
    margin-bottom: 2rem;
}

.manage-section h4 {
    margin-bottom: 1rem;
    color: #333;
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-container {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .search-wrapper {
        flex-basis: 100%;
        order: 2;
        max-width: 100%;
    }

    .nav-buttons {
        order: 3;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .search-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .admin-tabs {
        flex-direction: column;
    }

    .tab-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .tab-btn.active {
        border-bottom: none;
        border-left-color: #667eea;
    }

    .search-modal-content {
        margin: 20% auto;
        max-width: 90%;
    }

    .search-input {
        font-size: 16px;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

.leaderboard-section {
    margin-top: 40px;
}

.leaderboard-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leaderboard-rank {
    font-size: 1.4rem;
    font-weight: bold;
    color: #ffd700;
}

.leaderboard-info p {
    margin: 0;
    color: #ccc;
}

.leaderboard-link {
    color: #4da3ff;
    text-decoration: none;
    font-weight: bold;
}

.featured-item {
    background: #1e1e1e;
    border-left: 4px solid #4da3ff;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: block;
    text-decoration: none;
    color: #fff;
    transition: transform 0.15s ease, background 0.15s ease;
}

.featured-item:hover {
    background: #252525;
    transform: translateY(-2px);
}

.featured-item p {
    margin: 4px 0 0;
    color: #ccc;
}
