/**
 * CDesigner - Frame Color Overlay Styles
 * Styles pour le sélecteur de couleur de cadre
 */

/* ===== CONTENEUR PRINCIPAL ===== */
#frame-color-selector {
    padding: 15px;
    margin: 15px 0;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    clear: both;
}

#frame-color-selector .frame-color-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

#frame-color-selector .frame-color-title i {
    color: #666;
}

/* ===== LISTE DES COULEURS ===== */
.frame-color-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #eee;
}

.frame-color-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.frame-color-item:hover {
    transform: scale(1.1);
    border-color: #888;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.frame-color-item.active {
    border-color: #333 !important;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

/* Couleurs claires - bordure visible */
.frame-color-item.light-color {
    border-color: #ccc;
}

/* Option transparent */
.frame-color-item.transparent-option {
    background: repeating-conic-gradient(
        #ddd 0% 25%,
        #fff 0% 50%
    ) 50% / 10px 10px;
    color: #666;
    font-size: 16px;
    font-weight: bold;
}

.frame-color-item .transparent-icon {
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

/* ===== COLOR PICKER PERSONNALISÉ ===== */
.frame-color-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
    margin-top: 5px;
}

.frame-color-custom span {
    font-size: 11px;
    color: #666;
}

.frame-color-custom input[type="color"] {
    width: 32px;
    height: 32px;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    overflow: hidden;
}

.frame-color-custom input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 50%;
}

.frame-color-custom input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.frame-color-custom input[type="color"]:hover {
    transform: scale(1.05);
    border-color: #888;
}

/* ===== OVERLAY SUR LE CADRE ===== */
.frame-color-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    transition: background-color 0.3s ease;
}

/* Overlay avec blend mode pour les cadres */
.frame-color-overlay.blend-multiply {
    mix-blend-mode: multiply;
}

.frame-color-overlay.blend-overlay {
    mix-blend-mode: overlay;
}

.frame-color-overlay.blend-color {
    mix-blend-mode: color;
}

/* ===== INDICATEUR DE COULEUR ACTIVE ===== */
.frame-color-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 10px;
    background: #fff;
    border-radius: 4px;
    font-size: 11px;
    color: #666;
}

.frame-color-indicator .color-preview {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #ddd;
}

/* ===== RESPONSIVE ===== */
@media only screen and (max-width: 979px) {
    #frame-color-selector {
        padding: 12px;
        margin: 8px 0;
    }
    
    .frame-color-list {
        gap: 6px;
    }
    
    .frame-color-item {
        width: 28px;
        height: 28px;
    }
    
    .frame-color-custom input[type="color"] {
        width: 28px;
        height: 28px;
    }
}

/* ===== ANIMATION ===== */
@keyframes colorPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.frame-color-item.just-selected {
    animation: colorPulse 0.3s ease;
}

/* ===== TOOLTIP ===== */
.frame-color-item[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    margin-bottom: 5px;
    z-index: 100;
}

.frame-color-item[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: 0;
    z-index: 100;
}

/* ===== ÉTATS SPÉCIAUX ===== */
#frame-color-selector.disabled {
    opacity: 0.5;
    pointer-events: none;
}

#frame-color-selector.hidden {
    display: none;
}

/* Message d'aide */
.frame-color-help {
    font-size: 10px;
    color: #999;
    margin-top: 8px;
    font-style: italic;
}
