/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 15, 30, 0.4);
    /* Overlay très transparent */
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

/* Modal Box - True Glassmorphism */
.modal-content.glass-effect {
    background: rgba(15, 20, 35, 0.75);
    /* TRANSPARENT - laisse passer le fond */
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Bordure très subtile */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(20px) saturate(180%);
    /* Flou intense + saturation */
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    width: 780px;
    max-width: 95%;
    padding: 0;
    animation: zoomIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    color: #e2e8f0;
    font-family: 'Segoe UI', sans-serif;
    overflow: hidden;
}

/* Header */
.modal-header {
    padding: 18px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    /* Très léger */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.close-modal {
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
}

.close-modal:hover {
    color: #fff;
}

/* Layout */
.modal-body {
    padding: 25px 35px 30px 35px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    min-height: 400px;
}

/* Gauche */
.metadata-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    background: rgba(30, 40, 60, 0.4);
    /* TRANSPARENT */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 12px;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.85rem;
    transition: 0.2s;
    height: 38px;
    line-height: 38px;
    backdrop-filter: blur(10px);
    /* Flou sur les inputs aussi */
}

.input-group input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(30, 40, 60, 0.6);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-group input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

/* Droite */
.icon-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    justify-content: space-between;
}

/* Preview Box - Glass Card */
.preview-box {
    background: rgba(30, 40, 60, 0.3);
    /* Très transparent */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
}

.current-icon-wrapper {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.current-icon {
    max-width: 100%;
    max-height: 100%;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.file-name-display {
    font-size: 0.75rem;
    color: #60a5fa;
    margin: 0;
    text-align: center;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.icon-btn {
    flex: 1;
    background: rgba(30, 40, 60, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 6px;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
    transition: 0.2s;
    height: 32px;
    backdrop-filter: blur(10px);
}

.icon-btn:hover {
    background: rgba(30, 40, 60, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Icons Grid - Glass Cards */
.predefined-section h3 {
    font-size: 0.65rem;
    color: #64748b;
    margin: 5px 0 10px 0;
    font-weight: 700;
    text-transform: uppercase;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.grid-item {
    background: rgba(30, 40, 60, 0.35);
    /* Transparent */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    height: 48px;
    backdrop-filter: blur(10px);
}

.grid-item:hover {
    background: rgba(30, 40, 60, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.grid-item.selected {
    border-color: rgba(59, 130, 246, 0.6);
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.grid-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Action Container */
.action-container {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.btn-apply {
    background: rgba(16, 185, 129, 0.9);
    /* Vert avec légère transparence */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 0;
    height: 40px;
    width: 100%;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    backdrop-filter: blur(10px);
}

.btn-apply:hover {
    background: rgba(5, 150, 105, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.98);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.btn-apply.loading {
    background: rgba(16, 185, 129, 0.5) !important;
    cursor: wait !important;
    pointer-events: none;
}

.btn-apply.loading i {
    animation: spin 1s linear infinite;
}