/**
 * Image Selector - CSS
 */

/* Container */
.zcusto-image-selector {
    margin: 20px 0;
}

/* Tabs */
.zcusto-image-selector .nav-tabs {
    border-bottom: 2px solid #e0e0e0;
}

.zcusto-image-selector .nav-link {
    color: #666;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 20px;
}

.zcusto-image-selector .nav-link:hover {
    border-bottom-color: #ccc;
}

.zcusto-image-selector .nav-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: none;
}

.zcusto-image-selector .nav-link .material-icons {
    font-size: 18px;
    vertical-align: middle;
    margin-right: 5px;
}

/* Category filter */
.category-filter .btn-group {
    gap: 5px;
}

.category-filter .btn {
    border-radius: 20px;
    font-size: 13px;
}

/* Images grid */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}

.image-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.image-item:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.2);
    transform: translateY(-2px);
}

.image-item.selected {
    border-color: #28a745;
    background-color: #f0fff4;
}

.image-wrapper {
    position: relative;
    padding-top: 100%; /* Ratio 1:1 */
    overflow: hidden;
    background-color: #f5f5f5;
}

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

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-item:hover .image-overlay {
    opacity: 1;
}

.image-overlay .btn {
    min-width: 100px;
}

.image-info {
    padding: 10px;
    background: white;
}

.image-name {
    font-size: 13px;
    margin: 0 0 5px 0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-price {
    font-size: 12px;
    color: #007bff;
    font-weight: 600;
    margin: 0;
}

/* Dropzone */
.upload-container {
    max-width: 600px;
    margin: 0 auto;
}

.dropzone {
    border: 3px dashed #ccc;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.dropzone .material-icons {
    font-size: 64px;
    color: #007bff;
    margin-bottom: 20px;
}

.dropzone-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
}

.file-input {
    display: none;
}

.upload-requirements {
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.upload-requirements .material-icons {
    font-size: 14px;
    vertical-align: middle;
}

/* Preview upload */
.upload-preview {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.preview-image {
    max-width: 300px;
    margin: 0 auto 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.preview-image img {
    width: 100%;
    height: auto;
    display: block;
}

.preview-info p {
    margin: 5px 0;
    font-size: 14px;
}

.preview-info .filename {
    font-weight: 600;
}

/* Selected image preview */
.selected-image-preview .selected-thumbnail {
    border-radius: 4px;
    border: 2px solid #28a745;
}

.selected-image-preview .selected-name {
    color: #28a745;
    font-weight: 600;
}

/* Progress bar */
.progress {
    height: 25px;
}

.progress-bar {
    transition: width 0.3s;
}

/* Responsive */
@media (max-width: 576px) {
    .zcusto-image-selector .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .dropzone {
        padding: 40px 15px;
    }
    
    .dropzone .material-icons {
        font-size: 48px;
    }
}
