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

/* ---- GLOBAL ---- */
body {
    font-family: 'Orbitron', sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('11qT.gif') no-repeat center center/cover;
    filter: brightness(0.3);
    z-index: -1;
}

/* ---- HEADER ---- */
header.main-header {
    background: url('ban_projet-diy.jpg') no-repeat center center/cover;
    opacity: 0.9;
    text-align: center;
    padding: 3rem 2rem;
    border-bottom: 2px solid rgba(0, 204, 255, 0.3);
}

header .banner h1 {
    font-size: 3rem;
    background: linear-gradient(45deg, #ff0000, #ff4500, #ff6347);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px rgba(255, 69, 0, 0.8);
}

header nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
}

header nav ul li a {
    color: #00ccff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s, text-shadow 0.3s;
}

header nav ul li a:hover {
    color: #ffffff;
    text-shadow: 0 0 10px #00ccff;
}

/* ---- CONTENT ---- */
.tutorial-content {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.5);
    border: 1px solid rgba(0, 102, 255, 0.7);
}

.tutorial-section h1,
.tutorial-section h2,
.tutorial-section h3 {
    color: #00ccff;
    text-shadow: 0 0 5px #0066ff;
    border-bottom: 2px solid rgba(0, 102, 255, 0.5);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.tutorial-content p {
    font-size: 1.1rem;
    color: #e0e0e0;
}

/* ---- TABLES ---- */
.component-table table,
.safety-grid table,
.fmea-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: #1e1e1e;
    border-radius: 10px;
    overflow: hidden;
}

.component-table th,
.safety-grid th,
.fmea-table th {
    background: rgba(0, 102, 255, 0.7);
    color: #fff;
    padding: 1rem;
    text-align: left;
}

.component-table td,
.safety-grid td,
.fmea-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 102, 255, 0.3);
}

/* ---- FORMULAS ---- */
.formula {
    font-style: italic;
    color: #ff4500;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 69, 0, 0.1);
    border-radius: 5px;
}

/* ---- CODE BLOCKS ---- */
.code-block {
    background: #1e1e1e;
    padding: 1.5rem;
    border-radius: 10px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    box-shadow: inset 0 0 10px rgba(0, 102, 255, 0.5);
}

.code-block code {
    color: #00ccff;
}

/* ---- BUTTONS ---- */
.scroll-to-top {
    background: #00ccff;
    color: #0a0a0a;
    padding: 10px 20px;
    border: none;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

.scroll-to-top:hover {
    background: #ff4500;
}

/* ---- WARNING BANNER ---- */
.warning-banner {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid #ff0000;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 900px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    text-align: center;
}

.warning-banner h2 {
    color: #ff0000;
    font-size: 1.8rem;
    text-shadow: 0 0 10px #ff0000;
    margin-bottom: 1rem;
}

.warning-banner p {
    color: #e0e0e0;
    font-size: 1.1rem;
}

/* ---- CREDITS SECTION ---- */
#credits a {
    color: #ff4500;
    text-decoration: underline;
    transition: color 0.3s;
}

#credits a:hover {
    color: #ffffff;
    text-shadow: 0 0 10px #ff4500;
}

/* ---- FOOTER ---- */
footer {
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.9);
    color: #00ccff;
    border-top: 1px solid rgba(0, 102, 255, 0.5);
    position: relative;
}

.neon-footer {
    font-size: 1.2rem;
    font-weight: bold;
    color: #00ccff;
    animation: neonPulseEscape 5s infinite alternate ease-in-out;
}

@keyframes neonPulseEscape {
    0% {
        text-shadow: 0 0 8px #00ccff, 0 0 15px #00ffff, 0 0 20px #00ffff;
        transform: translate(0, 0);
    }
    15% {
        text-shadow: -6px 3px 12px #00ccff, 4px -5px 18px #00ffff;
        transform: translate(2px, -2px);
    }
    30% {
        text-shadow: 8px -4px 15px #00ffff, -5px 6px 20px #00ccff;
        transform: translate(-3px, 3px);
    }
    100% {
        text-shadow: 0 0 8px #00ccff, 0 0 15px #00ffff, 0 0 20px #00ffff;
        transform: translate(0, 0);
    }
}

.neon-heart {
    display: inline-block;
    animation: neonHeartPulse 1.5s infinite alternate ease-in-out;
    color: #ff0000;
}

@keyframes neonHeartPulse {
    0% {
        text-shadow: 0 0 5px #ff0000, 0 0 10px #ff4500;
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 10px #ff4500, 0 0 15px #ff6347;
        transform: scale(1.1);
    }
    100% {
        text-shadow: 0 0 5px #ff0000, 0 0 10px #ff4500;
        transform: scale(1);
    }
}

/* ---- RESPONSIVE ---- */
/* Petits écrans (mobile, < 480px) */
@media (max-width: 480px) {
    header .banner h1 {
        font-size: 1.8rem;
    }

    header .banner p {
        font-size: 0.9rem;
    }

    header nav ul {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    header nav ul li a {
        font-size: 0.9rem;
    }

    .tutorial-content {
        padding: 1rem;
        margin: 1rem;
    }

    .tutorial-section h1 {
        font-size: 1.5rem;
    }

    .tutorial-section h2 {
        font-size: 1.3rem;
    }

    .tutorial-section h3 {
        font-size: 1.1rem;
    }

    .tutorial-content p {
        font-size: 1rem;
    }

    .warning-banner {
        padding: 1rem;
        margin: 1rem;
    }

    .warning-banner h2 {
        font-size: 1.5rem;
    }

    .warning-banner p {
        font-size: 0.9rem;
    }

    .component-table table,
    .safety-grid table,
    .fmea-table table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .component-table th,
    .component-table td,
    .safety-grid th,
    .safety-grid td,
    .fmea-table th,
    .fmea-table td {
        min-width: 120px;
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .code-block {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .scroll-to-top {
        padding: 8px 15px;
        font-size: 1rem;
        bottom: 15px;
        right: 15px;
    }

    .neon-footer {
        font-size: 1rem;
    }
}

/* Tablettes (480px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    header .banner h1 {
        font-size: 2rem;
    }

    header .banner p {
        font-size: 1rem;
    }

    header nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    header nav ul li a {
        font-size: 1rem;
    }

    .tutorial-content {
        padding: 1.5rem;
        margin: 1.5rem auto;
    }

    .tutorial-section h1 {
        font-size: 1.8rem;
    }

    .tutorial-section h2 {
        font-size: 1.5rem;
    }

    .tutorial-section h3 {
        font-size: 1.2rem;
    }

    .warning-banner {
        padding: 1.2rem;
    }

    .warning-banner h2 {
        font-size: 1.6rem;
    }

    .component-table table,
    .safety-grid table,
    .fmea-table table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .component-table th,
    .component-table td,
    .safety-grid th,
    .safety-grid td,
    .fmea-table th,
    .fmea-table td {
        min-width: 150px;
    }

    .code-block {
        padding: 1.2rem;
    }

    .scroll-to-top {
        padding: 10px 18px;
    }
}

/* Écrans moyens (768px - 1024px, tablettes paysage, petits laptops) */
@media (min-width: 769px) and (max-width: 1024px) {
    header .banner h1 {
        font-size: 2.5rem;
    }

    header nav ul {
        gap: 0.8rem;
    }

    .tutorial-content {
        max-width: 800px;
        padding: 1.8rem;
    }

    .tutorial-section h1 {
        font-size: 2rem;
    }

    .tutorial-section h2 {
        font-size: 1.6rem;
    }

    .warning-banner {
        max-width: 800px;
    }
}

/* Grands écrans (> 1024px, desktops) */
@media (min-width: 1025px) {
    header .banner h1 {
        font-size: 3rem;
    }

    header nav ul {
        gap: 1.2rem;
    }

    .tutorial-content {
        max-width: 900px;
    }

    .warning-banner {
        max-width: 900px;
    }
}