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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Navbar */
.navbar {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.navbar-hidden {
    transform: translateY(-100%);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.logo-icon {
    font-size: 32px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 4px;
}

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

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #fff;
}

.nav-link.active {
    background: rgba(102, 126, 234, 0.2);
    color: #fff;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: var(--border-color);
    color: #fff;
    border: 1px solid var(--border-hover);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: #fff;
}

/* Search */
.search-container {
    position: relative;
}

.search-icon {
    width: 36px;
    height: 36px;
    background: var(--border-color);
    border: 1px solid var(--border-hover);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-icon:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

.search-dropdown {
    padding: 6px;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 400px;
    max-height: 500px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.search-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    background: var(--bg-input);
    border-bottom-color: rgba(102, 126, 234, 0.5);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-results {
    flex: 1;
    overflow-y: auto;
    max-height: 450px;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: var(--bg-hover);
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.search-section {
    padding: 8px 0;
}

.search-section-title {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.search-result-item:hover,
.search-result-item.selected {
    background: rgba(102, 126, 234, 0.1);
    border-left-color: var(--gradient-start);
}

.search-result-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.search-result-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.search-result-bio {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.search-result-genres {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.search-genre {
    padding: 2px 8px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    font-size: 11px;
    color: #93c5fd;
}

.search-loading,
.search-empty,
.search-error {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.search-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--gradient-start);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.search-error {
    color: #fca5a5;
}

/* Notifications */
.notification-container {
    position: relative;
}

.notification-bell {
    position: relative;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-bell:hover {
    background: var(--border-color);
    border-color: var(--border-hover);
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    padding: 0 5px;
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 400px;
    max-height: 500px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.mark-all-read {
    background: transparent;
    border: none;
    color: #818cf8;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mark-all-read:hover {
    background: rgba(129, 140, 248, 0.1);
    color: #a5b4fc;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.notification-item {
    padding: 12px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.notification-item.unread {
    background: rgba(129, 140, 248, 0.05);
    border-left-color: #818cf8;
}

.notification-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-text {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.notification-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.notification-unread-dot {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #818cf8;
    border-radius: 50%;
}

.notification-loading,
.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.notification-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.notification-empty {
    font-size: 14px;
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero h2 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* Filters */
.filters {
    margin: 40px 0;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: var(--text-tertiary);
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    color: #fff;
}

.filter-btn.active {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    color: #fff;
}

.filter.nav-link.active {
    color: #fff;
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

/* Admin Link Special Styling */
.nav-link-admin {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.nav-link-admin:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: #fff;
}

.admin-icon {
    font-size: 16px;
    display: inline-flex;
    align-items: center;
}

/* Posts Section */
.posts-section {
    margin: 40px 0;
}

.posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.posts-header h3 {
    font-size: 24px;
    font-weight: 700;
}

.posts-count {
    color: var(--text-muted);
    font-size: 14px;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

/* Post Card */
.post-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card:hover {
    transform: translateY(-4px);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.post-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.genre-tag {
    padding: 4px 12px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    font-size: 12px;
    color: #93c5fd;
    font-weight: 500;
}

.post-card .post-content {
    color: var(--text-tertiary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.post-votes {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vote-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    color: #fff;
}

.vote-btn.upvote:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.vote-btn.downvote:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.vote-score {
    font-weight: 700;
    color: #fff;
}

.vote-score.positive {
    color: #86efac;
}

.vote-score.negative {
    color: #fca5a5;
}

/* Loading */
.loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--gradient-start);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-muted);
}

/* Footer */
.footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .nav-content {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 12px 0;
    }

    .logo h1 {
        font-size: 24px;
    }

    .logo-icon {
        font-size: 32px;
    }

    .nav-links {
        order: 2;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 13px;
    }

    .nav-right {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    /* FIX: Mobile Dropdowns centered */
    .search-dropdown,
    .notification-dropdown {
        position: fixed !important;
        top: 70px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        z-index: 9999 !important;
        background: var(--bg-card);
        /* Ensure background is opaque */
        border-radius: 12px !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    }

    .search-dropdown.active,
    .notification-dropdown.show {
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    /* Override existing search specific mobile styles */
    .search-input {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .nav-actions {
        justify-content: center;
    }

    .hero {
        padding: 32px 0 24px;
        text-align: center;
    }

    .hero h2 {
        font-size: 28px;
        margin-bottom: 12px;
        line-height: 1.2;
    }

    .hero p {
        font-size: 15px;
        margin-bottom: 24px;
        padding: 0 16px;
    }

    .filters {
        margin: 32px 0;
    }

    .filter-group {
        justify-content: center;
        gap: 8px;
    }

    .filter-label {
        width: 100%;
        text-align: center;
        font-size: 13px;
    }

    .filter-btn {
        padding: 6px 14px;
        font-size: 12px;
    }

    .posts-section {
        margin: 32px 0;
    }

    .posts-header {
        margin-bottom: 20px;
    }

    .posts-header h3 {
        font-size: 20px;
    }

    .posts-count {
        font-size: 13px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .post-card {
        padding: 20px;
    }

    .post-title {
        font-size: 18px;
    }

    .post-meta {
        font-size: 12px;
        gap: 10px;
    }

    .post-genres {
        gap: 6px;
        margin-bottom: 12px;
    }

    .genre-tag {
        padding: 3px 10px;
        font-size: 11px;
    }

    .post-card .post-content {
        font-size: 13px;
        margin-bottom: 12px;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .post-footer {
        padding-top: 12px;
    }

    .post-votes {
        gap: 10px;
    }

    .vote-btn {
        padding: 5px 10px;
        font-size: 13px;
    }

    .vote-score {
        font-size: 15px;
    }

    .footer {
        margin-top: 60px;
        padding: 32px 0;
        font-size: 13px;
    }



    .search-results {
        max-height: 350px;
    }

    .search-result-item {
        padding: 10px 12px;
    }

    .search-result-title {
        font-size: 13px;
    }

    .search-result-meta,
    .search-result-bio {
        font-size: 11px;
    }

    .search-genre {
        font-size: 10px;
        padding: 2px 6px;
    }
}


.notification-list {
    max-height: 320px;
}

.notification-item {
    padding: 10px 16px;
}

.notification-text {
    font-size: 13px;
}

.notification-time {
    font-size: 11px;
}

.mark-all-read {
    font-size: 12px;
}