:root {
    --sidebar-width: 280px;
    --header-height: 80px;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
}

body {
    background-color: var(--bg-light);
    overflow-x: hidden;
}

/* Auth Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-box {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    text-align: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.auth-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.auth-box h2 {
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.auth-box p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.auth-box input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.error-msg {
    color: #ef4444;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* App Container */
.app-container {
    display: flex;
    min-height: calc(100vh - 80px); /* Minus navbar */
    margin-top: 80px; /* Navbar height */
}

/* Sidebar - Removed for horizontal layout */
.sidebar {
    display: none;
}

/* Filters Bar - Horizontal */
.filters-bar {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.filters-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    flex: 1;
}

.filter-group {
    margin-bottom: 0;
    min-width: 140px;
}

.filter-group label {
    display: none; /* Hidden labels for cleaner horizontal bar */
}

.filter-group select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background-color: #f8fafc;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-group select:hover {
    border-color: var(--primary-color);
}

.filter-group.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid #e2e8f0;
    height: 40px;
    margin-bottom: 0;
}

.filter-group.checkbox label {
    display: block; /* Show label for checkbox */
    margin-bottom: 0;
    cursor: pointer;
}

.filter-group.checkbox input {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

/* Reset Button */
#reset-filters {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

#reset-filters:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

/* Main Content */
.main-content {
    margin-left: 0; /* Removed sidebar margin */
    flex: 1;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.search-bar {
    position: relative;
}

.search-bar input {
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    width: 300px;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

/* Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.resource-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
    border-color: var(--primary-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.card-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--primary-color);
    background: #eff6ff;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.card-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

.resource-card:hover .card-actions {
    opacity: 1;
}

.card-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 0.25rem;
}

.card-actions button:hover {
    color: #1e293b;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.card-desc {
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: #f1f5f9;
    color: #475569;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
    margin-top: auto;
}

.card-price {
    font-weight: 600;
    color: #1e293b;
}

.card-rating {
    color: #fbbf24;
}

.card-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group.full {
    grid-column: span 2;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .search-bar input {
        width: 100%;
    }
}
