/* ============================================
   JLQDeveloppement - Tutoriel PIC
   Style Global Multi-Pages
   ============================================ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a2e 50%, #0a0a0a 100%);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 0, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ============================================
   NAVIGATION PRINCIPALE
   ============================================ */
.main-nav {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.4em;
    font-weight: bold;
    background: linear-gradient(135deg, #00ffff, #7000ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-logo:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
}

.nav-links a {
    color: #00ffff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-links a:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.3);
}

.nav-links a.active {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(112, 0, 255, 0.2));
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* Menu hamburger mobile */
.hamburger {
    display: none;
    background: none;
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: #00ffff;
    font-size: 1.5em;
    line-height: 1;
}

/* Dropdown tutoriels */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    padding: 10px 0;
    min-width: 250px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 200;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px !important;
    border-radius: 0 !important;
    font-size: 0.85em !important;
}

.dropdown-menu a:hover {
    background: rgba(0, 255, 255, 0.1) !important;
}

/* ============================================
   HEADER / HERO
   ============================================ */
header, .page-header {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

h1 {
    font-size: 2.8em;
    background: linear-gradient(135deg, #00ffff, #7000ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: #00ffff;
    font-size: 1.2em;
    opacity: 0.8;
}

/* Breadcrumb */
.breadcrumb {
    padding: 15px 0;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.breadcrumb a {
    color: #00ffff;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #7000ff;
}

.breadcrumb span {
    color: #888;
    margin: 0 8px;
}

.breadcrumb .current {
    color: #d0d0d0;
}

/* ============================================
   CARDS & CONTENT
   ============================================ */
.card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

h2 {
    color: #00ffff;
    margin-bottom: 20px;
    font-size: 2em;
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
    padding-bottom: 10px;
}

h3 {
    color: #7000ff;
    margin: 20px 0 15px;
    font-size: 1.5em;
}

h4 {
    color: #00ffff;
    margin-bottom: 10px;
}

p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: #d0d0d0;
}

a {
    color: #00ffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #7000ff;
}

/* ============================================
   CODE BLOCKS
   ============================================ */
.code-block {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
    position: relative;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.code-lang {
    color: #00ffff;
    font-weight: bold;
    font-size: 0.9em;
}

.copy-btn {
    padding: 5px 15px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

pre {
    margin: 0;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.6;
}

.comment { color: #888; }
.keyword { color: #ff00ff; }
.function { color: #ffff00; }
.binary { color: #00ffff; font-weight: bold; }

/* ============================================
   TABLES
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    background: rgba(0, 255, 255, 0.1);
    color: #00ffff;
    font-weight: bold;
}

tr:hover {
    background: rgba(112, 0, 255, 0.1);
}

/* ============================================
   INFO & WARNING BOXES
   ============================================ */
.info-box {
    background: rgba(0, 255, 255, 0.05);
    border-left: 4px solid #00ffff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.warning-box {
    background: rgba(255, 165, 0, 0.05);
    border-left: 4px solid #ffa500;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.warning-box h4 {
    color: #ffa500;
    margin-bottom: 10px;
}

/* ============================================
   LED SIMULATOR
   ============================================ */
.led-simulator {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
}

.led {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 20px auto;
    background: radial-gradient(circle, #333, #111);
    border: 3px solid #555;
    transition: all 0.3s ease;
    position: relative;
}

.led.on {
    background: radial-gradient(circle, #ff0000, #aa0000);
    border-color: #ff0000;
    box-shadow: 0 0 30px #ff0000, 0 0 60px rgba(255, 0, 0, 0.5), inset 0 0 20px rgba(255, 100, 100, 0.8);
}

.led::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 25%;
    width: 30%;
    height: 30%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.led.on::after { opacity: 1; }

.control-btn {
    padding: 15px 40px;
    margin: 10px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(112, 0, 255, 0.2));
    border: 2px solid #00ffff;
    color: #00ffff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.control-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.status {
    margin-top: 20px;
    color: #00ffff;
    font-size: 1.2em;
    font-weight: bold;
}

/* Binary display */
.binary-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.bit {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #00ffff;
    transition: all 0.3s ease;
}

.bit.high {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.bit-label {
    text-align: center;
    margin-top: 5px;
    font-size: 0.8em;
    color: #888;
}

/* ============================================
   LISTS
   ============================================ */
ol {
    counter-reset: item;
    list-style-type: none;
    padding-left: 0;
}

ol li {
    counter-increment: item;
    margin-bottom: 15px;
    padding-left: 50px;
    position: relative;
    line-height: 1.8;
}

ol li::before {
    content: counter(item);
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(135deg, #00ffff, #7000ff);
    color: #000;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

ul {
    padding-left: 20px;
    margin: 15px 0;
}

ul li {
    margin-bottom: 10px;
    line-height: 1.8;
    color: #d0d0d0;
}

ul li::marker {
    color: #00ffff;
}

/* ============================================
   GRID CARDS (Homepage)
   ============================================ */
.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.tutorial-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.tutorial-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow: 0 15px 40px rgba(0, 255, 255, 0.15);
}

.tutorial-card .card-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.tutorial-card h3 {
    color: #00ffff;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.tutorial-card p {
    color: #b0b0b0;
    font-size: 0.95em;
}

.tutorial-card .card-tag {
    display: inline-block;
    background: rgba(112, 0, 255, 0.15);
    border: 1px solid rgba(112, 0, 255, 0.3);
    color: #7000ff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-top: 15px;
}

/* ============================================
   PAGE NAVIGATION (prev/next)
   ============================================ */
.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 20px;
}

.page-nav a {
    display: block;
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    flex: 1;
}

.page-nav a:hover {
    background: rgba(0, 255, 255, 0.05);
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.page-nav .prev { text-align: left; }
.page-nav .next { text-align: right; }

.page-nav .nav-label {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 5px;
}

.page-nav .nav-title {
    color: #00ffff;
    font-weight: bold;
    font-size: 1.1em;
}

/* ============================================
   CONTACT FORM
   ============================================ */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #00ffff;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.submit-btn {
    padding: 15px 50px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(112, 0, 255, 0.2));
    border: 2px solid #00ffff;
    color: #00ffff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.submit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-top: 2px solid rgba(0, 255, 255, 0.3);
    margin-top: 60px;
    padding: 40px 20px 20px;
    position: relative;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: #00ffff;
    font-size: 1.3em;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(112, 0, 255, 0.5);
    padding-bottom: 10px;
}

.footer-section p {
    color: #b0b0b0;
    line-height: 1.8;
    margin-bottom: 15px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #00ffff;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    padding-left: 20px;
}

.footer-links a::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #7000ff;
    transition: transform 0.3s ease;
}

.footer-links a:hover {
    color: #7000ff;
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00ffff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2em;
}

.social-icon:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    transform: translateY(-3px);
}

.brand-name {
    background: linear-gradient(135deg, #00ffff, #7000ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    font-size: 1.1em;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.tech-badge {
    background: rgba(112, 0, 255, 0.1);
    border: 1px solid rgba(112, 0, 255, 0.3);
    color: #7000ff;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.85em;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    color: #888;
    margin: 5px 0;
}

/* ============================================
   LEGAL PAGES
   ============================================ */
.legal-content h3 {
    margin-top: 30px;
}

.legal-content p {
    margin-bottom: 15px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    h1 { font-size: 2em; }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(15px);
        border-bottom: 2px solid rgba(0, 255, 255, 0.3);
        padding: 15px;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    .hamburger {
        display: block;
    }

    .dropdown-menu {
        position: static;
        border: none;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 5px;
        display: none;
    }

    .dropdown.open .dropdown-menu {
        display: block;
    }

    table { font-size: 0.85em; }
    th, td { padding: 10px; }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .page-nav {
        flex-direction: column;
    }

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

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .tutorial-card {
    animation: fadeIn 0.5s ease;
}
