/* style.css - Version Finale (Couleurs Mises à jour) */
:root {
    --bg-dark: #0e0e10;
    --bg-card: #18181b;
    --primary: #6318f1;
    /* Nouvelle couleur principale */
    --primary-hover: #9146ff;
    /* Ancienne couleur principale devient le hover/secondaire */
    --text-main: #efeff1;
    --text-muted: #adadb8;
    --success: #00f593;
    --danger: #ff4f4d;
    --accent: #ff00e6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

a:hover {
    color: var(--primary);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #333;
    margin-bottom: 40px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    background: rgba(99, 24, 241, 0.1);
}

/* Ajusté pour la nouvelle couleur */
.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: black;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9rem;
}

.btn-large {
    font-size: 1.2rem;
    padding: 15px 40px;
}

/* Forms & Cards */
.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px;
    background: #000;
    border: 1px solid #333;
    color: white;
    border-radius: 6px;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    border: 1px solid #222;
}

/* HUD Specific */
.hud-body {
    background: transparent;
    overflow: hidden;
}

.hud-card {
    background: rgba(0, 0, 0, 0.85);
    border-left: 6px solid var(--primary);
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 0 8px 8px 0;
    animation: slideIn 0.5s ease-out;
}

/* HERO SECTION (Nouvelle Accueil) */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: radial-gradient(circle at center, #2a1a4a 0%, var(--bg-dark) 70%);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero span {
    color: var(--primary);
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 40px;
}

/* FEATURES GRID */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 60px 0;
}

.feature-item {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #333;
    transition: transform 0.2s;
}

.feature-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

/* FOOTER (Nouveau) */
.footer {
    margin-top: auto;
    border-top: 1px solid #333;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links a {
    margin-right: 20px;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

/* LEGAL TEXT */
.legal-content h1 {
    color: var(--primary);
    margin-bottom: 30px;
}

.legal-content h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.legal-content p,
.legal-content li {
    margin-bottom: 10px;
    color: #ccc;
}

/* --- TABS (Paramètres) --- */
.tabs {
    display: flex;
    border-bottom: 2px solid #333;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Switch Toggle (Bouton ON/OFF) */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    vertical-align: middle;
    margin-left: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

/* --- LOGO --- */
.logo-img {
    height: 40px;
    width: auto;
    vertical-align: middle;
    margin-right: 10px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.header>div {
    display: flex;
    align-items: center;
}

/* Correction inputs temps */
.time-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- ANIMATIONS & INTERACTIVITY --- */

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 24, 241, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(99, 24, 241, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 24, 241, 0);
    }
}

/* Base Animation Classes */
.animate-intro {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    /* Hidden by default before animation */
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.3s;
}

.delay-3 {
    animation-delay: 0.5s;
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Hover Effects Enhanced */
.feature-item {
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.feature-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px -10px rgba(99, 24, 241, 0.3);
    border-color: var(--primary);
}

.faq-card:hover {
    transform: translateX(5px);
    border-color: var(--primary);
    background: #1a1a1e;
}

/* Hero Elements */
.hero h1 {
    animation: fadeInUp 0.8s ease-out forwards;
}

.image-block div {
    animation: float 6s ease-in-out infinite;
}

.btn-primary.pulse {
    animation: pulse-glow 2s infinite;
}

/* --- PROFILE PAGE HARMONIZATION --- */

.profile-container {
    max-width: 1200px;
    /* Élargi pour desktop */
    margin: 50px auto 0;
    padding: 20px;
}

.profile-grid {
    display: grid;
    gap: 30px;
}

/* Desktop: 2 Colonnes */
@media (min-width: 1000px) {

    /* Augmenté un peu le breakpoint pour éviter l'étroit */
    .profile-grid {
        grid-template-columns: 600px 1fr;
        /* Formulaire fixe à 600px (comme avant), le reste pour les stats */
        align-items: stretch;
        /* Aligne les cartes en haut */
    }
}

/* Tabs Redesign override for profile context if needed */
.profile-tabs .tab-btn {
    flex: 1;
    text-align: center;
    border-bottom: 2px solid #333;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
}

.profile-tabs .tab-btn.active {
    background: linear-gradient(to top, rgba(99, 24, 241, 0.1), transparent);
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Challenge List Items */
.challenge-list-item {
    background: #1e1e1e;
    /* Card slightly lighter than bg */
    border: 1px solid #333;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.challenge-list-item:hover {
    transform: translateX(5px);
    border-color: #555;
    background: #252529;
}

.challenge-list-item.completed {
    opacity: 0.7;
    border-color: #222;
}

.challenge-list-item.completed:hover {
    opacity: 1;
}

.challenge-title {
    font-weight: 600;
    color: #eee;
    font-size: 1rem;
    margin-bottom: 4px;
}

.challenge-meta {
    font-size: 0.85rem;
    color: #888;
}

.amount-badge {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--success);
    background: rgba(0, 245, 147, 0.1);
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

/* Stat Badge */
.total-earnings-badge {
    display: inline-block;
    background: rgba(99, 24, 241, 0.15);
    border: 1px solid var(--primary);
    color: white;
    /* Plus lisible que le vert sur fond sombre */
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(99, 24, 241, 0.1);
}

.total-earnings-amount {
    color: var(--primary);
    font-size: 1.2rem;
    margin-left: 5px;
}

/* --- FORM COMPONENTS RESTORED --- */
.alert-success {
    background: var(--success);
    color: black;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

/* Timer Inputs Styling */
.time-input-group {
    display: flex;
    gap: 5px;
    justify-content: space-between;
    margin-bottom: 15px;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.time-unit input {
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    background: #2a2a2e;
    border: 1px solid #444;
    padding: 8px 0;
    width: 100%;
    border-radius: 4px;
    color: white;
    -moz-appearance: textfield;
    appearance: textfield;
    transition: 0.2s;
}

.time-unit input:focus {
    border-color: var(--primary);
    outline: none;
    background: #333;
}

.time-unit input.error {
    border-color: #ff4f4d;
    box-shadow: 0 0 5px rgba(255, 79, 77, 0.5);
}

.time-unit input::-webkit-outer-spin-button,
.time-unit input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.time-unit label {
    font-size: 0.7rem;
    color: #888;
    margin-top: 4px;
    text-transform: uppercase;
    font-weight: 600;
}