/**
 * Media Viewer and Asset Library Styles
 */

/* === MEDIA VIEWER OVERLAY === */
.media-viewer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-viewer-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.media-viewer-container {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.media-viewer-container.fullscreen {
    width: 100%;
    height: 100%;
    max-width: 100%;
}

.media-viewer-container.fullscreen-stretched {
    width: 100%;
    height: 100%;
    max-width: 100%;
}

.media-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
}

.media-info {
    font-size: 1.1rem;
    font-weight: 500;
}

.viewer-controls {
    display: flex;
    gap: 0.5rem;
}

.viewer-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.viewer-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.media-viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.media-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 2rem;
}

.viewer-media {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.fullscreen .viewer-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fullscreen-stretched .viewer-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 1rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-prev {
    left: 1rem;
}

.nav-next {
    right: 1rem;
}

.media-viewer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
}

.media-counter {
    font-size: 0.9rem;
}

.media-controls {
    display: flex;
    gap: 1rem;
}

#viewer-mode-indicator {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.file-preview {
    text-align: center;
    color: white;
    padding: 2rem;
}

.file-preview i {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1rem;
}

.file-preview.error {
    color: #ff6b6b;
}

/* === SQUARE THUMBNAIL GRID === */
.asset-grid-container.square-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.asset-card.square-card {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--bg-light, #f8f9fa);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

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

.asset-card.square-card.focused {
    border: 2px solid var(--primary, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.thumbnail-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

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

.thumbnail-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-preview {
    position: relative;
}

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

.asset-card:hover .video-overlay {
    opacity: 0;
}

.video-overlay i {
    font-size: 2rem;
    color: white;
    opacity: 0.8;
}

.thumbnail-media.file-icon {
    background: var(--bg-lighter, #e9ecef);
}

.thumbnail-media.file-icon i {
    color: var(--text-muted, #6c757d);
}

.asset-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.asset-name {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.asset-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* === LIST VIEW STYLES === */
.asset-list-container {
    padding: 1rem;
}

.asset-list-container table {
    width: 100%;
}

.list-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.list-thumbnail-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light, #f8f9fa);
    border-radius: 4px;
}

.asset-list-row {
    cursor: pointer;
    transition: background 0.2s ease;
}

.asset-list-row:hover {
    background: var(--bg-light, #f8f9fa);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted, #6c757d);
}

.empty-state i {
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .asset-grid-container.square-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .nav-btn {
        font-size: 1rem;
        padding: 0.5rem;
    }
    
    .media-viewer-container {
        width: 100%;
        height: 100%;
    }
}