/**
 * OrTribune App CSS - Styles personnalisés
 * 
 * Palette : Or foncé / Bronze élégant
 * - Couleur principale : #9B7E3A (Bronze doré)
 * - Sérieux et professionnel pour un site d'actualités financières
 * - Contraste optimal pour la lisibilité
 */

/* ============================================================================
   VARIABLES PERSONNALISÉES - Palette Or/Bronze
   ============================================================================ */

:root {
    /* Couleurs principales - Or foncé/Bronze */
    --primary-color: #9B7E3A;
    --primary-hover: #7A6329;
    --primary-light: #C4A962;
    --primary-gradient: linear-gradient(135deg, #9B7E3A 0%, #C4A962 100%);
    
    /* Couleur accent - Or clair pour les highlights */
    --accent-color: #D4AF37;
    --accent-hover: #B8941F;
    
    /* Dégradés or élégants */
    --gold-gradient: linear-gradient(135deg, #9B7E3A 0%, #D4AF37 50%, #C4A962 100%);
    --gold-shimmer: linear-gradient(90deg, #9B7E3A 0%, #D4AF37 50%, #9B7E3A 100%);
}

/* Mode sombre - Ajustements pour la palette or */
[data-theme="dark"] {
    --primary-color: #C4A962;
    --primary-hover: #D4AF37;
    --primary-light: #9B7E3A;
    --accent-color: #D4AF37;
    --accent-hover: #F5E6C8;
}

/* ============================================================================
   BADGE DRAFT POUR ADMINS
   ============================================================================ */

.draft-badge {
    position: absolute;
    top: 1rem;
    left: 1rem; /* Gauche pour ne pas chevaucher featured (droite) */
    background: #f59e0b; /* Orange */
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    z-index: 2;
}

[data-theme="dark"] .draft-badge {
    background: #d97706;
}

/* Badge featured déjà existant (à droite) */
.featured-badge {
    right: 1rem !important; /* S'assurer qu'il reste à droite */
}

/* ============================================================================
   SURCHARGES COMPOSANTS CORE
   ============================================================================ */

/* Boutons avec effet or */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(155, 126, 58, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gold-shimmer);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Liens avec effet or (sauf header secondaire) */
a:not(.btn):not(.header-secondary-link) {
    color: var(--primary-color);
}

a:not(.btn):not(.header-secondary-link):hover {
    color: var(--primary-hover);
}

/* Stats avec bordure or */
.stats-card {
    border-top: 3px solid var(--primary-color);
}

.stats-card:hover {
    border-top-color: var(--accent-color);
}

/* Icônes avec teinte or */
.stats-icon,
.feature-icon {
    color: var(--primary-color) !important;
    background: rgba(155, 126, 58, 0.1);
}

/* Cards avec effet hover or */
.card:hover,
.article-card:hover,
.product-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 8px 24px rgba(155, 126, 58, 0.15);
}

/* ============================================================================
   COMPOSANTS SPÉCIFIQUES ORTRIBUNE
   ============================================================================ */

/* Hero section avec gradient or */
.hero {
    background: linear-gradient(135deg, rgba(155, 126, 58, 0.08) 0%, rgba(196, 169, 98, 0.12) 100%);
    border-bottom: 2px solid var(--primary-light);
}

/* Mode clair - Assurer contraste optimal */
:root:not([data-theme="dark"]) .hero {
    background: linear-gradient(135deg, #e8dcc0 0%, #f0e5cc 100%) !important;
    border-bottom: 3px solid var(--primary-color);
}

:root:not([data-theme="dark"]) .hero .hero-title,
:root:not([data-theme="dark"]) .hero .hero-subtitle,
:root:not([data-theme="dark"]) .hero .hero-description {
    color: #2d2d2d !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

:root:not([data-theme="dark"]) .hero h1,
:root:not([data-theme="dark"]) .hero h2,
:root:not([data-theme="dark"]) .hero p {
    color: #2d2d2d !important;
}

/* Mode sombre - Garder le style actuel */
[data-theme="dark"] .hero {
    background: linear-gradient(135deg, rgba(155, 126, 58, 0.15) 0%, rgba(196, 169, 98, 0.15) 100%);
}

/* Section title avec barre or */
.section-title {
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gold-gradient);
    border-radius: 2px;
}

/* Newsletter card highlight */
.card-highlight {
    background: linear-gradient(135deg, rgba(155, 126, 58, 0.08) 0%, rgba(196, 169, 98, 0.08) 100%);
    border: 2px solid var(--primary-light);
}

/* Facts grid - Style premium or */
.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.fact-item {
    text-align: center;
    padding: 2rem;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.fact-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.fact-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-light);
    box-shadow: 0 12px 24px rgba(155, 126, 58, 0.15);
}

.fact-item:hover::before {
    transform: scaleX(1);
}

.fact-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.fact-item h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.fact-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.6;
}

/* Resources grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.resources-grid .sidebar-card {
    transition: all 0.3s ease;
}

.resources-grid .sidebar-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

/* Newsletter section */
.newsletter-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.newsletter-text h2 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
}

.newsletter-form form {
    display: flex;
    gap: 1rem;
}

.newsletter-form input[type="email"] {
    flex: 1;
    border: 2px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.newsletter-form input[type="email"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(155, 126, 58, 0.1);
}

/* Stats grid avec effet shimmer or */
.stats-grid {
    background: linear-gradient(135deg, rgba(155, 126, 58, 0.03) 0%, rgba(196, 169, 98, 0.03) 100%);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
}

.stats-value {
    color: var(--primary-color);
    font-weight: 700;
}

.stats-change.up {
    color: #22c55e;
}

.stats-change.down {
    color: #ef4444;
}

/* Feature grid - Hover effet or */
.feature-card:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(155, 126, 58, 0.05) 0%, rgba(196, 169, 98, 0.05) 100%);
}

/* Articles grid - Spacing amélioré */
.home-articles {
    margin-top: 2rem;
}

.article-card {
    transition: all 0.3s ease;
}

.article-card:hover .article-title {
    color: var(--primary-color);
}

/* CTA Section */
.section-cta {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .facts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .newsletter-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .newsletter-form form {
        flex-direction: column;
    }
    
    .stats-grid {
        padding: 1rem;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .fact-item {
        padding: 1.5rem;
    }
    
    .fact-item h3 {
        font-size: 1.5rem;
    }
    
    .fact-icon {
        font-size: 2rem;
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes goldShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.gold-text {
    background: var(--gold-gradient);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: goldShimmer 3s linear infinite;
}

/* Effet de brillance sur les éléments premium */
.premium-shine {
    position: relative;
    overflow: hidden;
}

.premium-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(212, 175, 55, 0.3), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* ============================================================================
   VARIATIONS PRIX OR (Stats Cards)
   ============================================================================ */

.stat-change {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
}

.stat-change.positive {
    color: #16a34a;
    background: rgba(34, 197, 94, 0.1);
}

.stat-change.negative {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .stat-change.positive {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
}

[data-theme="dark"] .stat-change.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

/* Coloration variations dans unit (flèches Unicode) */
.stat-card .stat-label {
    font-weight: 600;
}

/* Variation positive (commence par ↗) */
.stat-card .stat-label:has-text("↗"),
.stat-card .stat-label[data-variation="positive"] {
    color: #16a34a;
}

/* Variation négative (commence par ↘) */
.stat-card .stat-label:has-text("↘"),
.stat-card .stat-label[data-variation="negative"] {
    color: #dc2626;
}



