/*
 * Path: /public/css/app-lightbox-uploader.css
 * File: app-lightbox-uploader.css (v1.1 - Added modern Modal styles)
 */

/* ==========================================================================
   14. CUSTOM LIGHTBOX & MODALS
   ========================================================================== */

body.lightbox-is-open {
    overflow: hidden;
}

.custom-lightbox {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.custom-lightbox.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.custom-lightbox__close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 10001;
    line-height: 1;
    padding: 0;
}

.custom-lightbox__close:hover {
    color: #cbd5e1;
    transform: scale(1.1);
}

.custom-lightbox__content-wrapper {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: lightbox-fade-in 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.custom-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 40px);
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.2),
        0 8px 10px -6px rgba(0, 0, 0, 0.2);
    object-fit: contain;
}

.custom-lightbox__caption {
    color: #e2e8f0;
    text-align: center;
    margin-top: 15px;
    font-size: 1rem;
    font-weight: 500;
}

@keyframes lightbox-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modals (Modern Version) */

.modal {
    position: fixed;
    inset: 0; /* Modern replacement for top/left/w/h */
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

.modal.is-visible,
.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.92));
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 18px;
    padding: 1.75rem 1.75rem 1.5rem;
    max-width: 640px; /* Default max-width, can be overridden */
    width: 100%;
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.35),
        0 0 0 1px rgba(148, 163, 184, 0.1);
    transform: translateY(10px) scale(0.97);
    transition: transform 0.25s ease;
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.is-visible .modal-content,
.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close,
.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #0f172a08;
    border: none;
    border-radius: 999px;
    width: 32px;
    height: 32px;
    font-size: 1.4rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    padding: 0;
}

.modal-close:hover,
.modal-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.05);
}

/* Modal typography helpers */
#service-modal-title,
.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
    color: #0f172a;
}

@media (max-width: 768px) {
    .modal {
        padding: 1.5rem 0.75rem;
        align-items: flex-start;
    }
    .modal-content {
        max-width: 100%;
        border-radius: 16px;
    }
}

/* ==========================================================================
   15. ADVANCED UPLOADER STYLES
   ========================================================================== */

.uploader-card {
    background: var(--background-light);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.uploader-card-body {
    padding: var(--space-8);
}

.uploader-card-footer {
    padding: var(--space-6) var(--space-8);
    background: #fff;
    border-top: 1px solid var(--border-color);
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem var(--space-8);
    text-align: center;
    background: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--primary-color-light);
}

.upload-zone.drag-over {
    border-color: var(--primary-color);
    background: var(--primary-color-light);
    transform: scale(1.02);
}

.upload-zone.has-file {
    border-color: var(--success-color);
    background: var(--success-color-light);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.upload-zone.has-file .upload-icon {
    background: var(--success-color);
}

.upload-text {
    margin-bottom: var(--space-4);
}

.upload-primary-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--space-2);
}

.upload-secondary-text {
    font-size: 1rem;
    color: var(--text-light);
}

.browse-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--primary-color);
    color: #fff;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.browse-button:hover {
    background: var(--primary-color-dark);
    transform: translateY(-1px);
}

.file-input {
    display: none;
}

.preview-section {
    margin-top: var(--space-8);
    display: none;
}

.preview-section.visible {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.preview-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: var(--space-6);
    align-items: start;
}

.preview-image {
    width: 140px;
    height: 140px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-all;
}

.validation-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-success {
    background: var(--success-color-light);
    color: var(--success-color);
}

.status-error {
    background: var(--error-color-light);
    color: var(--error-color);
}

.status-warning {
    background: var(--warning-color-light);
    color: var(--warning-color);
}

.actions {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    flex-wrap: wrap;
}

.progress-container {
    margin-top: var(--space-4);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.progress-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-regular);
}

.progress-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color-dark);
}

.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: var(--radius-md);
    transition: width 0.3s ease;
    width: 0%;
}

@media (max-width: 640px) {
    .preview-grid {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
}