/* HXT File Browser Styles */
.hxt-file-browser {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.hxt-toolbar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.hxt-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.hxt-filter {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.hxt-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.hxt-grid[data-columns="2"] {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.hxt-grid[data-columns="3"] {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.hxt-grid[data-columns="4"] {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.hxt-grid[data-columns="5"] {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.hxt-file-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.hxt-file-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.hxt-file-item:hover .hxt-file-actions {
    opacity: 1;
}

.hxt-file-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f5f5f5;
    display: block;
}

.hxt-file-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.hxt-rename-btn,
.hxt-delete-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.hxt-rename-btn:hover {
    background: #0073aa;
    border-color: #0073aa;
    transform: scale(1.1);
}

.hxt-delete-btn:hover {
    background: #dc3232;
    border-color: #dc3232;
    transform: scale(1.1);
}

.hxt-file-info {
    padding: 12px;
}

.hxt-file-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hxt-file-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.hxt-loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

.hxt-loading.hidden {
    display: none;
}

/* Modal Styles */
.hxt-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.hxt-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
}

.hxt-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: 2% auto;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hxt-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.hxt-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.hxt-modal-body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 400px;
}

.hxt-modal-body img,
.hxt-modal-body video {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.hxt-modal-body iframe {
    width: 100%;
    height: 70vh;
    border: none;
}

.hxt-modal-footer {
    padding: 15px 20px;
    background: #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #ddd;
}

.hxt-download-btn {
    background: #0073aa;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.hxt-download-btn:hover {
    background: #005a87;
}

.hxt-modal-footer .hxt-file-info {
    font-size: 13px;
    color: #666;
    padding: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hxt-grid[data-columns="4"],
    .hxt-grid[data-columns="5"] {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .hxt-modal-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .hxt-toolbar {
        flex-direction: column;
    }
    
    .hxt-search {
        width: 100%;
    }
    
    .hxt-file-actions {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .hxt-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .hxt-file-thumbnail {
        height: 150px;
    }
}
