/* ========== FONT PERSONNALISÉE ========== */
@font-face {
    font-family: 'Conthrax';
    src: url('../fonts/conthrax-SemiBold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Conthrax', 'Poppins', 'Segoe UI', sans-serif;
}

h1, h2, h3, .logo-text-below, .btn-login, .btn-register, .circuit-btn {
    font-family: 'Conthrax', 'Poppins', sans-serif;
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* Blocage total du scroll horizontal */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    background: #fff;
    color: #111;
    line-height: 1.6;
    background-image: url('../images/circuit-bg.svg');
    background-repeat: repeat;
    background-size: 60px;
    background-blend-mode: overlay;
    overflow-x: hidden;      /* redondant mais sécurisé */
    width: 100%;
}

.site-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255,255,255,0.97);
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    overflow-x: hidden;      /* bloque les débordements internes */
}

/* Empêcher tout élément de dépasser la largeur de l'écran */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* ========== LOGO CIRCULAIRE CENTRÉ ========== */
.logo-circle {
    text-align: center;
    padding: 1.5rem 0 0.5rem 0;
    background: #000;
    border-bottom: 1px solid #0af;
}
.logo-link {
    text-decoration: none;
    display: inline-block;
    transition: transform 0.1s ease;
}
.logo-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0af;
    box-shadow: 0 0 10px rgba(0,170,255,0.3);
    transition: 0.2s;
}
.logo-img:hover {
    transform: scale(1.02);
    border-color: #ffd700;
}
.logo-text-below {
    margin-top: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #0af;
    letter-spacing: 2px;
}

/* ========== HEADER ========== */
.main-header {
    background: rgba(0,0,0,0.9);
    border-bottom: 1px solid #0af;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(2px);
    transition: transform 0.3s ease-in-out;
}
.main-header.header-hidden {
    transform: translateY(-100%);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem;
    flex-wrap: wrap;
}

.burger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 2001;
}
.burger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background: #0af;
    margin: 5px 0;
    transition: 0.2s;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}
.main-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
}
.main-nav a:hover, .main-nav a.active {
    border-bottom-color: #0af;
    color: #0af;
}
.mobile-login {
    display: none;
}

.user-area {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.btn-login {
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    border: 1px solid #0af;
    color: #0af;
    background: transparent;
}
.btn-login:hover {
    background: #0af;
    color: #000;
}

.avatar-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #ffd700;
    cursor: pointer;
    object-fit: cover;
}
.avatar-dropdown {
    position: relative;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 50px;
    background: #111;
    border: 1px solid #0af;
    border-radius: 8px;
    min-width: 180px;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.avatar-dropdown.open .dropdown-menu {
    display: block;
}
.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #fff;
    text-decoration: none;
    transition: 0.1s;
}
.dropdown-menu a:hover {
    background: #0af;
    color: #000;
}
.badge {
    background: #ffd700;
    color: #000;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.7rem;
    margin-left: 5px;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    min-height: 70vh;
    padding: 2rem;
}

/* ========== FOOTER ========== */
.main-footer {
    background: #000;
    color: #fff;
    padding: 2rem;
    text-align: center;
    border-top: 2px solid #0af;
}
.footer-links {
    margin: 1rem 0;
}
.footer-links a {
    color: #0af;
    text-decoration: none;
    margin: 0 0.8rem;
    font-size: 0.9rem;
}
.footer-links a:hover {
    color: #ffd700;
}
.footer-copyright {
    font-size: 0.8rem;
    color: #777;
}

/* ========== HERO ========== */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #000, #111);
    color: #fff;
    border-radius: 20px;
    margin-bottom: 2rem;
}
.hero h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, #ffd700, #0af);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.tagline {
    font-size: 1.2rem;
    margin-top: 0.5rem;
    color: #ccc;
}

/* ========== GRILLE PROJETS ========== */
.projects-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
}
.project-card {
    background: #fff;
    border: 1px solid #0af;
    border-radius: 16px;
    padding: 1.5rem;
    width: 280px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 30px -10px rgba(0,170,255,0.3);
}
.project-card h2 {
    color: #0af;
    margin-bottom: 0.5rem;
}
.circuit-btn {
    display: inline-block;
    background: #0af;
    color: #000;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    font-weight: bold;
    text-decoration: none;
    margin-top: 1rem;
    transition: 0.2s;
}
.circuit-btn:hover {
    background: #ffd700;
    transform: scale(1.02);
}

/* ========== FORMULAIRES ========== */
.contact-page, .auth-form {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 20px;
    border: 1px solid #0af;
}
.contact-form input, .contact-form textarea, .auth-form input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
}
.contact-form button, .auth-form button {
    background: #0af;
    color: #000;
    border: none;
    padding: 0.8rem;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}
.alert {
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.alert.success { background: #d4edda; color: #155724; }
.alert.error { background: #f8d7da; color: #721c24; }

/* ========== DASHBOARD ========== */
.dashboard-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.dashboard-sidebar {
    flex: 1;
    min-width: 200px;
    background: #111;
    border-radius: 16px;
    padding: 1rem;
}
.dashboard-sidebar ul {
    list-style: none;
}
.dashboard-sidebar li a {
    display: block;
    padding: 0.8rem;
    color: #fff;
    text-decoration: none;
    border-left: 3px solid transparent;
}
.dashboard-sidebar li a.active, .dashboard-sidebar li a:hover {
    border-left-color: #0af;
    background: #1a1a1a;
    color: #0af;
}
.dashboard-content {
    flex: 3;
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #eee;
}

/* ========== MESSAGERIE ========== */
.messaging-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    height: 500px;
}
.conversations-list {
    flex: 1;
    background: #f5f5f5;
    border-radius: 12px;
    overflow-y: auto;
    padding: 1rem;
}
.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem;
    border-radius: 12px;
    text-decoration: none;
    color: #111;
    margin-bottom: 0.5rem;
}
.conversation-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.conversation-item.active {
    background: #0af;
    color: #fff;
}
.chat-area {
    flex: 3;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #ddd;
}
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}
.message {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}
.message.sent { align-items: flex-end; }
.message.received { align-items: flex-start; }
.message-text {
    max-width: 70%;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    background: #e0e0e0;
}
.message.sent .message-text { background: #0af; color: #fff; }
.message-time { font-size: 0.7rem; color: #888; margin-top: 0.2rem; }
.send-message {
    display: flex;
    padding: 0.8rem;
    gap: 0.5rem;
    border-top: 1px solid #ddd;
}
.send-message textarea {
    flex: 1;
    border-radius: 20px;
    border: 1px solid #ccc;
    padding: 0.5rem;
    resize: none;
}
.btn-send {
    background: #0af;
    border: none;
    border-radius: 50%;
    width: 40px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
}

/* ========== COOKIES ========== */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000;
    color: #fff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    z-index: 2000;
    border-top: 2px solid #0af;
}
.cookie-consent p {
    margin: 0;
}
.cookie-consent button {
    background: #0af;
    border: none;
    padding: 0.4rem 1rem;
    margin-left: 0.5rem;
    border-radius: 20px;
    cursor: pointer;
}
.cookie-consent button:hover {
    background: #ffd700;
}

/* ========== ARTICLES SPECIAUX ========== */
.feature-article {
    background: linear-gradient(145deg, #f8f8f8, #fff);
    border-left: 5px solid #0af;
    border-radius: 20px;
    margin: 3rem 0;
    padding: 0.1rem 2rem 2rem 2rem;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}
.feature-article:hover {
    transform: translateX(6px);
    box-shadow: 0 20px 30px -10px rgba(0,170,255,0.15);
}
.feature-article h2 {
    color: #0af;
    font-size: 2rem;
    border-bottom: 2px solid #ffd700;
    display: inline-block;
    margin-bottom: 1.5rem;
    padding-bottom: 0.3rem;
}
.feature-article p {
    margin-bottom: 1rem;
    line-height: 1.7;
}
.feature-article strong {
    color: #0af;
    font-weight: 700;
}
.article-quote {
    font-size: 1.3rem;
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(0,170,255,0.05);
    border-radius: 50px;
    color: #0af;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.3);
}
.vision-article {
    border-left-color: #ffd700;
}
.vision-article h2 {
    color: #ffd700;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}
.vision-article strong {
    color: #ffd700;
}
.vision-article .article-quote {
    color: #ffd700;
    background: rgba(255,215,0,0.05);
}

/* ========== PAGE ENTREPRISES ========== */
.entreprises-page {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1rem;
}
.entreprises-page h1 {
    text-align: center;
    font-size: 2.8rem;
    background: linear-gradient(135deg, #ffd700, #0af);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}
.entreprises-page .sous-titre {
    text-align: center;
    color: #0af;
    margin-bottom: 3rem;
    font-size: 1.2rem;
}
.entreprise-block {
    background: #fff;
    border-radius: 32px;
    margin-bottom: 4rem;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s forwards;
}
.entreprise-block:nth-child(2) { animation-delay: 0.1s; }
.entreprise-block:nth-child(3) { animation-delay: 0.2s; }
.entreprise-block:nth-child(4) { animation-delay: 0.3s; }
@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}
.entreprise-block:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 45px rgba(0,170,255,0.2);
}
.entreprise-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #000, #1a1a1a);
    border-bottom: 3px solid #0af;
}
.entreprise-logo {
    flex-shrink: 0;
}
.entreprise-logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffd700;
    transition: transform 0.2s;
}
.entreprise-block:hover .entreprise-logo img {
    transform: scale(1.05) rotate(2deg);
}
.entreprise-title {
    flex: 1;
}
.entreprise-title h2 {
    color: #ffd700;
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}
.btn-site {
    background: #0af;
    color: #000;
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    transition: 0.2s;
}
.btn-site:hover {
    background: #ffd700;
    transform: scale(1.02);
}
.entreprise-content {
    padding: 2rem;
    line-height: 1.7;
}
.entreprise-content p {
    margin-bottom: 1rem;
}
.entreprise-content strong {
    color: #0af;
    font-weight: 700;
}
.callout {
    background: rgba(0,170,255,0.08);
    border-left: 4px solid #0af;
    padding: 1.2rem;
    margin-top: 1.5rem;
    font-style: italic;
    border-radius: 12px;
}
hr {
    margin: 1.5rem 0;
    border-color: #0af;
}
.stats {
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(0,0,0,0.02);
    border-radius: 40px;
}
.stats strong {
    color: #ffd700;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

/* ========== FORUM ========== */
.forum-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}
.forum-page h1 {
    text-align: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #ffd700, #0af);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.forum-category {
    background: #fff;
    border: 1px solid #0af;
    border-radius: 20px;
    margin-bottom: 2rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.forum-category:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0,170,255,0.2);
}
.category-header {
    background: linear-gradient(135deg, #000, #1a1a1a);
    padding: 1rem 1.5rem;
    border-bottom: 2px solid #0af;
}
.category-header h2 {
    color: #ffd700;
    margin: 0;
    font-size: 1.6rem;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}
.category-desc {
    color: #ccc;
    font-size: 0.85rem;
}
.category-topics {
    padding: 0;
}
.topics-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.topic-item {
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 1.5rem;
    transition: background 0.2s;
}
.topic-item:hover {
    background: rgba(0,170,255,0.05);
}
.topic-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #0af;
    text-decoration: none;
}
.topic-title:hover {
    text-decoration: underline;
}
.topic-meta {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.3rem;
}
.no-topics {
    padding: 1.5rem;
    text-align: center;
    color: #888;
}
.category-actions {
    padding: 1rem 1.5rem;
    background: #f9f9f9;
    border-top: 1px solid #ddd;
    text-align: right;
}
.category-actions .circuit-btn {
    background: #0af;
    color: #000;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}
.category-actions .btn-login {
    border: 1px solid #0af;
    background: transparent;
    padding: 0.4rem 1rem;
    border-radius: 40px;
    text-decoration: none;
    color: #0af;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .burger-menu {
        display: block;
    }
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh !important;
        background: #363636 !important;
        box-shadow: -2px 0 12px rgba(0,0,0,0.5);
        transition: 0.3s;
        padding: 5rem 1.5rem 2rem 1.5rem;
        z-index: 2000;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    .main-nav.open {
        right: 0;
    }
    .main-nav ul {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        list-style: none;
        margin: 0;
        padding: 0;
        flex: 1;
    }
    .main-nav li {
        width: 100%;
    }
    .main-nav a {
        display: block;
        font-size: 1.2rem;
        color: #fff;
        text-decoration: none;
        padding: 0.6rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }
    .main-nav a:hover,
    .main-nav a.active {
        color: #0af;
        border-bottom-color: #0af;
    }
    .mobile-login {
        display: block;
        margin-top: auto;
        padding-top: 1rem;
        border-top: 1px solid #0af;
    }
    .mobile-login .btn-login-mobile {
        display: inline-block;
        background: #0af;
        color: #000;
        padding: 0.6rem 1rem;
        border-radius: 30px;
        text-align: center;
        width: 100%;
        font-weight: bold;
        text-decoration: none;
    }
    .user-area .btn-login {
        display: none;
    }
    .hero h1 { font-size: 2rem; }
    .projects-grid { flex-direction: column; align-items: center; }
    .dashboard-container { flex-direction: column; }
    .messaging-container { flex-direction: column; height: auto; }
    .conversations-list { max-height: 200px; }
    .entreprise-header { flex-direction: column; text-align: center; gap: 1rem; }
    .entreprise-content { padding: 1.2rem; }
    .entreprise-title h2 { font-size: 1.5rem; }
    .topic-item { padding: 0.8rem 1rem; }
    .topic-title { font-size: 1rem; }
    .category-actions { text-align: center; }
}