/**
 * RALFinder Module CSS
 * Version 1.2.0
 */

/* Styles de base pour le module RALFinder */
.ralfinder-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ralfinder-intro {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
}

.ralfinder-upload {
    background: white;
}

.upload-zone {
    transition: all 0.3s ease;
}

.upload-zone:hover {
    transform: translateY(-2px);
}

/* Styles pour les éléments de debug */
.debug-status {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
}

.debug-coordinates {
    background: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

/* Styles pour les résultats */
.ral-results-new {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
}

.ral-color-square {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 3px solid #333;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin-right: 20px;
    flex-shrink: 0;
}

.ral-color-display {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ral-color-info .ral-code {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.ral-color-info .ral-name {
    font-size: 18px;
    color: #666;
    margin-bottom: 10px;
}

.ral-color-info .ral-confidence {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Styles pour l'aperçu d'image */
.preview-container {
    position: relative;
    display: block;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: visible;
    background: #f8f9fa;
}

.preview-container img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
    background: rgba(0,0,0,0.05);
    z-index: 5;
}

.click-overlay:hover {
    background: rgba(0,0,0,0.1);
}

.click-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #ff0000;
    border-radius: 50%;
    background: rgba(255,0,0,0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 15px rgba(255,0,0,0.6);
    animation: pulse-marker 1.5s infinite;
    z-index: 15;
}

@keyframes pulse-marker {
    0% { 
        box-shadow: 0 0 15px rgba(255,0,0,0.6); 
        transform: translate(-50%, -50%) scale(1); 
    }
    50% { 
        box-shadow: 0 0 25px rgba(255,0,0,0.9); 
        transform: translate(-50%, -50%) scale(1.1); 
    }
    100% { 
        box-shadow: 0 0 15px rgba(255,0,0,0.6); 
        transform: translate(-50%, -50%) scale(1); 
    }
}

/* Styles pour le crop preview */
.crop-preview {
    border: 2px solid #007bff;
    border-radius: 8px;
    background: white;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,123,255,0.1);
}

.crop-size-selector {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
}

.crop-size-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.crop-size-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.crop-size-btn:hover {
    background: #e9ecef;
}

.crop-size-btn.active:hover {
    background: #0056b3;
}

/* Styles pour les boutons */
.file-button-classic {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-button-classic:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Styles pour les produits */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.product-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
}

/* Animation d'entrée */
.ralfinder-container {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Styles pour les étapes d'aide */
.help-step {
    text-align: center;
    padding: 20px;
}

.step-number {
    width: 40px;
    height: 40px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-weight: bold;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .ral-color-display {
        flex-direction: column;
        text-align: center;
    }
    
    .ral-color-square {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
}