/* ─── EUROFUNDING — Welcomeurope Light Theme ─────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --navy: #0a1f44;
    --navy-light: #1a3a6b;
    --cyan: #00b4d8;
    --cyan-hover: #0096b7;
    --cyan-light: #e8f7fa;
    --bg: #f5f7fa;
    --bg-white: #ffffff;
    --border: #e2e8f0;
    --border-light: #f0f2f5;
    --text: #1a2332;
    --text-secondary: #5a6577;
    --text-muted: #94a3b8;
    --red: #ef4444;
    --red-bg: #fef2f2;
    --orange: #f59e0b;
    --orange-bg: #fffbeb;
    --green: #10b981;
    --green-bg: #ecfdf5;
    --purple: #8b5cf6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ─── Top Bar ────────────────────────────────────────────────────────── */

.top-bar {
    background: var(--navy);
    color: white;
    padding: 8px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.top-bar a {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 600;
}

.top-bar a:hover {
    text-decoration: underline;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    color: rgba(255,255,255,0.7);
}

/* ─── Header ─────────────────────────────────────────────────────────── */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--navy);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.logo span {
    color: var(--cyan);
    font-weight: 400;
}

.stat-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text-secondary);
}

.stat-badge:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.stat-badge.active {
    background: var(--cyan);
    border-color: var(--cyan);
    color: white;
}

.stat-badge .count {
    background: rgba(0,0,0,0.08);
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
}

.stat-badge.active .count {
    background: rgba(255,255,255,0.25);
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.derniere-veille {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ─── Boutons ────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: var(--cyan-light);
}

.btn-primary {
    background: var(--cyan);
    border-color: var(--cyan);
    color: white;
}

.btn-primary:hover {
    background: var(--cyan-hover);
    border-color: var(--cyan-hover);
    color: white;
}

.btn-navy {
    background: var(--navy);
    border-color: var(--navy);
    color: white;
}

.btn-navy:hover {
    background: var(--navy-light);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.78rem;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ─── Filtres ────────────────────────────────────────────────────────── */

.filters-bar {
    padding: 16px 32px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
}

.filters-bar-left {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    flex-wrap: wrap;
}

.filters-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.result-count {
    font-weight: 700;
    color: var(--text);
    font-size: 0.95rem;
}

.search-input {
    flex: 1;
    min-width: 240px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--cyan);
    background: var(--bg-white);
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
    min-width: 170px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--cyan);
}

/* ─── Contenu principal ──────────────────────────────────────────────── */

.main-content {
    padding: 24px 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.appels-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ─── Cards ──────────────────────────────────────────────────────────── */

.appel-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 28px;
    transition: all 0.2s;
    position: relative;
}

.appel-card:hover {
    border-color: var(--cyan);
    box-shadow: 0 4px 16px rgba(0, 180, 216, 0.08);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
    cursor: pointer;
    line-height: 1.4;
    flex: 1;
}

.card-title:hover {
    color: var(--cyan);
}

.card-reference {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cyan);
    background: var(--cyan-light);
    padding: 3px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.card-meta {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 16px;
    border-right: 1px solid var(--border);
}

.card-meta-item:first-child {
    padding-left: 0;
}

.card-meta-item:last-child {
    border-right: none;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
}

.tag-pilier {
    color: var(--purple);
    background: rgba(139, 92, 246, 0.08);
}

.tag-cluster {
    color: var(--cyan);
    background: var(--cyan-light);
}

.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.card-comment {
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

/* ─── Badges urgence ─────────────────────────────────────────────────── */

.badge-urgence {
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-urgence.rouge {
    background: var(--red-bg);
    color: var(--red);
}

.badge-urgence.orange {
    background: var(--orange-bg);
    color: var(--orange);
}

.badge-urgence.vert {
    background: var(--green-bg);
    color: var(--green);
}

.badge-urgence.futur {
    background: var(--bg);
    color: var(--text-muted);
}

/* ─── Select statut ──────────────────────────────────────────────────── */

.statut-select {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s;
}

.statut-select:focus {
    outline: none;
    border-color: var(--cyan);
}

/* ─── Bouton Consulter (style Welcomeurope) ──────────────────────────── */

.btn-consulter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--cyan);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-consulter:hover {
    background: var(--cyan-hover);
    transform: translateY(-1px);
}

/* ─── Modale ─────────────────────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 31, 68, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(10, 31, 68, 0.2);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--navy);
}

.modal-field {
    margin-bottom: 16px;
}

.modal-field label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-copy {
    background: var(--cyan-light);
    color: var(--cyan);
    border: 1px solid var(--cyan);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-copy:hover {
    background: var(--cyan);
    color: white;
}

.btn-fiche-ok {
    background: var(--green-bg) !important;
    color: var(--green) !important;
    border-color: var(--green) !important;
    font-weight: 600;
}

.btn-fiche-ok:hover {
    background: var(--green) !important;
    color: white !important;
}

.modal-field textarea,
.modal-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.modal-field textarea {
    min-height: 100px;
}

.modal-field textarea:focus,
.modal-field input:focus {
    outline: none;
    border-color: var(--cyan);
}

.modal-field a {
    color: var(--cyan);
    word-break: break-all;
    font-weight: 500;
}

.modal-field a:hover {
    text-decoration: underline;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ─── Toast ──────────────────────────────────────────────────────────── */

.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    min-width: 280px;
    box-shadow: 0 8px 24px rgba(10, 31, 68, 0.15);
}

.toast-success {
    background: var(--green-bg);
    border: 1px solid var(--green);
    color: var(--green);
}

.toast-error {
    background: var(--red-bg);
    border: 1px solid var(--red);
    color: var(--red);
}

.toast-info {
    background: var(--cyan-light);
    border: 1px solid var(--cyan);
    color: var(--cyan-hover);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── Loading ────────────────────────────────────────────────────────── */

.loading {
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Empty state ────────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

/* ─── Topics count ───────────────────────────────────────────────────── */

.topics-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: help;
}

/* ─── Bouton flottant reporting ──────────────────────────────────────── */

.fab-report {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--cyan);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 180, 216, 0.35);
    z-index: 150;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-report:hover {
    background: var(--cyan-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 180, 216, 0.45);
}

/* ─── Fab menu ──────────────────────────────────────────────────────── */

.fab-menu {
    display: none;
    position: fixed;
    bottom: 92px;
    right: 28px;
    z-index: 150;
    flex-direction: column;
    gap: 6px;
}

.fab-menu.active {
    display: flex;
}

.fab-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(10, 31, 68, 0.1);
    transition: all 0.15s;
    text-decoration: none;
    font-family: inherit;
}

.fab-menu-item:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: var(--cyan-light);
}

.fab-menu-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* ─── Drop zone screenshot ──────────────────────────────────────────── */

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--cyan);
    background: var(--cyan-light);
}

.drop-zone-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.screenshot-preview {
    position: relative;
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.screenshot-preview img {
    display: block;
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    background: var(--bg);
}

.screenshot-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--red);
    color: white;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .top-bar {
        display: none;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
    }

    .header-left {
        flex-direction: column;
        gap: 12px;
    }

    .filters-bar {
        flex-direction: column;
        padding: 12px 16px;
    }

    .main-content {
        padding: 16px;
    }

    .appel-card {
        padding: 16px;
    }

    .card-header {
        flex-direction: column;
    }

    .card-meta {
        flex-direction: column;
        gap: 4px;
    }

    .card-meta-item {
        border-right: none;
        padding: 0;
    }

    .card-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
