/* ===== VISUAL RESOURCE LIBRARY STYLES ===== */

:root {
    --color-teal: #00A8A8;
    --color-gold: #F6CC00;
    --color-magenta: #FF007F;
    --color-text: #333;
    --color-bg: #f5f9fc;
}

/* Container */
.visual-library-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: var(--color-bg);
    min-height: 100vh;
}

/* Header */
.visual-library-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px;
    background: linear-gradient(135deg, var(--color-teal), var(--color-gold));
    border-radius: 16px;
    color: white;
}

.visual-library-header h1 {
    margin: 0 0 12px 0;
    font-size: 32px;
    font-family: 'Bree Serif', serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.library-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.95;
}

/* Controls Section */
.library-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-bar {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid #ddd;
    border-radius: 24px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px rgba(0, 168, 168, 0.1);
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 16px;
    border-radius: 24px;
    border: 2px solid #ddd;
}

.sort-controls label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.sort-controls select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-controls select:hover {
    border-color: var(--color-teal);
}

.sort-controls select:focus {
    outline: none;
    border-color: var(--color-teal);
    box-shadow: 0 0 0 2px rgba(0, 168, 168, 0.1);
}

.view-toggle {
    display: flex;
    gap: 8px;
    background: white;
    padding: 4px;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.view-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.view-btn.active {
    background: var(--color-teal);
    color: white;
}

/* Category Filters */
.category-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-filter-btn.active {
    color: white;
}

.cat-icon {
    font-size: 18px;
}

.cat-name {
    white-space: nowrap;
}

/* Results Info */
.results-info {
    text-align: center;
    margin-bottom: 24px;
    color: #666;
    font-size: 14px;
}

/* Grid View */
.visual-resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.visual-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.visual-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.visual-card-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
    background: #f0f0f0;
}

.visual-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.visual-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.visual-card:hover .visual-card-overlay {
    opacity: 1;
}

.view-btn-overlay {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.visual-card-content {
    padding: 20px;
}

.visual-category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--color-teal);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    margin-bottom: 12px;
}

.visual-card-title {
    font-family: 'Bree Serif', serif;
    font-size: 18px;
    color: var(--color-text);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.visual-card-description {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin: 0 0 16px 0;
}

.visual-card-actions {
    display: flex;
    gap: 8px;
}

.action-btn-small {
    flex: 1;
    padding: 8px 12px;
    background: var(--color-bg);
    border: 2px solid var(--color-teal);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn-small:hover {
    background: var(--color-teal);
    color: white;
    transform: translateY(-2px);
}

/* List View */
.visual-resources-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

.visual-list-item {
    display: flex;
    gap: 20px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.visual-list-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateX(8px);
}

.visual-list-thumbnail {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.visual-list-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.visual-list-content {
    flex: 1;
}

.visual-list-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.visual-list-header h3 {
    font-family: 'Bree Serif', serif;
    font-size: 20px;
    color: var(--color-text);
    margin: 0;
}

.visual-list-description {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
    margin: 0 0 12px 0;
}

.visual-list-topics {
    font-size: 13px;
    color: #888;
}

.visual-list-topics strong {
    color: var(--color-teal);
}

.visual-list-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.action-btn-icon {
    padding: 10px 14px;
    background: var(--color-bg);
    border: 2px solid var(--color-teal);
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn-icon:hover {
    background: var(--color-teal);
    transform: scale(1.1);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.no-results h3 {
    font-family: 'Bree Serif', serif;
    font-size: 24px;
    color: var(--color-text);
    margin: 0 0 12px 0;
}

.no-results p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Resource Modal */
.resource-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
}

.resource-modal {
    background: white;
    border-radius: 16px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.resource-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
    border-bottom: 2px solid var(--color-bg);
    background: linear-gradient(135deg, rgba(0, 168, 168, 0.1), rgba(246, 204, 0, 0.1));
}

.resource-modal-title-section {
    flex: 1;
}

.resource-modal-title-section h2 {
    font-family: 'Bree Serif', serif;
    font-size: 28px;
    color: var(--color-text);
    margin: 0 0 12px 0;
}

.modal-category-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--color-teal);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
}

.modal-close-btn {
    padding: 10px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close-btn:hover {
    background: var(--color-magenta);
    color: white;
    transform: rotate(90deg);
}

.resource-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 32px;
}

.resource-image-container {
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.resource-full-image {
    width: 100%;
    height: auto;
    display: block;
}

.resource-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.resource-description-section h3,
.resource-topics-section h3,
.resource-tags-section h3 {
    font-family: 'Bree Serif', serif;
    font-size: 20px;
    color: var(--color-teal);
    margin: 0 0 12px 0;
}

.resource-description-section p {
    font-size: 16px;
    line-height: 1.7;
    color: #666;
    margin: 0;
}

.resource-topics-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-topics-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-bg);
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text);
}

.resource-topics-list li:last-child {
    border-bottom: none;
}

.resource-topics-list li::before {
    content: '✓';
    color: var(--color-teal);
    font-weight: bold;
    margin-right: 12px;
}

.resource-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.resource-tag {
    padding: 6px 12px;
    background: var(--color-bg);
    border: 2px solid var(--color-gold);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
}

.resource-actions-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--color-bg);
}

.resource-actions-section .btn-primary,
.resource-actions-section .btn-secondary {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.resource-actions-section .btn-primary {
    background: linear-gradient(135deg, var(--color-teal), var(--color-gold));
    color: white;
}

.resource-actions-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 168, 168, 0.3);
}

.resource-actions-section .btn-secondary {
    background: white;
    border: 2px solid var(--color-teal);
    color: var(--color-teal);
}

.resource-actions-section .btn-secondary:hover {
    background: var(--color-teal);
    color: white;
    transform: translateY(-2px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .visual-library-container {
        padding: 16px;
    }
    
    .visual-library-header h1 {
        font-size: 24px;
    }
    
    .library-subtitle {
        font-size: 14px;
    }
    
    .library-controls {
        flex-direction: column;
    }
    
    .view-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .category-filters {
        gap: 8px;
        padding: 12px;
    }
    
    .category-filter-btn {
        font-size: 13px;
        padding: 8px 14px;
    }
    
    .cat-name {
        display: none;
    }
    
    .visual-resources-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .visual-list-item {
        flex-direction: column;
    }
    
    .visual-list-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .visual-list-actions {
        flex-direction: row;
    }
    
    .resource-modal-body {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .resource-modal-title-section h2 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .visual-library-header {
        padding: 16px;
    }
    
    .visual-library-header h1 {
        font-size: 20px;
    }
    
    .search-bar input {
        font-size: 14px;
    }
    
    .visual-card-title {
        font-size: 16px;
    }
    
    .visual-card-description {
        font-size: 13px;
    }
    
    .resource-modal-wrapper {
        padding: 10px;
    }
    
    .resource-modal-header {
        padding: 16px;
    }
    
    .resource-modal-body {
        padding: 16px;
        gap: 20px;
    }
}

/* ===== CSS ROTATION FOR LANDSCAPE IMAGES ===== */
/* Apply rotation to specific infographics that need it */
.visual-card[data-rotate="true"] img,
.visual-list-item[data-rotate="true"] img {
    transform: rotate(90deg);
    width: auto;
    height: 100%;
    max-width: none;
}

.resource-full-image.rotated {
    transform: rotate(90deg);
    max-width: 70vh;
    margin: 0 auto;
}

.resource-image-container.rotated {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

@media (max-width: 768px) {
    .resource-full-image.rotated {
        transform: rotate(0deg);
        max-width: 100%;
    }
    
    .resource-image-container.rotated {
        min-height: auto;
    }
}
