﻿/* upload image */

.miu-field {
    margin-bottom: 1.25rem;
}

.miu-label {
    display: inline-block;
    margin-bottom: 0.55rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #344767;
}

.miu-hint {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.75rem;
    color: #6c757d;
}

.miu-shell {
    position: relative;
}

.miu-file-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.miu-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #dbe2ea;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
}

.miu-shell.has-error .miu-card {
    border-color: #dc3545;
}

.miu-preview-wrap {
    flex: 0 0 180px;
}

.miu-preview {
    width: 180px;
    height: 180px;
    border-radius: 1rem;
    overflow: hidden;
    background: #f8fafc;
    border: 1px dashed #d7dee7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.miu-preview.has-image {
    border-style: solid;
    border-color: #e5e7eb;
}

.miu-preview__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.miu-preview__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-align: center;
    padding: 1rem;
}

.miu-preview__icon {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.miu-preview__text {
    font-size: 0.8rem;
    font-weight: 600;
}

.miu-meta {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.miu-meta__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #24324a;
}

.miu-meta__sub {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.45;
}

.miu-file-info {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #e9eef5;
    border-radius: 0.9rem;
    background: #f8fafc;
}

.miu-file-info__name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #24324a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.miu-file-info__size {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: #6b7280;
}

.miu-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.miu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0 1rem;
    border-radius: 0.85rem;
    border: 1px solid transparent;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.miu-btn--primary {
    background: var(--bs-primary);
    color: #fff;
}

.miu-btn--primary:hover {
    filter: brightness(0.97);
    color: #fff;
}

.miu-btn--light {
    background: #fff;
    border-color: #dbe2ea;
    color: #344767;
}

.miu-btn--light:hover:not(:disabled) {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.miu-btn--light:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 767.98px) {
    .miu-card {
        flex-direction: column;
    }

    .miu-preview-wrap,
    .miu-preview {
        width: 100%;
        flex: unset;
    }

    .miu-preview {
        height: 220px;
    }
}

[data-bs-theme="dark"] .miu-label {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .miu-hint {
    color: #98a2b3;
}

[data-bs-theme="dark"] .miu-card {
    background: #1f2637;
    border-color: #344054;
    box-shadow: none;
}

[data-bs-theme="dark"] .miu-preview {
    background: #151b2b;
    border-color: #344054;
}

[data-bs-theme="dark"] .miu-meta__title,
[data-bs-theme="dark"] .miu-file-info__name {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .miu-meta__sub,
[data-bs-theme="dark"] .miu-file-info__size,
[data-bs-theme="dark"] .miu-preview__empty {
    color: #98a2b3;
}

[data-bs-theme="dark"] .miu-file-info {
    background: #151b2b;
    border-color: #344054;
}

[data-bs-theme="dark"] .miu-btn--light {
    background: #151b2b;
    border-color: #344054;
    color: #f8f9fa;
}
