/* ============================================
   RESOURCES PAGE STYLES - GLASSMORPHISM FIX
   ============================================ */

/* 1. Clean, Minimal Header */
.resources-header {
    /* Add margin-top to clear the fixed nav height (70px) */
    margin-top: 70px; 
    
    /* Increased padding for better breathing room */
    padding: 40px 0 30px 0; 
    
    background: white;
    color: var(--gray-900);
    text-align: center;
    border-bottom: 1px solid var(--gray-100);
}

.resources-title {
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.resources-subtitle {
    font-size: 1rem;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
}

/* 2. TRANSPARENT GLASSMORPHISM STICKY BAR - The Fix! */
.resources-controls {
    padding: 16px 0; /* Increased padding slightly */
    
    /* ... existing background/blur styles ... */
    background: rgba(255, 255, 255, 0.8); /* Slightly more opaque for readability */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    
    position: sticky;
    
    /* MATCH THIS TO NAV HEIGHT (70px) + a tiny gap (optional) */
    top: 70px; 
    
    z-index: 900;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-bar {
    position: relative;
    max-width: 500px;
    margin: 0 auto 12px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: var(--font-body);
    background: white;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: white;
}

/* 3. Filters - Compact & Clean */
.filters {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.filter-btn {
    padding: 0.45rem 1rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 0.5rem;
    background: white;
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--primary-500);
    color: var(--primary-500);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* 4. Sort Controls */
.sort-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: 4px;
}

.sort-select {
    padding: 0.35rem 0.9rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 0.4rem;
    font-size: 0.85rem;
    color: var(--gray-700);
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-500);
}

/* 5. Resources Section - More breathing room */
.resources-section {
    padding: 30px 0 40px 0;
    min-height: 60vh;
}

.resources-count {
    color: var(--gray-500);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

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

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 0;
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.no-results p {
    color: var(--gray-500);
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active { display: flex; }

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 1rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    padding: 1.5rem;
    color: white;
}

.modal-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.modal-title {
    font-size: 1.5rem;
    color: white;
    margin-top: 0.25rem;
}

.modal-body { padding: 1.5rem; }

.modal-description {
    font-size: 1.05rem;
    color: var(--gray-700);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.modal-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.75rem;
}

.modal-meta-item { text-align: center; }

.meta-label {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.meta-value {
    display: block;
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1rem;
}

.modal-details {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.75rem;
    border-left: 4px solid var(--primary-500);
}

.modal-details h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.modal-details ul {
    list-style: none;
    padding: 0;
}

.modal-details li {
    padding: 0.4rem 0;
    color: var(--gray-700);
}

.modal-details li::before {
    content: "✓ ";
    color: var(--primary-500);
    font-weight: 700;
    margin-right: 0.5rem;
}

.download-btn {
    width: 100%;
    background: var(--primary-500);
    color: white;
    padding: 0.875rem;
    border-radius: 0.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.download-btn:hover {
    background: var(--primary-600);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.download-success {
    margin-top: 1rem;
    padding: 1rem;
    background: #10b981;
    color: white;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.3s ease;
}

.download-success svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .resources-controls {
        background: rgba(255, 255, 255, 0.85);
        padding: 10px 0;
    }
    
    .search-bar {
        max-width: 100%;
        margin-bottom: 10px;
    }
    
    .filters {
        gap: 6px;
        margin-bottom: 6px;
    }
    
    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        flex: 1;
        min-width: calc(33.333% - 4px);
    }
    
    .modal-meta {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
    }
}
