/* Conducteur Les Sondiers — Dark theme with orange #e15500 accent */

:root {
    --sondiers-orange: #e15500;
    --sondiers-orange-light: #ff7a2e;
    --sondiers-orange-dim: #b34400;
    --sondiers-bg: #1a1a1a;
    --sondiers-surface: #242424;
    --sondiers-surface-hover: #2e2e2e;
    --sondiers-border: #3a3a3a;
    --sondiers-text: #e0e0e0;
    --sondiers-text-muted: #888;
    --sondiers-success: #4caf50;
    --sondiers-error: #f44336;
    --sondiers-warning: #ff9800;
}

[data-theme="dark"] {
    --pico-primary: var(--sondiers-orange);
    --pico-primary-hover: var(--sondiers-orange-light);
    --pico-primary-focus: rgba(225, 85, 0, 0.25);
    --pico-primary-inverse: #fff;
}

body {
    background: var(--sondiers-bg);
    color: var(--sondiers-text);
}

.orange { color: var(--sondiers-orange); }
.text-muted { color: var(--sondiers-text-muted); }

/* ─── Header ──────────────────────────────────────────────────── */

header.container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--sondiers-orange);
    margin-bottom: 2rem;
}

header .logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--sondiers-orange);
    text-decoration: none;
}

header nav {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

header nav a {
    color: var(--sondiers-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

header nav a:hover { color: var(--sondiers-orange); }

.user-badge {
    background: var(--sondiers-surface);
    color: var(--sondiers-orange);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ─── Buttons ─────────────────────────────────────────────────── */

button.btn-sm, a.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

.btn-save {
    background: var(--sondiers-orange);
    color: #fff;
    border: none;
}

.btn-save:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-save.has-changes {
    animation: pulse-orange 1.5s ease-in-out infinite;
}

@keyframes pulse-orange {
    0%, 100% { box-shadow: 0 0 0 0 rgba(225, 85, 0, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(225, 85, 0, 0); }
}

/* ─── Login ───────────────────────────────────────────────────── */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    max-width: 380px;
    width: 100%;
    padding: 2rem;
    background: var(--sondiers-surface);
    border-radius: 8px;
    border: 1px solid var(--sondiers-border);
}

.login-card hgroup h2 { margin-bottom: 0.3rem; }
.login-card hgroup p { color: var(--sondiers-text-muted); }

.error-msg {
    color: var(--sondiers-error);
    background: rgba(244, 67, 54, 0.1);
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* ─── Dashboard ───────────────────────────────────────────────── */

.conducteur-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.conducteur-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--sondiers-surface);
    border: 1px solid var(--sondiers-border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--sondiers-text);
    transition: border-color 0.2s;
}

.conducteur-card:hover {
    border-color: var(--sondiers-orange);
}

.card-numero {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--sondiers-orange);
    min-width: 60px;
}

.card-details { flex: 1; }
.card-dates { font-size: 0.95rem; }
.card-meta { font-size: 0.8rem; margin-top: 0.2rem; }
.card-arrow { color: var(--sondiers-text-muted); font-size: 1.2rem; }

/* ─── Conducteur toolbar ──────────────────────────────────────── */

.back-link {
    color: var(--sondiers-text-muted);
    text-decoration: none;
    margin-right: 0.5rem;
}

.back-link:hover { color: var(--sondiers-orange); }

.conducteur-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--sondiers-border);
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.stat-sujets {
    color: var(--sondiers-text-muted);
    font-size: 0.9rem;
}

.save-status {
    font-size: 0.8rem;
}

.save-status.unsaved { color: var(--sondiers-warning); }
.save-status.saved { color: var(--sondiers-success); }

/* ─── Entries ─────────────────────────────────────────────────── */

.conducteur-entries {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.conducteur-entry {
    background: var(--sondiers-surface);
    border: 1px solid var(--sondiers-border);
    border-left: 3px solid var(--sondiers-orange-dim);
    border-radius: 6px;
    padding: 0.8rem 1rem;
}

.conducteur-entry.prio { border-left-color: var(--sondiers-error); }

.conducteur-entry.traite {
    opacity: 0.45;
    border-left-color: var(--sondiers-border);
}

.conducteur-entry.traite .entry-title-block h3 {
    text-decoration: line-through;
    color: var(--sondiers-text-muted);
}

/* Checkbox traite */
.checkbox-traite {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-traite input {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--sondiers-orange);
    cursor: pointer;
}

.entry-header {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.entry-num {
    background: var(--sondiers-orange);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.entry-title-block { flex: 1; }

.entry-title-block h3 {
    font-size: 1rem;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.badge-prio {
    background: var(--sondiers-error);
    color: #fff;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.toggle-icon {
    font-size: 0.7rem;
    color: var(--sondiers-text-muted);
    margin-left: 0.3rem;
    transition: transform 0.2s;
}

.conducteur-entry.collapsed .toggle-icon { transform: rotate(-90deg); }

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.3rem;
    font-size: 0.8rem;
}

.entry-score {
    color: var(--sondiers-orange);
    font-weight: 600;
}

.entry-prix, .entry-dispo {
    color: var(--sondiers-text-muted);
}

.entry-cat {
    background: var(--sondiers-surface-hover);
    color: var(--sondiers-text-muted);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

.entry-body {
    margin-top: 0.6rem;
    padding-left: 2.2rem;
}

.conducteur-entry.collapsed .entry-body { display: none; }
.conducteur-entry.collapsed .entry-meta { display: none; }

.entry-pitch {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.entry-specs {
    font-size: 0.85rem;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
}

.entry-specs li { margin-bottom: 0.2rem; }

.entry-angle {
    font-size: 0.85rem;
    color: var(--sondiers-orange-light);
    margin-bottom: 0.5rem;
}

/* Links */

.entry-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.link-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--sondiers-surface-hover);
    border: 1px solid var(--sondiers-border);
    border-radius: 4px;
    color: var(--sondiers-orange-light);
    font-size: 0.8rem;
    text-decoration: none;
    transition: border-color 0.2s;
}

.link-tag:hover {
    border-color: var(--sondiers-orange);
    color: var(--sondiers-orange);
}

.link-tag.extra { color: var(--sondiers-text-muted); }
.link-tag.extra:hover { color: var(--sondiers-orange-light); }

.entry-sources {
    font-size: 0.8rem;
    color: var(--sondiers-text-muted);
    margin-bottom: 0.6rem;
}

.entry-sources a {
    color: var(--sondiers-text-muted);
    text-decoration: underline;
}

.entry-sources a:hover { color: var(--sondiers-orange-light); }

/* Drag */

.drag-handle {
    cursor: grab;
    font-size: 1rem;
    color: var(--sondiers-text-muted);
    opacity: 0.5;
    padding: 0.2rem;
    margin-top: 2px;
}

.drag-handle:hover { opacity: 1; color: var(--sondiers-orange-light); }
.drag-handle:active { cursor: grabbing; }

/* Delete button */

.btn-delete-entry {
    background: none;
    border: none;
    color: var(--sondiers-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.3rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.conducteur-entry:hover .btn-delete-entry { opacity: 0.6; }
.btn-delete-entry:hover { color: var(--sondiers-error); opacity: 1; }

/* ─── Reactions ───────────────────────────────────────────────── */

.reactions-section {
    margin: 0.6rem 0;
}

.reactions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.reaction-form { display: inline; }

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: var(--sondiers-surface-hover);
    border: 1px solid var(--sondiers-border);
    border-radius: 20px;
    color: var(--sondiers-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.reaction-btn:hover {
    border-color: var(--sondiers-orange);
    color: var(--sondiers-text);
}

.reaction-btn.active {
    background: rgba(225, 85, 0, 0.15);
    border-color: var(--sondiers-orange);
    color: var(--sondiers-orange);
}

.reaction-users {
    background: var(--sondiers-surface);
    padding: 0.1rem 0.3rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ─── Comments ────────────────────────────────────────────────── */

.comments-section {
    margin-top: 0.5rem;
    border-top: 1px solid var(--sondiers-border);
    padding-top: 0.5rem;
}

.comments-list {
    margin-bottom: 0.5rem;
}

.comment {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(58, 58, 58, 0.4);
}

.comment:last-child { border-bottom: none; }

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.comment-header strong {
    color: var(--sondiers-orange-light);
}

.comment-time {
    color: var(--sondiers-text-muted);
    font-size: 0.75rem;
}

.comment-delete {
    background: none;
    border: none;
    color: var(--sondiers-text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 0.3rem;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s;
}

.comment:hover .comment-delete { opacity: 0.6; }
.comment-delete:hover { color: var(--sondiers-error); opacity: 1; }

.comment p {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
}

.comment-form {
    margin-top: 0.3rem;
}

.comment-input-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.comment-input-row button {
    width: auto;
    margin: 0;
}

.comment-input {
    flex: 1;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    background: var(--sondiers-bg);
    border: 1px solid var(--sondiers-border);
    border-radius: 4px;
    color: var(--sondiers-text);
    margin: 0;
}

.comment-input:focus {
    border-color: var(--sondiers-orange);
    outline: none;
}

/* ─── Toast ───────────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #fff;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    pointer-events: none;
    z-index: 1000;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast.ok { background: var(--sondiers-success); }
.toast.err { background: var(--sondiers-error); }

/* ─── Responsive ──────────────────────────────────────────────── */

@media (max-width: 600px) {
    .entry-body { padding-left: 0.5rem; }
    .conducteur-toolbar { flex-direction: column; gap: 0.5rem; }
    .reactions-bar { gap: 0.3rem; }
}
