/* =============================================
   GALAXY PROPERTIES PANEL - Style Miro/Figma
   Panneau flottant pour éditer les formes sélectionnées
   ============================================= */

/* === PANNEAU FLOTTANT === */
.galaxy-properties-panel {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 280px;
    max-height: calc(100vh - 120px);
    background: linear-gradient(135deg,
        rgba(20, 20, 30, 0.95),
        rgba(30, 30, 45, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-radius: 16px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(96, 165, 250, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
    z-index: 500;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease-out, border-color 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
}

.galaxy-properties-panel.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* === HEADER DU PANNEAU === */
.gpp-header {
    padding: 16px 20px;
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.15),
        rgba(96, 165, 250, 0.15));
    border-bottom: 1px solid rgba(96, 165, 250, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gpp-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gpp-title::before {
    content: '✨';
    font-size: 16px;
}

.gpp-close-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.gpp-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ffffff;
}

/* === CONTENU DU PANNEAU === */
.gpp-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gpp-content::-webkit-scrollbar {
    width: 8px;
}

.gpp-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.gpp-content::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 4px;
}

.gpp-content::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

/* === SECTION === */
.gpp-section {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.1);
    border-radius: 12px;
    padding: 16px;
    transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
}

.gpp-section:hover {
    border-color: rgba(96, 165, 250, 0.25);
    background: rgba(0, 0, 0, 0.2);
}

.gpp-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* === CHAMP TEXTE === */
.gpp-field {
    margin-bottom: 12px;
}

.gpp-field:last-child {
    margin-bottom: 0;
}

.gpp-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gpp-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    color: #ffffff;
    font-size: 13px;
    font-family: 'Inter', -apple-system, sans-serif;
    transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
}

.gpp-input:focus {
    outline: none;
    border-color: #60a5fa;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.2);
}

.gpp-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.gpp-textarea {
    min-height: 80px;
    resize: vertical;
}

/* === PALETTE DE COULEURS === */
.gpp-color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.gpp-color-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
    position: relative;
    background-clip: padding-box;
}

.gpp-color-btn::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 10px;
    background: linear-gradient(135deg,
        rgba(96, 165, 250, 0.4),
        rgba(168, 85, 247, 0.4));
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

.gpp-color-btn:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.gpp-color-btn.active {
    border-color: #ffffff;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.gpp-color-btn.active::before {
    opacity: 1;
}

.gpp-color-btn.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* === SÉLECTEUR DE FORME === */
.gpp-shape-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.gpp-shape-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(96, 165, 250, 0.2);
    border-radius: 10px;
    padding: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.gpp-shape-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(96, 165, 250, 0.4);
    color: #60a5fa;
    transform: scale(1.05);
}

.gpp-shape-btn.active {
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.25),
        rgba(96, 165, 250, 0.25));
    border-color: #60a5fa;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
}

.gpp-shape-name {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === SLIDER (taille) === */
.gpp-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gpp-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    outline: none;
}

.gpp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.gpp-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.6);
}

.gpp-slider::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

.gpp-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.gpp-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.6);
}

.gpp-slider-value {
    min-width: 40px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: #60a5fa;
}

/* === BOUTONS D'ACTION === */
.gpp-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(96, 165, 250, 0.1);
}

.gpp-btn {
    flex: 1;
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.2),
        rgba(96, 165, 250, 0.2));
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 8px;
    padding: 10px 16px;
    color: #60a5fa;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease-out, background 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, opacity 0.2s ease-out;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gpp-btn:hover {
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.3),
        rgba(96, 165, 250, 0.3));
    border-color: #60a5fa;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.gpp-btn:active {
    transform: translateY(0);
}

.gpp-btn-danger {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.2),
        rgba(220, 38, 38, 0.2));
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.gpp-btn-danger:hover {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.3),
        rgba(220, 38, 38, 0.3));
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

/* === BADGE DE SÉLECTION MULTIPLE === */
.gpp-multi-badge {
    background: linear-gradient(135deg,
        rgba(168, 85, 247, 0.2),
        color-mix(in srgb, var(--accent) 20%, transparent));
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    color: var(--accent-light);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
}

/* === ANIMATIONS === */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px) translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0) scale(1);
    }
}

.galaxy-properties-panel.visible {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .galaxy-properties-panel {
        right: 10px;
        width: 260px;
        top: 70px;
    }

    .gpp-color-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
