/* =========================================================
   ImageUploader.css
   İlan fotoğraf yükleme bileşeni stilleri
   ========================================================= */

.image-upload-section {
    margin-top: 16px;
}

.image-upload-section .section-label {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.image-upload-section .section-desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ── Drag-drop zone ─────────────────── */
.image-dropzone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.25s ease;
    cursor: pointer;
}

.image-dropzone:hover {
    border-color: #EE8502;
    background: #fffbf5;
}

.image-dropzone.drag-over {
    border-color: #EE8502;
    background: linear-gradient(135deg, rgba(238,133,2,0.06) 0%, rgba(255,157,31,0.06) 100%);
    box-shadow: 0 0 0 4px rgba(238,133,2,0.1);
}

.image-dropzone.is-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

.image-dropzone__icon {
    font-size: 36px;
    margin-bottom: 8px;
    display: block;
}

.image-dropzone__title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.image-dropzone__subtitle {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
}

.image-dropzone__btn {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 22px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, #EE8502 0%, #ff9d1f 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(238,133,2,0.25);
    transition: transform 0.15s, box-shadow 0.15s;
}

.image-dropzone__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(238,133,2,0.35);
}

.image-dropzone__input {
    display: none !important;
}

/* ── Preview Grid ─────────────────── */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.image-preview-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #fff;
    aspect-ratio: 1;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.image-preview-card:hover {
    border-color: #EE8502;
    box-shadow: 0 4px 16px rgba(238,133,2,0.15);
}

.image-preview-card.is-uploading {
    opacity: 0.7;
}

.image-preview-card.has-error {
    border-color: #ef4444;
}

.image-preview-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Delete button ─────────────────── */
.image-preview-card__delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: none;
    background: rgba(15,23,42,0.7);
    color: #fff;
    font-size: 14px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 2;
}

.image-preview-card:hover .image-preview-card__delete {
    opacity: 1;
}

.image-preview-card__delete:hover {
    background: #ef4444;
}

/* ── Progress overlay ─────────────────── */
.image-preview-card__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #e2e8f0;
    z-index: 2;
}

.image-preview-card__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #EE8502, #ff9d1f);
    border-radius: 0 0 0 12px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ── Counter ─────────────────── */
.image-upload-counter {
    margin-top: 10px;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.image-upload-counter .count-current {
    color: #0f172a;
    font-weight: 800;
}

.image-upload-counter.at-max .count-current {
    color: #ef4444;
}

.image-upload-counter.at-max {
    color: #ef4444;
}

/* ── Error message ─────────────────── */
.image-upload-error {
    margin-top: 8px;
    font-size: 13px;
    color: #ef4444;
    font-weight: 600;
    display: none;
}

.image-upload-error.visible {
    display: block;
}

/* ── Responsive ─────────────────── */
@media (max-width: 768px) {
    .image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .image-dropzone {
        padding: 20px 14px;
    }

    .image-dropzone__icon {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .image-preview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Upload Lightbox ─────────────────── */
.upload-lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.92);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: uploadLbFadeIn .2s ease;
}

@keyframes uploadLbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.upload-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    user-select: none;
}

.upload-lightbox-close {
    position: absolute;
    top: 16px; right: 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 32px;
    width: 48px; height: 48px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 48px;
    text-align: center;
    transition: background .2s;
    z-index: 2;
}

.upload-lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

.upload-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 40px;
    width: 52px; height: 52px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 52px;
    text-align: center;
    transition: background .2s;
    z-index: 2;
}

.upload-lightbox-nav:hover {
    background: rgba(255,255,255,0.25);
}

.upload-lightbox-prev { left: 16px; }
.upload-lightbox-next { right: 16px; }

.upload-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    font-weight: 600;
    background: rgba(0,0,0,0.4);
    padding: 6px 16px;
    border-radius: 20px;
}

.image-preview-card__img {
    cursor: zoom-in;
}

/* ── Compression placeholder ─────────── */
.image-preview-card.is-compressing {
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.image-preview-card__compress-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.image-preview-card__spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #EE8502;
    border-radius: 50%;
    animation: compressSpin 0.7s linear infinite;
}

@keyframes compressSpin {
    to { transform: rotate(360deg); }
}
