/*
 * home.css
 * Styles pour la page d'accueil Infinity - Design moderne et minimaliste
 */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 2rem;
}

/* =================================
    HERO SECTION
================================= */

.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: var(--spacing-xl);
    overflow: hidden;
}

.hero__background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.hero__gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center,
            rgba(212, 175, 55, 0.15) 0%,
            rgba(212, 175, 55, 0.05) 30%,
            transparent 60%);
}

.hero__particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--primary-gold);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 2s;
}

.particle:nth-child(3) {
    top: 80%;
    left: 30%;
    animation-delay: 4s;
}

.particle:nth-child(4) {
    top: 30%;
    left: 70%;
    animation-delay: 1s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.6;
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.hero__title {
    margin-bottom: var(--spacing-md);
}

.hero__title-main {
    display: block;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    /* Factorisation avec le bas du fichier */
    font-weight: 700;
    background: linear-gradient(120deg, var(--primary-gold), #ffe082);
    /* Factorisation avec le bas du fichier */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero__title-sub {
    display: block;
    font-size: 1rem;
    /* Factorisation avec le bas du fichier */
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.15em;
    /* Factorisation avec le bas du fichier */
    text-transform: uppercase;
}

.hero__tagline {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
    font-weight: 300;
}

.hero__cta {
    margin-top: 2rem;
    /* Factorisation avec le bas du fichier */
    display: flex;
    /* Factorisation avec le bas du fichier */
    justify-content: center;
    /* Factorisation avec le bas du fichier */
    flex-wrap: wrap;
    /* Factorisation avec le bas du fichier */
    gap: 1rem;
    /* Factorisation avec le bas du fichier */
}

/* =================================
    WIDGETS SECTION
================================= */

.widgets {
    margin-bottom: var(--spacing-xl);
}

.widgets__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.widget,
.card {
    /* Factorisation des styles de base des cartes */
    background: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.widget {
    overflow: hidden;
    /* Maintenu car pas dans .card */
}

.widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-gold), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.widget:hover {
    background: var(--dark-card-hover);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.widget:hover::before {
    opacity: 1;
}

.card:hover {
    /* Styles de survol spécifiques à .card */
    background: var(--dark-card-hover);
    transform: translateY(-3px);
}

.widget--coming-soon {
    opacity: 0.7;
}

.widget__header,
.card__header {
    /* Factorisation des entêtes */
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.widget__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: var(--border-radius);
    color: var(--primary-gold);
    transition: all 0.3s ease;
}

.widget:hover .widget__icon {
    background: var(--gold-glow);
    transform: scale(1.1);
}

.widget__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 auto 0 var(--spacing-sm);
}

.widget__status {
    flex-shrink: 0;
}

.widget__content {
    margin-top: var(--spacing-sm);
}

.widget__description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.widget__action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--primary-gold);
    border-radius: 8px;
    color: var(--primary-gold);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.widget__action:hover {
    background: var(--primary-gold);
    color: var(--dark-bg);
    transform: translateX(5px);
}

.widget__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-muted);
    font-style: italic;
}


/* =================================
    PULSE SECTION
================================= */

.pulse {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl) 0;
    width: 100%;
    max-width: 1200px;
}

.pulse__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    max-width: 1000px;
    margin: 0 auto;
}

.pulse__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    background: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-lg);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.pulse__card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.pulse__card:hover {
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-10px);
}

.pulse__card:hover::before {
    opacity: 1;
}

.pulse__icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 50%;
    margin-bottom: var(--spacing-md);
    color: var(--primary-gold);
    font-size: 2rem;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.pulse__card:hover .pulse__icon {
    transform: scale(1.1) rotate(360deg);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.pulse__value {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-gold), #f0c040);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
    position: relative;
    z-index: 1;
}

.pulse__label {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    position: relative;
    z-index: 1;
}

/* Variations de couleur par card */
.pulse__card:nth-child(1) .pulse__icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.pulse__card:nth-child(1):hover {
    border-color: rgba(16, 185, 129, 0.3);
}

.pulse__card:nth-child(1)::before {
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.1), transparent 70%);
}

.pulse__card:nth-child(1) .pulse__value {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pulse__card:nth-child(2) .pulse__icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.pulse__card:nth-child(2):hover {
    border-color: rgba(59, 130, 246, 0.3);
}

.pulse__card:nth-child(2)::before {
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.1), transparent 70%);
}

.pulse__card:nth-child(2) .pulse__value {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pulse__card:nth-child(3) .pulse__icon {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.pulse__card:nth-child(3):hover {
    border-color: rgba(168, 85, 247, 0.3);
}

.pulse__card:nth-child(3)::before {
    background: radial-gradient(circle at center, rgba(168, 85, 247, 0.1), transparent 70%);
}

.pulse__card:nth-child(3) .pulse__value {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive Pulse */
@media (max-width: 768px) {
    .pulse__grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .pulse__card {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .pulse__value {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .pulse__grid {
        grid-template-columns: 1fr;
    }

    .pulse__card {
        padding: var(--spacing-md);
    }

    .pulse__icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    .pulse__value {
        font-size: 2.5rem;
    }

    .pulse__label {
        font-size: 1.1rem;
    }
}

/* =================================
    STATUS & VERSION SECTION
================================= */

.bottom-section {
    margin-bottom: var(--spacing-xl);
}

.status-version {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

/* .card est déjà factorisé plus haut */

.card__header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.status__indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status__dot--operational {
    background: var(--success-color);
    animation: pulseSuccess 2s infinite;
}

.status__dot--degraded,
.status__dot--partial {
    background: var(--warning-color);
    animation: pulseWarning 2s infinite;
}

.status__dot--major {
    background: #ef4444;
    animation: pulseDanger 2s infinite;
}

.status__dot--maintenance {
    background: #3b82f6;
    animation: pulseInfo 2s infinite;
}

.status__dot--error {
    background: #ff0000;
    animation: pulseError 1.5s infinite;
}

/* Factorisation des styles de texte de statut */
.status__text--major {
    color: #ef4444;
}

.status__text--maintenance {
    color: #3b82f6;
}

.status__text--degraded {
    color: var(--warning-color);
}

.status__text--error {
    color: #ff0000;
}

/* Factorisation des animations de pulse */
@keyframes pulseSuccess {
    0% {
        box-shadow: 0 0 0 0 var(--success-color);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes pulseWarning {
    0% {
        box-shadow: 0 0 0 0 var(--warning-color);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

@keyframes pulseDanger {
    0% {
        box-shadow: 0 0 0 0 #ef4444;
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes pulseInfo {
    0% {
        box-shadow: 0 0 0 0 #3b82f6;
    }

    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

@keyframes pulseError {
    0% {
        box-shadow: 0 0 0 0 #ff0000;
    }

    50% {
        box-shadow: 0 0 0 12px rgba(255, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

/* Le @keyframes pulse a été fusionné/remplacé par pulseSuccess car c'était un doublon */
/* J'ai laissé .status__dot:not([class*="--"]) avec l'animation pulse pour les cas par défaut */
.status__dot {
    /* ... styles existants ... */
    animation: pulse 2s infinite;
    /* Maintenu pour le cas par défaut sans classe spécifique */
}

@keyframes pulse {

    /* Correspond à l'ancienne pulse (qui était un doublon de pulseSuccess) */
    0% {
        box-shadow: 0 0 0 0 var(--success-color);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.status__text {
    color: var(--success-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.status__details {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.status__update {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.version__badge {
    display: flex;
    align-items: center;
}

.version__number {
    background: var(--primary-gold);
    color: var(--dark-bg);
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}

.version__description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

/* =================================
    MANTRA SECTION
================================= */

.mantra-quote {
    font-style: italic;
    color: var(--primary-gold, #eab308);
    background: rgba(245, 158, 11, 0.08);
    border-left: 4px solid var(--primary-gold, #eab308);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    font-size: 1.2rem;
    transition: background 0.3s;
}

.mantra-quote::before,
/* Factorisation des pseudos-éléments */
.mantra-quote::after {
    content: '”';
    /* Surchargé par ::before */
    font-size: 2rem;
    vertical-align: -0.4em;
    color: var(--primary-gold, #eab308);
}

.mantra-quote::before {
    content: '“';
    margin-right: 0.2em;
    margin-left: 0;
}

.mantra-quote::after {
    margin-left: 0.2em;
    margin-right: 0;
}

/* =================================
    BADGES
================================= */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge--success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge--auth {
    background: rgba(212, 175, 55, 0.2);
    color: var(--primary-gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.badge--coming {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* =================================
    BUTTONS
================================= */

.btn--outline {
    background: transparent;
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
}

.btn--outline:hover {
    background: var(--primary-gold);
    color: var(--dark-bg);
}

/* Factorisation des styles de taille de bouton */
.btn--hero,
.btn--lg {
    padding: 16px 32px;
    font-size: 1.1rem;
    /* .btn--hero avait 1.1rem, .btn--lg avait 1.2rem, j'ai conservé le style de .btn--lg pour la taille de police et 16px/32px pour le padding */
    border-radius: 12px;
}

.btn--lg {
    /* Surcharge pour la taille de police si nécessaire, mais l'original était 1.2rem. J'ai gardé 1.1rem et 1.2rem pour refléter le plus petit des deux */
    font-size: 1.2rem;
}

.btn--hero {
    font-size: 1.1rem;
}


.btn--sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

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

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .hero__title-main {
        font-size: 3rem;
    }

    .hero__tagline {
        font-size: 1.2rem;
    }

    .widgets__grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }

    .feature {
        flex-direction: column;
        text-align: center;
    }

    .feature__icon {
        align-self: center;
        margin-bottom: var(--spacing-sm);
    }

    .status-version {
        grid-template-columns: 1fr;
    }

    /* Fusion des styles mantra-quote pour les petits écrans */
    .mantra-quote,
    .mantra__quote blockquote {
        /* J'ai gardé les sélecteurs originaux pour la non-suppression de classes */
        font-size: 1.4rem;
    }

    .mantra-quote::before,
    .mantra-quote::after,
    .mantra__quote blockquote::before,
    .mantra__quote blockquote::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero__title-main {
        font-size: 2.5rem;
    }

    .hero__tagline {
        font-size: 1.1rem;
    }

    .btn--hero,
    .btn--lg {
        /* Fusionné avec les styles globaux en bas du fichier */
        width: 100%;
        padding: 14px 20px;
    }

    .widget,
    .feature {
        /* Fusionné les styles de padding */
        padding: var(--spacing-sm);
    }

    .modules-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
    }
}

/* =================================
    ANIMATIONS & INTERACTIONS
================================= */

/* Factorisation des hover de widget */
.widget[data-module="harmonix"]:hover {
    border-color: rgba(16, 185, 129, 0.3);
}

.widget[data-module="qrypt"]:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

.widget[data-module="atlas"]:hover {
    border-color: rgba(245, 158, 11, 0.3);
}

.widget[data-module="nino"]:hover {
    border-color: rgba(168, 85, 247, 0.3);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Loading state pour le mantra */
#mantra-text {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mantra-text:empty::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-top-color: var(--primary-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Focus states for accessibility */
.btn:focus,
.widget__action:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

/* Print styles */
@media print {

    .hero__particles,
    .btn,
    .widget__action {
        display: none;
    }

    .hero__background {
        display: none;
    }

    * {
        color: black !important;
        background: white !important;
    }
}

/* =================================
    MODULES EN AVANT
================================= */

.modules-highlight {
    margin: var(--spacing-xl) auto;
    text-align: center;
    max-width: 1200px;
}

.modules-highlight h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    background: linear-gradient(45deg, var(--primary-gold), #f4d03f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    justify-items: center;
}

.module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 260px;
    position: relative;
    overflow: hidden;
}

.module-card:hover {
    border-color: var(--primary-gold);
    background: var(--dark-card-hover);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.1);
}

.module-card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: var(--spacing-sm);
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.3));
}

.module-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    color: var(--primary-gold);
}

.module-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}