/**
 * File Explorer Frontend Styles — crafted by Shafat Mahmud Khan (WordPress Developer, https://itsmeshafat.com)
 */

/* Container */
.frontend-file-explorer-frontend-container {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    max-width: 100%;
}

/* Toolbar */
.frontend-file-explorer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f7f7f7;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 4px 4px 0 0;
    padding: 15px;
}

.frontend-file-explorer-actions {
    display: flex;
    align-items: center;
}

.frontend-file-explorer-breadcrumb {
    display: flex;
    align-items: center;
}

.frontend-file-explorer-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 5px;
    padding: 6px 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

#frontend-file-explorer-frontend-download-zip {
    background-color: #4CAF50;
    color: white;
    border-color: #43A047;
}

#frontend-file-explorer-frontend-download-zip:hover {
    background-color: #43A047;
}

#frontend-file-explorer-frontend-download-zip .button-text {
    margin-left: 5px;
}

.frontend-file-explorer-btn:hover {
    background-color: #e0e0e0;
}

.frontend-file-explorer-btn .material-icons {
    font-size: 18px;
}

#frontend-file-explorer-frontend-current-path {
    font-size: 14px;
    color: #555;
    margin-left: 10px;
}

/* Content */
.frontend-file-explorer-content {
    min-height: 400px;
    padding: 20px;
    position: relative;
}

.frontend-file-explorer-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    clear: both;
}

.frontend-file-explorer-item {
    background-color: #f9f9f9;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    padding: 15px;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 220px;
}

.frontend-file-explorer-item:hover {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.frontend-file-explorer-item-icon {
    color: #0073aa;
    font-size: 48px;
    margin-bottom: 10px;
    text-align: center;
}

.frontend-file-explorer-item-icon .folder-icon {
    font-size: 72px;
    color: #0073aa;
}

.frontend-file-explorer-item-preview {
    height: 120px;
    margin-bottom: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Only hide file type icons when there's a preview image, keep action buttons */
.frontend-file-explorer-item:has(.frontend-file-explorer-item-preview) .frontend-file-explorer-item-icon .material-icons {
    display: none;
}

.frontend-file-explorer-item-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.frontend-file-explorer-item-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    word-break: break-word;
}

.frontend-file-explorer-item-actions {
    display: flex;
    justify-content: center;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.frontend-file-explorer-item:hover .frontend-file-explorer-item-actions {
    opacity: 1;
}

.frontend-file-explorer-item-actions button {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    padding: 5px;
}

.frontend-file-explorer-item-actions button:hover {
    color: #00a0d2;
}

.frontend-file-explorer-item-actions .material-icons {
    font-size: 20px;
}

/* Empty state */
.frontend-file-explorer-empty {
    align-items: center;
    color: #888;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 300px;
}

.frontend-file-explorer-empty .material-icons {
    font-size: 64px;
    margin-bottom: 20px;
}

/* Loading state */
.frontend-file-explorer-loading {
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 10;
}

.frontend-file-explorer-loading .material-icons {
    font-size: 48px;
    margin-bottom: 10px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Pagination */
.frontend-file-explorer-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    padding-bottom: 20px;
}

.frontend-file-explorer-credit {
    margin: 0;
    padding: 0 20px 20px;
    text-align: center;
    font-size: 12px;
    color: #6b6b6b;
}

/* Notification */
.frontend-file-explorer-notification {
    background-color: #fff;
    border-left: 4px solid #00a0d2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 10px 0;
    padding: 12px;
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

.frontend-file-explorer-notification.success {
    border-left-color: #46b450;
}

.frontend-file-explorer-notification.error {
    border-left-color: #dc3232;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 782px) {
    .frontend-file-explorer-items {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .frontend-file-explorer-items {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .frontend-file-explorer-item {
        padding: 10px;
    }

    .frontend-file-explorer-item-icon {
        font-size: 36px;
    }

    .frontend-file-explorer-item-preview {
        height: 80px;
    }

    .frontend-file-explorer-item-name {
        font-size: 12px;
    }
}