/* Resource Library Component Styles */

.resource-library {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    min-height: auto;
    padding: 0;
}

/* Additional Filters Styles */
.additional-filters {
    margin-top: 24px;
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
}

.additional-filters .collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.additional-filters .collapse-icon {
    transition: transform 0.3s ease;
}

.additional-filters.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.additional-filters .collapsible-content {
    margin-top: 16px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    max-height: 1000px;
}

.additional-filters.collapsed .collapsible-content {
    max-height: 0;
    margin-top: 0;
}

.filter-subsection {
    margin-bottom: 20px;
}

.filter-subsection:last-child {
    margin-bottom: 0;
}

.filter-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin: 0 0 8px 0;
}

.resource-sidebar .filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.resource-sidebar .filter-select:focus {
    outline: none;
    border-color: #7952b3;
    box-shadow: 0 0 0 2px rgba(121, 82, 179, 0.1);
}

.resource-library-container {
    display: flex;
    margin: 0 auto;
    gap: 30px;
}

/* Sidebar Styles */
.resource-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: white;
    border-radius: 8px;
    padding: 24px;
    height: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 20px;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 24px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid #7952b3;
}

/* Search Styles - Scoped to Resource Library */
.resource-sidebar .search-container {
    position: relative;
    margin-bottom: 24px;
}

.resource-sidebar .search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.resource-sidebar .search-input:focus {
    outline: none;
    border-color: #7952b3;
    background: white;
    box-shadow: 0 0 0 3px rgba(121, 82, 179, 0.1);
}

.resource-sidebar .search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
}

.resource-sidebar .search-btn:hover {
    color: #7952b3;
}

/* Filter Section Styles */
.filter-section {
    margin-bottom: 24px;
}

.filter-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

/* Audience Filter - Primary Visual Hierarchy */
.filter-section:has(input[name="filters[audience]"]) {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 28px;
    border: 1px solid #e9ecef;
}

.filter-section:has(input[name="filters[audience]"]) .filter-title {
    font-size: 16px;
    color: #7952b3;
    margin-bottom: 14px;
}

/* Radio Button Styling */
input[type="radio"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    accent-color: #7952b3;
}

/* Filter Visual Icons */
.filter-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: #7952b3;
    margin-right: 8px;
    vertical-align: middle;
    border-radius: 2px;
}

.filter-options {
    display: flex;
    flex-direction: column;
}

.topic-options {
    max-height: 200px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.filter-option:hover {
    background-color: #f8f9fa;
}

.filter-option input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #7952b3;
}

.filter-label {
    font-size: 13px;
    color: #555;
    flex: 1;
}

/* Button Styles - Scoped to Resource Library Sidebar */
.resource-sidebar .clear-filters-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
    margin-top: 16px;
}

.resource-sidebar .clear-filters-btn:hover {
    background: #e9ecef;
    color: #333;
}

/* Main Content Styles */
.resource-content {
    flex: 1;
    min-width: 0;
}

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Active Filters Pills */
.active-filters {
    margin-bottom: 20px;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    color: #333;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.remove-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.remove-filter:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.remove-filter i {
    font-size: 10px;
}

.clear-all-pills {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: #7952b3;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.clear-all-pills:hover {
    background: rgba(121, 82, 179, 0.1);
}

.view-controls {
    display: flex;
    gap: 4px;
}

.view-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.view-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.resource-content .view-btn {
    padding: 8px 12px;
    background: white;
    border: none;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid #ddd;
}

.resource-content .view-btn:last-child {
    border-right: none;
}

.resource-content .view-btn.active {
    background: #7952b3;
    color: white;
}

.resource-content .view-btn:hover:not(.active) {
    background: #f8f9fa;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.resource-content .sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.resource-content .sort-select:focus {
    outline: none;
    border-color: #7952b3;
    box-shadow: 0 0 0 3px rgba(121, 82, 179, 0.1);
}

/* Results Count */
.results-count {
    margin-bottom: 20px;
}

.results-count-text {
    font-size: 14px;
    color: #666;
}

.count-range, .count-total {
    font-weight: 600;
    color: #333;
}

/* Resource Grid */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.resource-grid.list-view {
    grid-template-columns: 1fr;
}

/* Resource Card */
.resource-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.resource-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Thumbnail Image */
.resource-thumbnail {
    width: calc(100% + 40px);
    height: 200px;
    margin: -20px -20px 20px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    position: relative;
    background: #f8f9fa;
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.resource-card:hover .thumbnail-image {
    transform: scale(1.05);
}

/* Thumbnail Fallback */
.thumbnail-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

.thumbnail-icon {
    width: 80px;
    height: 80px;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.resource-card:hover .thumbnail-icon {
    transform: scale(1.1);
    color: #6b7280;
}

/* Adjust type badge position when thumbnail is present */
.resource-thumbnail ~ .resource-type-badge {
    z-index: 1;
}

/* Resource Badges Section */
.resource-badges {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    z-index: 1;
}

/* Audience Badge */
.audience-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 16px;
    text-transform: none;
}

.audience-cx_professional {
    background: #2c5aa0;
    color: white;
}

.audience-ccxp_candidate {
    background: #00a86b;
    color: white;
}

.audience-ceo_others {
    background: #ff6b6b;
    color: white;
}

.audience-badge i {
    font-size: 11px;
}

/* Sponsored Badge */
.sponsored-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 16px;
    background: #ffd700;
    color: #333;
}

/* Gated Content Badge */
.gated-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 16px;
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.gated-badge i {
    font-size: 11px;
}

/* Sponsored Card */
.resource-card.sponsored-card {
    border: 2px solid #ffd700;
    background: linear-gradient(135deg, #fffef9 0%, #ffffff 100%);
}

/* Taxonomy Info Section */
.taxonomy-info {
    margin: 20px 0 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Content Meta */
.content-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Format Icons */
.format-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
}

.format-icon.format-read {
    background: #e3f2fd;
    color: #1976d2;
}

.format-icon.format-watch {
    background: #fce4ec;
    color: #c2185b;
}

.format-icon.format-listen {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Content Focus */
.content-focus {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    text-transform: capitalize;
}

/* Depth Indicator */
.depth-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.depth-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
}

.depth-foundational .depth-dot:first-child {
    background: #4caf50;
}

.depth-intermediate .depth-dot:nth-child(1),
.depth-intermediate .depth-dot:nth-child(2) {
    background: #ff9800;
}

.depth-advanced .depth-dot {
    background: #f44336;
}

.depth-label {
    font-size: 12px;
    color: #666;
    margin-left: 4px;
    text-transform: capitalize;
}

/* Competency Tags */
.competency-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.competency-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.competency-tag i {
    font-size: 10px;
}

.competency-more {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #f5f5f5;
    color: #666;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* Old Resource Type Badge - Hidden but preserved for backward compatibility */
.resource-type-badge {
    display: none;
}

/* Resource Date */
.resource-date {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 12px;
    color: #888;
}

/* Card Content */
.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Card Bottom Section */
.card-bottom {
    margin-top: auto;
}

.resource-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.title-link {
    color: #7952b3;
    text-decoration: none;
    transition: color 0.2s ease;
}

.title-link:hover {
    color: #5a3d91;
    text-decoration: underline;
}

.resource-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.access-level {
    font-size: 12px;
    font-weight: 500;
}

.access-free {
    color: #28a745;
}

.access-premium {
    color: #dc3545;
}

.action-link .action-btn {
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: #7952b3;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    color: #5a3d91;
}

.action-btn i {
    font-size: 11px;
}

/* Resource Topics */
.resource-topics {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.topic-tag {
    background: #f8f9fa;
    color: #666;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    border: 1px solid #e9ecef;
}

/* Pagination */
.pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination-link {
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.pagination-link:hover {
    background: #f8f9fa;
    color: #333;
}

.pagination-current {
    background: #7952b3;
    color: white;
    border-color: #7952b3;
}

.pagination-ellipsis {
    padding: 8px 4px;
    color: #999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.empty-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.empty-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .resource-library-container {
        flex-direction: column;
    }

    .resource-sidebar {
        width: 100%;
        position: static;
    }

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

@media (max-width: 768px) {
    .results-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .view-controls, .sort-controls {
        justify-content: center;
    }

    .resource-card {
        padding: 16px;
    }
    
    .resource-thumbnail {
        width: calc(100% + 32px);
        margin: -16px -16px 16px;
    }
    
    .thumbnail-icon {
        width: 60px;
        height: 60px;
    }
}

/* Scrollbar Styling */
.topic-options::-webkit-scrollbar {
    width: 6px;
}

.topic-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.topic-options::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.topic-options::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.directory-title,
.results-header h1.directory-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}
