/* safecom.css - Page dédiée Safecom (Chat post-quantique) */

/* =========================================
   1. HERO SECTION
   ========================================= */
.safecom-hero {
    text-align: center;
    padding-top: 180px;
    padding-bottom: 80px;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out;
}

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

.hero-badge {
    display: inline-block;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    padding: 8px 18px;
    border-radius: 30px;
    margin-bottom: 30px;
    background: rgba(var(--secondary-color), 0.05);
    box-shadow: 0 0 15px rgba(var(--secondary-color), 0.1);
}

.safecom-hero h1 {
    font-family: 'Space Mono', monospace;
    font-size: 4.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.safecom-hero .hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.85;
    margin-bottom: 35px;
    line-height: 1.6;
}

.hero-tags {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-tags .tag {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.hero-tags .tag:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.2);
    transform: translateY(-2px);
}

.hero-credits {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--secondary-color);
    opacity: 0.8;
    margin-top: 25px;
    animation: fadeIn 0.8s ease-out 0.2s backwards;
}

/* =========================================
   1b. HERO SCREENSHOT
   ========================================= */
.hero-screenshot-container {
    position: relative;
    max-width: 900px;
    margin: 60px auto 0;
    perspective: 1200px;
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-screenshot-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.35) 0%, transparent 65%);
    filter: blur(50px);
    z-index: 0;
    pointer-events: none;
}

.hero-screenshot-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
    background: #111;
    display: block;
    transform: rotateX(4deg);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-screenshot-container:hover .hero-screenshot-img {
    transform: rotateX(0deg) translateY(-8px);
}

/* =========================================
   2. SECTIONS COMMUNES
   ========================================= */
.safecom-section {
    padding: 80px 10%;
    max-width: 1200px;
    margin: 0 auto;
}

.safecom-section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.safecom-section-title i {
    color: var(--accent-color);
    font-size: 1.5rem;
}

.safecom-section-title span {
    color: var(--accent-color);
}

/* =========================================
   3. ABOUT / PRÉSENTATION
   ========================================= */
.safecom-about p {
    font-size: 1.05rem;
    line-height: 1.8;
    max-width: 800px;
    opacity: 0.9;
}

.safecom-about p strong {
    color: var(--accent-color);
    font-weight: 600;
}

/* =========================================
   4. TABLEAU CRYPTO
   ========================================= */
.crypto-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--dark-bg);
}

.crypto-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.crypto-table thead {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15), rgba(var(--accent-rgb), 0.05));
}

.crypto-table th {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 16px 20px;
    text-align: left;
    color: var(--accent-color);
    border-bottom: 2px solid var(--border-color);
}

.crypto-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.crypto-table tbody tr:last-child td {
    border-bottom: none;
}

.crypto-table tbody tr:hover td {
    background: rgba(var(--accent-rgb), 0.05);
}

.crypto-table .algo-name {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.crypto-table .lib-tag {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 4px;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent-color);
    display: inline-block;
}

/* =========================================
   5. GARANTIES DE SÉCURITÉ
   ========================================= */
.guarantees-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.guarantee-card {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 28px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.guarantee-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.guarantee-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.15);
}

.guarantee-card:hover::before {
    opacity: 1;
}

.guarantee-icon {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 16px;
    display: block;
}

.guarantee-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.guarantee-card p {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.6;
}

/* =========================================
   6. PROTOCOLE (PIPELINE DIAGRAM)
   ========================================= */
.protocol-pipeline {
    position: relative;
    padding: 40px 0 20px;
}

/* Ligne horizontale de connexion (track) */
.pipeline-track {
    position: absolute;
    top: 63px;
    left: 12.5%;
    right: 12.5%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    border-radius: 2px;
    opacity: 0.5;
    z-index: 0;
}

/* Grille des étapes : toujours 4 colonnes */
.pipeline-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    position: relative;
    z-index: 1;
}

/* Chaque étape : colonne centrée */
.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

/* Cercle numéroté (node) */
.pipeline-node {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.pipeline-node:hover {
    transform: scale(1.15);
    box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.55);
}

.node-number {
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

/* Carte sous le node */
.pipeline-card {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 22px 18px;
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.pipeline-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.pipeline-step:hover .pipeline-card {
    border-color: var(--accent-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(var(--accent-rgb), 0.15);
}

.pipeline-step:hover .pipeline-card::after {
    opacity: 1;
}

.pipeline-icon {
    font-size: 1.6rem;
    color: var(--accent-color);
    margin-bottom: 12px;
    display: block;
}

.pipeline-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.pipeline-card p {
    font-size: 0.82rem;
    opacity: 0.75;
    line-height: 1.55;
}

/* =========================================
   7. STRUCTURE DU PROJET
   ========================================= */
.file-tree {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    font-family: 'Space Mono', monospace;
    font-size: 0.88rem;
    line-height: 2;
    max-width: 600px;
}

.file-tree .tree-root {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 5px;
}

.file-tree .tree-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 10px;
    transition: background 0.2s ease;
    border-radius: 4px;
    padding-right: 8px;
}

.file-tree .tree-line:hover {
    background: rgba(var(--accent-rgb), 0.05);
}

.file-tree .tree-branch {
    color: var(--border-color);
    user-select: none;
    flex-shrink: 0;
    width: 30px;
}

.file-tree .tree-icon {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.file-tree .tree-icon.file-icon {
    color: var(--secondary-color);
}

.file-tree .tree-icon.folder-icon {
    color: var(--accent-color);
}

.file-tree .tree-name {
    flex-grow: 1;
}

.file-tree .tree-desc {
    color: #666;
    font-size: 0.75rem;
    margin-left: auto;
    white-space: nowrap;
}

.dark-mode .file-tree .tree-desc {
    color: #888;
}

/* =========================================
   8. TERMINAL / CLI
   ========================================= */
.terminal-block {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.terminal-header {
    background: #161b22;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #21262d;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #8b949e;
    margin-left: 10px;
}

.terminal-body {
    padding: 20px;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.9;
    color: #c9d1d9;
    overflow-x: auto;
}

.terminal-body .prompt {
    color: #28c840;
    user-select: none;
}

.terminal-body .command {
    color: #79c0ff;
}

.terminal-body .comment {
    color: #8b949e;
}

.terminal-body .flag {
    color: #ff7b72;
}

.terminal-body .output {
    color: #c9d1d9;
    opacity: 0.8;
}

/* =========================================
   9. TESTS
   ========================================= */
.tests-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 700px;
}

.test-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.test-item:hover {
    border-color: #28c840;
    box-shadow: 0 4px 15px rgba(40, 200, 64, 0.1);
    transform: translateX(5px);
}

.test-check {
    color: #28c840;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.test-item p {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* =========================================
   10. CTA GITHUB
   ========================================= */
.safecom-cta {
    text-align: center;
    padding: 60px 10% 100px;
}

.safecom-cta .cta-text {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 25px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 35px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    background: transparent;
    transition: all 0.3s ease;
}

.github-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 25px rgba(var(--accent-rgb), 0.4);
    transform: translateY(-3px);
}

.github-btn i {
    font-size: 1.2rem;
}

/* =========================================
   11. SEPARATOR
   ========================================= */
.section-separator {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 0 10%;
    max-width: 1200px;
}

/* =========================================
   12. ANIMATIONS SCROLL REVEAL (Safecom)
   ========================================= */
.safecom-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.safecom-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   13. RESPONSIVE
   ========================================= */
@media screen and (max-width: 768px) {
    .safecom-hero {
        padding-top: 130px;
        padding-bottom: 50px;
    }

    .safecom-hero h1 {
        font-size: 2.8rem;
        letter-spacing: 1px;
    }

    .safecom-hero .hero-subtitle {
        font-size: 1.1rem;
        padding: 0 5%;
    }

    .safecom-section {
        padding: 60px 6%;
    }

    .safecom-section-title {
        font-size: 1.4rem;
    }

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

    /* Pipeline vertical sur mobile */
    .pipeline-steps {
        grid-template-columns: 1fr;
        gap: 0;
        padding-left: 40px;
    }

    .pipeline-track {
        top: 24px;
        bottom: 24px;
        left: 59px;
        right: unset;
        width: 3px;
        height: auto;
    }

    .pipeline-step {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
        gap: 18px;
    }

    .pipeline-node {
        margin-bottom: 0;
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .pipeline-card {
        margin-bottom: 16px;
    }

    .crypto-table th,
    .crypto-table td {
        padding: 10px 12px;
        font-size: 0.82rem;
    }

    .file-tree {
        font-size: 0.78rem;
        padding: 20px;
    }

    .file-tree .tree-desc {
        display: none;
    }

    .terminal-body {
        font-size: 0.75rem;
        padding: 14px;
    }

    .safecom-cta {
        padding: 40px 6% 80px;
    }
}

@media screen and (max-width: 480px) {
    .safecom-hero {
        padding-top: 130px;
        padding-bottom: 50px;
    }

    .safecom-hero h1 {
        font-size: 1.8rem;
    }

    .hero-tags .tag {
        font-size: 0.65rem;
        padding: 4px 10px;
    }
}
