/* Modern Minimalist & Game Dev Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #ff3333;
    --primary-dark: #cc0000;
    --accent-color: #00ffaa;
    --text-color: #f0f0f0;
    --text-color-muted: #888888;
    --bg-color: #050505;
    --bg-color-alt: #101010;
    --grid-color: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(15, 15, 15, 0.8);
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 9999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    opacity: 0.3;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
}

/* Navigation */
.navbar {
    background-color: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logo {
    width: 50px;
    height: auto;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

.navbar-logo:hover {
    filter: brightness(0) invert(1) drop-shadow(0 0 8px var(--primary-color));
}

.btn-launcher-navbar {
    color: var(--primary-color) !important;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: lowercase;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--primary-color);
    margin-left: 1.5rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-launcher-navbar:hover {
    background-color: var(--primary-color);
    color: #000 !important;
    box-shadow: 0 0 10px var(--primary-color);
}

.link {
    color: var(--text-color);
    font-family: var(--font-mono);
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: -0.5px;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    text-decoration: none;
    opacity: 0.7;
}

.link:hover {
    color: var(--primary-color);
    opacity: 1;
}

.link::before {
    content: '[';
    opacity: 0;
    margin-right: 4px;
    transition: all 0.2s ease;
}

.link::after {
    content: ']';
    opacity: 0;
    margin-left: 4px;
    transition: all 0.2s ease;
}

.link:hover::before, .link:hover::after {
    opacity: 1;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 80px auto 0;
    padding: 4rem 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    width: 40px;
    height: 2px;
    background: var(--primary-color);
    margin-right: 15px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 1.8rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}

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

.btn-primary:hover {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.3);
}

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

.btn-outline:hover {
    border-color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

.btn-dark {
    background-color: var(--bg-color-alt) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-color) !important;
    border-radius: 0 !important;
    font-family: var(--font-mono);
}

.btn-dark:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

/* Style du conteneur de fond */
#bg-words-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none; /* IMPORTANT : Empêche les mots de bloquer les clics sur les boutons */
    overflow: hidden;
}

/* Style des mots individuels */
.bg-word {
    position: absolute;
    color: rgba(255, 255, 255, 0.03); /* Très transparent pour faire un effet filigrane */
    font-family: monospace;
    text-transform: uppercase;
    font-weight: bold;
    white-space: nowrap;
    user-select: none; /* Empêche la sélection du texte */
    animation: floatWord linear infinite;
}

/* Style pour les fragments du logo ic.png */
.logo-fragment {
    position: absolute;
    width: 35px;           /* Taille d'un éclat */
    height: 35px;
    background-size: 250px; /* On simule une image plus grande pour varier les zones affichées */
    z-index: 0;
    pointer-events: none;
    opacity: 0.12;          /* Subtil pour ne pas gêner la lecture */
    filter: grayscale(1) brightness(1.5);
    animation: floatAndSpin linear infinite; /* Animation personnalisée */
}

@keyframes floatAndSpin {
    0% {
        transform: translateY(110vh) rotate(0deg) scale(0.8);
        opacity: 0;
    }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% {
        transform: translateY(-20vh) rotate(360deg) scale(1.1);
        opacity: 0;
    }
}

/* L'animation de flottement de bas en haut */
@keyframes floatWord {
    0% {
        transform: translateY(110vh) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20vh) scale(1.2);
        opacity: 0;
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

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

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 95%, var(--primary-color) 95%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* MUST HAVE: Prevents blocking clicks on content inside the card */
}

.card:hover::after {
    opacity: 1;
}

/* Text Colors */
.text-muted {
    color: var(--text-color-muted) !important;
}

.auth-title {
    color: var(--text-color) !important;
}

a {
    color: var(--primary-color);
    transition: all 0.2s ease;
}

a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--primary-color);
}

/* Utilities */
.mono {
    font-family: var(--font-mono);
}

/* Fix for Flash Messages text color */
.alert-custom .alert-content,
.alert-custom .alert-content * {
    color: #000 !important; /* Force black text on white flash backgrounds */
}

.alert-custom .btn-close-custom i {
    color: #000 !important;
}

/* User Nav (Home Page Bottom) */
.user-nav {
    padding: 4rem 0;
    background: var(--bg-color-alt);
    border-top: 1px solid var(--border-color);
}

.user-nav .nav-link {
    color: var(--text-color-muted) !important;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: lowercase;
    transition: all 0.2s ease;
    padding: 0.5rem 1.5rem;
    background: transparent !important;
    border: none !important;
}

.user-nav .nav-link:hover {
    color: var(--primary-color) !important;
    background: transparent !important;
}

.user-nav .nav-link::before {
    content: '> ';
    opacity: 0;
}

.user-nav .nav-link:hover::before {
    opacity: 1;
}

/* Global Overrides for White on White / Black on Black issues */
.bg-light {
    background-color: var(--bg-color-alt) !important;
}

.text-dark, 
.text-black,
h1.text-dark,
h2.text-dark,
h3.text-dark {
    color: var(--text-color) !important;
}

.text-danger,
.text-primary {
    color: var(--primary-color) !important;
}

.breadcrumb-item.active {
    color: var(--primary-color) !important;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-color-muted) !important;
}

.alert-danger {
    background-color: rgba(255, 51, 51, 0.1) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-color) !important;
}

.nav-link.text-dark {
    color: var(--text-color-muted) !important;
}

/* Global Form Styles */
input, select, textarea {
    width: 100%;
    padding: 0.8rem 1.2rem;
    margin: 0.5rem 0;
    border: 1px solid var(--border-color) !important;
    border-radius: 0 !important;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
    font-family: var(--font-mono);
    display: block; /* Ensure it takes full width and doesn't float */
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color) !important;
    outline: none !important;
    background-color: var(--bg-color-alt) !important;
    box-shadow: none !important;
}

label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    margin-bottom: 0.8rem;
    display: block;
    color: var(--primary-color) !important;
    font-weight: 400;
    text-transform: lowercase;
}

label::before { content: '[ '; }
label::after { content: ' ]'; }

/* Fix for reCAPTCHA and other third party widgets */
.g-recaptcha {
    margin: 1rem 0;
    filter: invert(1) hue-rotate(180deg); /* Adjust to dark theme */
}

/* Fix for misplaced labels/inputs */
.form-group, .mb-3 {
    position: relative;
    margin-bottom: 2rem !important;
}

/* Force visible text on dark backgrounds */
.form-text, 
.text-muted,
p.text-center,
.auth-container p,
.auth-container span {
    color: var(--text-color-muted) !important;
}

/* Ensure text-light is actually light */
.text-light {
    color: var(--text-color) !important;
}

/* Fix for legacy/specific utility classes */
.bg-black {
    background-color: var(--bg-color-alt) !important;
}

.text-black {
    color: var(--text-color) !important;
}

button.bg-black:hover, 
.btn.bg-black:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

.radius-code {
    border-radius: 0 !important;
    border: 1px solid var(--border-color);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }

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

    .container {
        padding: 1rem;
    }
}

/* End of styles */
