:root {
    /* Rich Modern Dark Theme Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #161622;
    --text-primary: #f8f8f8;
    --text-secondary: #a0a0b0;
    --accent-color: #6366f1; /* Indigo */
    --accent-glow: rgba(99, 102, 241, 0.4);
    --accent-hover: #4f46e5;
    
    --glass-bg: rgba(22, 22, 34, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-subtle: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 20px var(--accent-glow);
    
    --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --surface-color: var(--bg-secondary);
}

:root.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --accent-color: #4f46e5;
    --accent-glow: rgba(79, 70, 229, 0.2);
    --surface-color: var(--bg-secondary);
    
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow-subtle: 0 4px 20px rgba(0,0,0,0.05);
    --shadow-glow: 0 0 20px var(--accent-glow);
}

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

textarea {
    resize: vertical;
    max-width: 100%;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles have been moved to header.css */

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

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

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

/* Main Container */
main {
    flex: 1;
    padding: 2rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Cards (Glassmorphism) */
.list-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-glow);
}

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

.category-pill {
    background: rgba(255,255,255,0.05);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent-color);
    border: 1px solid var(--glass-border);
    display: inline-block;
}

/* Responsiveness */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        text-align: center;
    }
    main {
        padding: 1rem 0.5rem;
    }
    .grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .list-header {
        margin-bottom: 1.5rem;
    }

    /* Filters responsive layout: scroll categories horizontally instead of wrapping */
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem !important;
        margin-bottom: 1.5rem !important;
    }
    .sort-tabs {
        justify-content: center;
        width: 100%;
        border-bottom: 1px solid var(--glass-border);
        padding-bottom: 0.5rem;
    }
    .category-filters {
        justify-content: center;
        flex-wrap: wrap !important;
        padding-bottom: 0.5rem;
        margin: 0 !important;
    }
    .category-filters .filter-pill {
        flex: 0 0 auto;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Header styles have been moved to header.css */

/* Admin button variant */
.btn-admin {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
}

/* Footer styles have been moved to footer.css */

/* Category Filters */
.category-filters {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.filter-pill {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.filter-pill:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.filter-pill.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
    font-weight: 600;
}

/* List card link inside refactored card */
.list-card-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.list-card:hover .list-card-link {
    color: var(--accent-color);
}

/* User dropdown styles have been moved to header.css */

/* Form Select Elements */
select {
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 0.4rem 0.6rem;
    font-family: var(--font-family);
}

select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* ---------- Shared: Filters & Sort Tabs ---------- */
.filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.sort-tabs {
    display: flex;
    gap: 1rem;
}
.sort-tab-link {
    text-decoration: none;
    font-weight: bold;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    transition: color 0.2s ease, border-color 0.2s ease;
}
.sort-tab-link.active-tab {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

/* ---------- Shared: Card Cover Photo ---------- */
.card-cover-photo {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ---------- Shared: Card Footer Actions ---------- */
.card-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-like-feed {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
}

/* ---------- Shared: Pagination ---------- */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}
.pagination-btn {
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}
.pagination-label {
    align-self: center;
}

/* ---------- Shared: User Not Found Alert ---------- */
.user-not-found-alert {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ---------- Global Modal Styles ---------- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--surface-color, var(--bg-secondary));
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--text-primary);
}

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

/* ── Light Mode Global Overrides ── */
:root.theme-light .btn-secondary {
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.15);
}

:root.theme-light .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--text-secondary);
}

:root.theme-light .filter-pill {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
}

:root.theme-light .filter-pill:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.08);
}

:root.theme-light .filter-pill.active {
    background: var(--text-primary);
    color: #ffffff;
    border-color: var(--text-primary);
}

:root.theme-light .sort-tab-link {
    color: var(--text-secondary);
}

:root.theme-light .sort-tab-link.active-tab {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

:root.theme-light select {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.15);
}

:root.theme-light .pagination-btn {
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.15);
    background: var(--surface-color);
}
