/* Correção para paletas de cores no tema escuro */

/* Força fundo escuro nos cards das paletas - usando as classes corretas do JavaScript */
.palette-card, .color-palette-card {
    background: #2a2a2a !important;
    border: 1px solid #404040 !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    padding: 20px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    cursor: pointer !important;
}

.palette-card:hover, .color-palette-card:hover {
    background: #333333 !important;
    border-color: #007bff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

.palette-card.selected, .color-palette-card.selected {
    background: #2d3748 !important;
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3) !important;
}

/* Força texto branco nos nomes das paletas */
.palette-card h4, .color-palette-card h4,
.palette-card .palette-name, .color-palette-card .palette-name {
    color: #ffffff !important;
    font-family: 'Geist', sans-serif !important;
    font-weight: 600 !important;
    margin-bottom: 15px !important;
}

/* Força fundo escuro no container das paletas */
#color-palettes-container, .palettes-grid {
    background: transparent !important;
}

/* Melhora a visibilidade dos botões no tema escuro */
.apply-palette-button, .apply-palette-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-family: 'Geist', sans-serif !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    justify-content: center !important;
    width: 100% !important;
    margin-top: 15px !important;
}

.apply-palette-button:hover, .apply-palette-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4) !important;
}

.apply-palette-button:disabled, .apply-palette-btn:disabled {
    background: #444444 !important;
    color: #888888 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Melhora os swatches de cores no tema escuro */
.color-sample, .color-swatch {
    border: 2px solid #404040 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    border-radius: 8px !important;
    width: 40px !important;
    height: 40px !important;
    transition: all 0.2s ease !important;
}

.color-sample:hover, .color-swatch:hover {
    border-color: #007bff !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3) !important;
    transform: scale(1.1) !important;
}

/* Container das amostras de cores */
.color-samples {
    display: flex !important;
    gap: 10px !important;
    margin: 15px 0 !important;
    justify-content: center !important;
}

/* Força o tema escuro em toda a seção de layout */
#layout-tab {
    background: transparent !important;
    color: #ffffff !important;
}

#layout-tab .operations-group {
    background: transparent !important;
}

#layout-tab .operations-group h3 {
    color: #ffffff !important;
    font-family: 'Geist', sans-serif !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #ffffff 0%, #007bff 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

#layout-tab .operations-group p {
    color: #b3b3b3 !important;
    font-family: 'Geist', sans-serif !important;
}

/* Loading message no tema escuro */
.loading-message {
    color: #b3b3b3 !important;
    font-family: 'Geist', sans-serif !important;
    text-align: center !important;
    padding: 40px 20px !important;
}

.loading-message i {
    color: #007bff !important;
    margin-right: 10px !important;
}

/* Status messages no tema escuro */
#layout-status {
    background: #2a2a2a !important;
    border: 1px solid #404040 !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 15px !important;
    margin-top: 20px !important;
    font-family: 'Geist', sans-serif !important;
    font-weight: 500 !important;
    text-align: center !important;
}

#layout-status.success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2) 0%, rgba(32, 201, 151, 0.2) 100%) !important;
    color: #28a745 !important;
    border: 1px solid rgba(40, 167, 69, 0.4) !important;
}

#layout-status.error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.2) 0%, rgba(200, 35, 51, 0.2) 100%) !important;
    color: #dc3545 !important;
    border: 1px solid rgba(220, 53, 69, 0.4) !important;
}

#layout-status.info {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.2) 0%, rgba(0, 86, 179, 0.2) 100%) !important;
    color: #007bff !important;
    border: 1px solid rgba(0, 123, 255, 0.4) !important;
}

/* Grid das paletas */
.palettes-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 20px !important;
}

/* Animações suaves */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.palette-card {
    animation: fadeInUp 0.5s ease forwards !important;
}

.palette-card:nth-child(1) { animation-delay: 0.1s !important; }
.palette-card:nth-child(2) { animation-delay: 0.2s !important; }
.palette-card:nth-child(3) { animation-delay: 0.3s !important; }
.palette-card:nth-child(4) { animation-delay: 0.4s !important; }
.palette-card:nth-child(5) { animation-delay: 0.5s !important; }

/* Responsividade para mobile */
@media (max-width: 768px) {
    .palette-card {
        padding: 15px !important;
    }
    
    .color-sample, .color-swatch {
        width: 35px !important;
        height: 35px !important;
    }
    
    .apply-palette-button, .apply-palette-btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
    
    .palettes-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
        gap: 15px !important;
    }
}
