/* assets/css/sitemash.css */

/* Styles généraux pour SiteMash */
.sitemash-ranking,
.sitemash-vote,
.sitemash-add-site {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Cartes de sites dans le classement */
.site-card {
    animation: fadeIn 0.6s ease-out;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Options de vote avec effets */
.vote-option {
    animation: slideIn 0.5s ease-out;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.vote-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.vote-option:hover::before {
    left: 100%;
}

.vote-option:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.vote-option.selected {
    border-color: #10b981;
    background-color: #ecfdf5;
    animation: pulse 0.5s ease-in-out;
}

/* Boutons avec gradients */
.vote-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    position: relative;
    overflow: hidden;
}

.vote-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.vote-btn:hover::before {
    left: 100%;
}

.vote-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Badges de classement avec couleurs spéciales */
.rank-badge-1 {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #92400e;
    box-shadow: 0 4px 6px rgba(251, 191, 36, 0.3);
}

.rank-badge-2 {
    background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%);
    color: #374151;
    box-shadow: 0 4px 6px rgba(156, 163, 175, 0.3);
}

.rank-badge-3 {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #9a3412;
    box-shadow: 0 4px 6px rgba(249, 115, 22, 0.3);
}

/* Images avec effet de chargement */
.site-image {
    position: relative;
    background: linear-gradient(45deg, #f3f4f6, #e5e7eb);
    background-size: 400% 400%;
    animation: loading-shimmer 1.5s ease-in-out infinite;
}

.site-image img {
    transition: opacity 0.3s ease;
}

.site-image img:not([src]) {
    opacity: 0;
}

@keyframes loading-shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Statistiques avec icônes */
.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.stat-item:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.stat-value {
    font-weight: 700;
    font-size: 1.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Messages de feedback */
.success-message {
    animation: slideIn 0.5s ease-out;
}

.error-message {
    animation: slideIn 0.5s ease-out;
}

/* Loader personnalisé */
.sitemash-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive amélioré */
@media (max-width: 768px) {
    .vote-option {
        margin-bottom: 1rem;
    }
    
    .site-card {
        margin-bottom: 1rem;
    }
    
    .stat-item {
        padding: 0.5rem;
        text-align: center;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
}

/* Formulaire d'ajout de site */
.form-field {
    transition: all 0.3s ease;
}

.form-field:focus-within {
    transform: translateY(-2px);
}

.preview-container {
    transition: all 0.5s ease;
    max-height: 0;
    overflow: hidden;
}

.preview-container.active {
    max-height: 300px;
}

/* Effets de hover pour les liens */
.site-link {
    position: relative;
    transition: all 0.3s ease;
}

.site-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: width 0.3s ease;
}

.site-link:hover::after {
    width: 100%;
}

/* Classement avec dégradé */
.ranking-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 1rem 1rem 0 0;
}

/* Pagination si nécessaire */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

.pagination-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Tooltip personnalisé */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.tooltip:hover::before {
    opacity: 1;
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .sitemash-ranking,
    .sitemash-vote,
    .sitemash-add-site {
        background-color: #111827;
        color: #f9fafb;
    }
    
    .site-card,
    .vote-option {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .stat-item {
        background-color: #1f2937;
        color: #f9fafb;
    }
}

/* Animations d'entrée retardées pour les cartes */
.site-card:nth-child(1) { animation-delay: 0.1s; }
.site-card:nth-child(2) { animation-delay: 0.2s; }
.site-card:nth-child(3) { animation-delay: 0.3s; }
.site-card:nth-child(4) { animation-delay: 0.4s; }
.site-card:nth-child(5) { animation-delay: 0.5s; }
.site-card:nth-child(6) { animation-delay: 0.6s; }
.site-card:nth-child(7) { animation-delay: 0.7s; }
.site-card:nth-child(8) { animation-delay: 0.8s; }