﻿/* ===== FONTS ===== */
@font-face {
    font-family: 'TsukimiRounded';
    src: url('/assets/fonts/Tsukimi_Rounded/TsukimiRounded-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'TsukimiRounded';
    src: url('/assets/fonts/Tsukimi_Rounded/TsukimiRounded-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'TsukimiRounded';
    src: url('/assets/fonts/Tsukimi_Rounded/TsukimiRounded-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* ===== VARIABLES ===== */
:root {
    --bg: #262626;
    --bg-dark: #1a1a1a;
    --bg-card: #2d2d2d;
    --bg-card2: #333333;
    --accent: #a020f0;
    --accent-hover: #8800cc;
    --accent-light: rgba(160,32,240,0.15);
    --text: #ffffff;
    --muted: #999999;
    --border: rgba(255,255,255,0.1);
    --border-accent: rgba(160,32,240,0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 999px;
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    padding-top: 65px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ===== NAV ===== */
#mainNav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    height: 85px;
    display: flex;
    align-items: center;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.nav-logo {
    width: 40px; height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    color: #000;
    font-weight: 800;
    font-size: 0.75rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    padding: 0.4rem 0.9rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--muted);
    transition: color 0.2s;
    border-radius: var(--radius-pill);
}

.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.nav-login {
    font-size: 0.9rem;
    color: var(--muted);
    transition: color 0.2s;
}
.nav-login:hover { color: var(--text); }

.nav-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg-card2);
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s;
}
.nav-avatar:hover { border-color: var(--accent); }

/* ===== BACK LINK ===== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
    transition: color 0.2s;
    margin-bottom: 2rem;
}
.back-link:hover { color: var(--text); }

/* ===== BUTTONS ===== */
.btn-accent {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.7rem 1.8rem;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    text-align: center;
}
.btn-accent:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }

.btn-outline {
    display: inline-block;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.7rem 1.8rem;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ===== FILTER PILLS ===== */
.filter-group { margin-bottom: 1.25rem; }
.filter-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; }

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill {
    padding: 0.4rem 1.1rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}
.pill:hover { border-color: var(--accent); color: var(--text); }
.pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ===== IMAGE PLACEHOLDER ===== */
.img-placeholder {
    background: #333;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
}
.img-placeholder::before, .img-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    border: none;
}
.img-placeholder svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ===== TRACE CARDS (grid) ===== */
.traces-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) { .traces-grid { grid-template-columns: 1fr; } }

.trace-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    min-height: 420px;
    cursor: pointer;
    border: 1px solid rgba(188,33,255,0.35);
    box-shadow: 0 0 22px rgba(188,33,255,0.15), inset 0 0 22px rgba(188,33,255,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.trace-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 36px rgba(188,33,255,0.3), inset 0 0 30px rgba(188,33,255,0.12);
}

/* Image full cover */
.trace-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.trace-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay : dégradé bas + lueurs coins violettes */
.trace-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(8,8,20,0.95) 0%, rgba(8,8,20,0.55) 45%, transparent 70%),
        radial-gradient(ellipse 65% 65% at 0% 0%, rgba(188,33,255,0.28) 0%, transparent 55%),
        radial-gradient(ellipse 65% 65% at 100% 100%, rgba(188,33,255,0.28) 0%, transparent 55%);
    pointer-events: none;
    z-index: 1;
}

/* Badges en haut à droite */
.trace-card-badges {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    z-index: 2;
}

/* Contenu en bas */
.trace-card-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    z-index: 2;
}

.trace-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.trace-card-date {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.5rem;
}

.trace-card-desc {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.trace-card-footer {
    display: flex;
    justify-content: flex-end;
}

.badge-pill {
    padding: 0.25rem 0.8rem;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.75);
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
}

.badge-pill.accent {
    border-color: rgba(188,33,255,0.6);
    color: #e080ff;
    background: rgba(188,33,255,0.2);
}

/* ===== ADMIN TRACE LIST ===== */
.trace-list-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}
.trace-list-item:hover { border-color: var(--border-accent); }

.trace-list-thumb {
    width: 80px; height: 60px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.trace-list-info { flex: 1; min-width: 0; }
.trace-list-title { font-weight: 600; font-size: 0.95rem; }
.trace-list-meta { font-size: 0.78rem; color: var(--muted); }

.trace-list-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.btn-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 1rem;
}
.btn-icon:hover { opacity: 0.8; }
.btn-icon-edit { background: var(--accent); color: #fff; }
.btn-icon-delete { background: #c0392b; color: #fff; }
.btn-icon-approve { background: #27ae60; color: #fff; }
.btn-icon-reject { background: #c0392b; color: #fff; }

/* ===== TRACE DETAIL ===== */
.trace-hero {
    width: 100%;
    height: 560px;
    background: #333;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
}

.trace-hero img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.trace-tools-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: absolute;
    top: 1rem; right: 1rem;
}

.tool-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.section-label {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dropdown-ac {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    width: 100%;
    cursor: pointer;
    display: block;
    margin-bottom: 1.5rem;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.media-thumb {
    aspect-ratio: 4/3;
    background: #333;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-accent);
    overflow: hidden;
}

/* ===== COMMENTS ===== */
.comment-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.comment-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.comment-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    flex-shrink: 0;
}

.comment-name { font-weight: 600; font-size: 0.9rem; }
.comment-date { font-size: 0.75rem; color: var(--muted); }

.role-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
}
.role-evaluateur { background: var(--accent-light); color: var(--accent); border: 1px solid var(--border-accent); }
.role-concepteur { background: rgba(255,255,255,0.07); color: var(--text); border: 1px solid var(--border); }

.comment-text { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }

.comment-add-bar {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: border-color 0.2s;
}
.comment-add-bar:hover { border-color: var(--border-accent); }

.btn-add-comment {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}

/* ===== AUTH FORMS ===== */
.auth-container {
    max-width: 460px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 2.5rem;
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.1rem; }

.form-label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    width: 100%;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color 0.2s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-control:focus, .form-select:focus { border-color: var(--accent); }
.form-select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.5rem; }
.form-select option { background: var(--bg-card2); }

textarea.form-control { resize: vertical; min-height: 100px; }

/* ===== IMAGE UPLOAD ===== */
.img-upload-zone {
    width: 100%;
    aspect-ratio: 16/9;
    background: #333;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 1.25rem;
    transition: border-color 0.2s;
    position: relative;
    overflow: hidden;
}
.img-upload-zone:hover { border-color: var(--accent); }
.img-upload-zone .plus { font-size: 2rem; color: var(--muted); }
.img-upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ===== DASHBOARD ===== */
.dashboard-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 0.75rem;
}
.dashboard-btn:hover { background: var(--accent-hover); color: #fff; }

/* ===== USER CARD ===== */
.user-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.user-info { flex: 1; }
.user-name { font-weight: 600; }
.user-email { font-size: 0.8rem; color: var(--muted); }

.approve-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.7rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.approved { background: rgba(160,32,240,0.2); color: var(--accent); border: 1px solid var(--border-accent); }
.pending { background: rgba(255,200,0,0.1); color: #ffc800; border: 1px solid rgba(255,200,0,0.3); }

/* ===== CONTACT PAGE ===== */
.contact-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-accent);
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.contact-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    margin-bottom: 1rem;
    border: 1px solid;
}
.alert-err { background: rgba(192,57,43,0.15); border-color: rgba(192,57,43,0.4); color: #e74c3c; }
.alert-ok { background: var(--accent-light); border-color: var(--border-accent); color: var(--accent); }

/* ===== PAGE TITLES ===== */
.page-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2.5rem;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-dark);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: auto;
}

/* ===== WRAPPER ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.page-wrap { padding: 2.5rem 0 5rem; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== MOBILE NAV ===== */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .traces-grid { grid-template-columns: 1fr; }
}
