/* ========================================
   INDEX - SHARED ADMIN & MODAL STYLES
   (Used by carousel/feature modals and forms)
   ======================================== */

.modal-overlay {
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.modal-content {
    width: min(720px, calc(100% - 24px));
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
    color: #111827;
}

.modal-header,
.modal-body,
.modal-footer {
    padding: 18px 20px;
}

.modal-header,
.modal-footer {
    border-bottom: 1px solid #e5e7eb;
}

.modal-footer {
    border-top: 1px solid #e5e7eb;
    border-bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-close {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
}

.form-group {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.image-preview {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.image-preview img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 12px;
    object-fit: contain;
}

.btn,
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 16px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
    font-weight: 600;
    text-decoration: none;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 16px;
    border: 1px solid #b91c1c;
    border-radius: 10px;
    background: #dc2626;
    color: #ffffff;
    font-weight: 700;
}

#carouselModal.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

#carouselModal .modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.2);
    width: min(520px, calc(100% - 24px));
    border: none;
    padding: 0;
    animation: carouselModalIn 0.22s cubic-bezier(.4, 1.6, .6, 1);
}

@keyframes carouselModalIn {
    from {
        transform: translateY(34px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: none;
        opacity: 1;
    }
}

#carouselModal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 18px 18px 10px;
    border: none;
}

#carouselModal .modal-header h2 {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
}

#carouselModal .modal-close {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 1.1rem;
    min-height: 28px;
    width: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#carouselModal .modal-body {
    padding: 4px 18px 12px;
    border: none;
}

#carouselModal .modal-footer {
    padding: 12px 18px 18px;
    border: none;
    gap: 8px;
}

#carouselModal .btn,
#carouselModal .btn-primary,
#carouselModal .btn-secondary,
#carouselModal .btn-danger {
    min-height: 40px;
    border-radius: 8px;
    padding: 9px 12px;
}

#carouselDeleteBlock {
    padding: 6px 2px 4px;
}

#carouselDeleteMessage {
    margin: 0 0 8px;
    color: #111827;
    font-weight: 600;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}
