.page-nurturing {
    min-height: 100vh;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
}

.lightbox-image-wrapper img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
    width: 55px;
    height: 55px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
}

@media (max-width: 768px) {
    .lightbox-prev, .lightbox-next {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
}

.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.filter-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 4px;
}

.filter-chip {
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 12px;
    background: var(--bg-page);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.filter-chip:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.filter-chip.active {
    background: var(--primary-color);
    color: white;
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

@media (max-width: 768px) {
    .materials-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.material-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.material-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(59, 130, 246, 0.15);
}

.material-thumb {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    overflow: hidden;
}

.material-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.material-thumb-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.material-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.material-badge.image { background: rgba(59, 130, 246, 0.85); }
.material-badge.video { background: rgba(239, 68, 68, 0.85); }
.material-badge.pdf { background: rgba(245, 158, 11, 0.85); }
.material-badge.text { background: rgba(16, 185, 129, 0.85); }
.material-badge.combo { background: rgba(139, 92, 246, 0.85); }

.material-info {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.material-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.material-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
    flex: 1;
}

.material-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.material-stats {
    display: flex;
    gap: 10px;
}

.material-stat {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.material-size {
    font-size: 11px;
    color: var(--text-tertiary);
}

.preview-modal .modal-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #000;
}

.preview-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    min-height: 300px;
    max-height: 60vh;
    overflow: auto;
}

.preview-image-container img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.preview-video-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 300px;
}

.preview-video-container video {
    max-width: 100%;
    max-height: 60vh;
}

.preview-pdf-container {
    flex: 1;
    background: white;
    min-height: 500px;
}

.preview-pdf-container iframe {
    width: 100%;
    height: 60vh;
    border: none;
}

.preview-text-container {
    padding: 24px;
    background: white;
    max-height: 60vh;
    overflow-y: auto;
}

.preview-detail-info {
    padding: 16px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
}

.preview-detail-info h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.preview-detail-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.preview-footer {
    padding: 14px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 10px;
}

.preview-footer .btn {
    flex: 1;
    height: 42px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.combo-files {
    padding: 16px;
    background: var(--bg-page);
    max-height: 300px;
    overflow-y: auto;
}

.combo-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border-light);
}

.combo-file-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.combo-file-info {
    flex: 1;
    min-width: 0;
}

.combo-file-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.combo-file-size {
    font-size: 11px;
    color: var(--text-tertiary);
}

.modal-header.dark {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header.dark .modal-title { color: white; }
.modal-header.dark .modal-close { color: rgba(255, 255, 255, 0.7); }
.modal-header.dark .modal-close:hover { color: white; background: rgba(255, 255, 255, 0.1); }
