/**
 * SmartUploader Component Styles
 * Companion to smart-uploader.js — unified file upload UI
 */

/* ── Root container ────────────────────────────────────────────────── */
.su-root {
    font-family: inherit;
    font-size: 14px;
    color: #333;
}

/* ── Drop zone ─────────────────────────────────────────────────────── */
.su-dropzone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.su-dropzone:hover {
    border-color: #70C059;
    background: rgba(112, 192, 89, 0.05);
}

.su-dropzone.su-drag-over {
    border-color: #70C059;
    border-style: solid;
    background: rgba(112, 192, 89, 0.1);
    transform: scale(1.01);
}

.su-dropzone.su-drag-over .su-dropzone-content {
    pointer-events: none;
}

/* ── Drop zone content ─────────────────────────────────────────────── */
.su-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.su-dropzone-icon {
    color: #999;
    transition: color 0.3s ease;
}

.su-dropzone:hover .su-dropzone-icon,
.su-dropzone.su-drag-over .su-dropzone-icon {
    color: #70C059;
}

.su-dropzone-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #555;
}

.su-dropzone-hint {
    margin: 0;
    font-size: 13px;
    color: #999;
}

.su-dropzone-limits {
    margin: 6px 0 0;
    font-size: 12px;
    color: #aaa;
}

/* ── Action buttons ────────────────────────────────────────────────── */
.su-dropzone-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.su-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
    text-decoration: none;
}

.su-btn-primary {
    background: linear-gradient(105.23deg, #70C059 0%, #72CAC8 100%);
    color: #fff;
}

.su-btn-primary:hover {
    background: linear-gradient(105.23deg, #72CAC8 0%, #70C059 100%);
    transform: translateY(-1px);
}

.su-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.su-btn-secondary {
    background: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
}

.su-btn-secondary:hover {
    background: #e4e4e4;
    border-color: #ccc;
    transform: translateY(-1px);
}

.su-btn-outline {
    background: transparent;
    color: #888;
    border: 1px solid #ddd;
}

.su-btn-outline:hover {
    background: #f8f8f8;
    color: #555;
    border-color: #bbb;
}

/* ── File list ─────────────────────────────────────────────────────── */
.su-file-list {
    margin-top: 12px;
}

/* ── File item ─────────────────────────────────────────────────────── */
.su-file-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    gap: 12px;
    transition: all 0.25s ease;
}

.su-file-item:hover {
    border-color: #70C059;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Status variants */
.su-file-item.su-status-compressing {
    background: #fffde7;
    border-color: #fff176;
}

.su-file-item.su-status-uploading {
    background: #f8f9fa;
}

.su-file-item.su-status-success {
    border-color: #70C059;
    background: rgba(112, 192, 89, 0.05);
}

.su-file-item.su-status-error {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

/* Icon */
.su-file-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
}

.su-file-icon img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* Info block */
.su-file-info {
    flex: 1;
    min-width: 0;
}

.su-file-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.su-file-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.su-file-size {
    font-size: 12px;
    color: #888;
}

.su-file-status-text {
    font-size: 12px;
    color: #888;
}

/* Progress bar */
.su-progress {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.su-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(105.23deg, #70C059 0%, #72CAC8 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.su-status-error .su-progress-bar {
    background: #dc3545;
}

/* Remove button */
.su-file-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s ease;
}

.su-file-remove:hover {
    color: #dc3545;
}

/* ── Status text colours ───────────────────────────────────────────── */
.su-text-success {
    color: #70C059;
    font-weight: 500;
}

.su-text-error {
    color: #dc3545;
    font-weight: 500;
}

/* ── Validation error ──────────────────────────────────────────────── */
.su-validation-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #fff3f3;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    margin-bottom: 8px;
    animation: suFadeIn 0.3s ease;
}

.su-validation-error-name {
    font-weight: 500;
    color: #c62828;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.su-validation-error-msg {
    font-size: 13px;
    color: #c62828;
}

/* ── Action bar ────────────────────────────────────────────────────── */
.su-action-bar {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 12px;
}

/* ── Utilities ─────────────────────────────────────────────────────── */
.su-hidden {
    display: none !important;
}

.su-fade-out {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ── Animations ────────────────────────────────────────────────────── */
@keyframes suFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .su-dropzone {
        padding: 20px 15px;
    }

    .su-dropzone-title {
        font-size: 14px;
    }

    .su-dropzone-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .su-btn {
        justify-content: center;
    }

    .su-file-item {
        flex-wrap: wrap;
        position: relative;
        padding-right: 32px;
    }

    .su-file-info {
        width: calc(100% - 60px);
    }

    .su-file-remove {
        position: absolute;
        right: 12px;
        top: 10px;
    }
}
