/* ============================================
   Conjugaison - Styles de l'application enseignant
   ============================================ */

/* Layout principal */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--white);
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.4rem;
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-weight: 500;
    color: var(--text);
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius-small);
    color: var(--text-light);
    transition: background 0.2s, color 0.2s;
}

.btn-icon:hover {
    background: var(--background);
    color: var(--text);
}

/* Navigation par niveau */
.niveau-nav {
    display: flex;
    gap: 10px;
    padding: 20px 25px;
    background: var(--white);
    border-bottom: 1px solid #eee;
    overflow-x: auto;
}

.niveau-btn {
    padding: 10px 20px;
    border: 2px solid var(--primary);
    border-radius: 25px;
    background: transparent;
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.niveau-btn:hover {
    background: var(--primary);
    color: var(--text);
}

.niveau-btn.active {
    background: var(--primary);
    color: var(--text);
}

/* Barre d'outils */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--background);
    flex-wrap: wrap;
    gap: 15px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Recherche */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    color: #999;
    pointer-events: none;
}

.search-input {
    padding: 10px 12px 10px 34px;
    border: 1px solid #ddd;
    border-radius: var(--radius-small);
    font-size: 0.9rem;
    width: 220px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Filtres */
.filters-wrapper {
    position: relative;
}

.btn-toggle-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    transition: all 0.2s;
}

.btn-toggle-filters:hover {
    background: var(--background);
    border-color: var(--primary);
}

.filters-count {
    background: var(--primary);
    color: var(--text);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.filters-count:empty {
    display: none;
}

/* Overlay pour filtres */
.filters-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

.filters-overlay.open {
    display: block;
}

/* Panel filtres - style modal centre (desktop) */
.filters {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 200;
    flex-direction: column;
    gap: 20px;
    min-width: 350px;
    max-width: 450px;
}

.filters.open {
    display: flex;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
}

.filters-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.btn-close-filters {
    background: transparent;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: var(--text-light);
    border-radius: var(--radius-small);
    transition: all 0.2s;
}

.btn-close-filters:hover {
    background: var(--background);
    color: var(--text);
}

.filters-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.btn-reset-filters {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.btn-reset-filters:hover {
    color: var(--error);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.filter-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius-small);
    background: var(--background);
    color: var(--text);
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
}

.filters-actions .btn-action {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
}

/* Toggle mode d'affichage */
.mode-toggle {
    display: flex;
    background: var(--white);
    border-radius: 25px;
    padding: 4px;
    box-shadow: 0 1px 3px var(--shadow);
}

.mode-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-light);
    transition: all 0.2s;
}

.mode-btn:hover {
    color: var(--text);
}

.mode-btn.active {
    background: var(--primary);
    color: var(--text);
}

/* Bouton creer */
.btn-create {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: var(--text);
    border: none;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-create:hover {
    background: var(--primary-dark);
}

/* Zone principale */
.main-content {
    flex: 1;
    padding: 25px;
    padding-bottom: 60px;
}

/* Separateur entre groupes d'activites */
.activites-groupe + .activites-groupe {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

/* Groupes d'activites */
.activites-group {
    margin-bottom: 30px;
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.group-title {
    font-size: 1.2rem;
    color: var(--text);
    font-weight: 600;
}

.group-count {
    background: var(--primary);
    color: var(--text);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
}

/* Grille d'activites */
.activites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Carte d'activite */
.activite-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.activite-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px var(--shadow);
}

.activite-card.highlight {
    animation: highlightCard 2s ease-out;
}

@keyframes highlightCard {
    0% {
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.6);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 2px 8px var(--shadow);
        transform: scale(1);
    }
}

.activite-card.prototype {
    border-left: 4px solid var(--primary);
}

.activite-card.personal {
    border-left: 4px solid var(--primary-dark);
}

.activite-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.activite-titre {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activite-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 500;
}

.badge-prototype {
    background: #E3F2FD;
    color: #1565C0;
}

.badge-brouillon {
    background: #FFF3E0;
    color: #E65100;
}

.badge-publie {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-shared {
    background: #F3E5F5;
    color: #6A1B9A;
}

.badge-private {
    background: #ECEFF1;
    color: #607D8B;
}

/* Bouton de visibilite cliquable */
.btn-visibility {
    cursor: pointer;
    border: none;
    transition: background 0.2s, color 0.2s;
    font-size: 0.75rem;
    padding: 3px 8px;
    line-height: 1;
    vertical-align: middle;
    min-width: 60px;
    text-align: center;
}

.btn-visibility.badge-private:hover {
    background: #F3E5F5;
    color: #6A1B9A;
}

.btn-visibility.badge-shared:hover {
    background: #ECEFF1;
    color: #607D8B;
}

/* Bouton de statut cliquable */
.btn-statut {
    cursor: pointer;
    border: none;
    outline: none;
    transition: background 0.2s, color 0.2s;
    font-size: 0.75rem;
    font-family: inherit;
    padding: 3px 8px;
    border-radius: 10px;
    text-align: center;
}

.btn-statut.badge-brouillon:hover {
    background: #FFE0B2;
    color: #BF360C;
}

.btn-statut.badge-publie:hover {
    background: #C8E6C9;
    color: #1B5E20;
}

.activite-badges {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    align-items: center;
    flex-shrink: 0;
}

.activite-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.meta-tag {
    font-size: 0.8rem;
    color: var(--text-light);
    background: var(--background);
    padding: 3px 10px;
    border-radius: 15px;
}

.activite-date {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 10px;
}

.activite-objectif {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text);
    line-height: 1.4;
}

.activite-consigne {
    font-size: 0.85rem;
    margin-bottom: 15px;
    color: var(--text-light);
    font-style: italic;
    line-height: 1.4;
}

.activite-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
    flex: 1;
}

.activite-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.btn-action {
    flex: 1 1 auto;
    min-width: fit-content;
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: var(--white);
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-action:hover {
    background: var(--background);
    border-color: var(--primary);
}

.btn-action.primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-action.primary:hover {
    background: var(--primary-dark);
}

.btn-action.danger {
    color: var(--error);
    border-color: var(--error);
}

.btn-action.danger:hover {
    background: var(--error-bg);
}

/* Icones Lucide dans les btn-action */
.btn-action i[data-lucide],
.btn-action svg {
    width: 14px;
    height: 14px;
    stroke-width: 1.75;
    vertical-align: -2px;
}

/* Etat vide */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--text-light);
    line-height: 1;
}
.empty-state-icon i[data-lucide],
.empty-state-icon svg {
    width: 56px;
    height: 56px;
    stroke-width: 1.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text);
}

.empty-state p {
    margin-bottom: 20px;
}

/* Loading */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--background);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tabs pour mes activites / prototypes */
.content-tabs {
    display: flex;
    gap: 5px;
    background: var(--white);
    padding: 5px;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px var(--shadow);
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: var(--radius-small);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--text);
}

/* Responsive - Tablettes */
@media (max-width: 1024px) {
    .toolbar-left {
        flex-wrap: wrap;
        gap: 10px;
    }

    .mode-toggle {
        order: 3;
        width: 100%;
        justify-content: center;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .niveau-nav {
        padding: 15px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        justify-content: center;
        flex-wrap: wrap;
    }

    .search-input {
        width: 100%;
    }

    /* Filtres responsive - bottom sheet sur mobile */
    .filters-wrapper {
        position: static;
        width: 100%;
    }

    .btn-toggle-filters {
        width: 100%;
        justify-content: center;
    }

    .filters {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        min-width: auto;
        max-width: none;
        padding: 20px;
        padding-bottom: 30px;
        border-radius: var(--radius) var(--radius) 0 0;
        box-shadow: 0 -4px 20px var(--shadow);
        max-height: 70vh;
        overflow-y: auto;
    }

    .filter-label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    .filter-select {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }

    .filters-actions .btn-action {
        padding: 14px;
        font-size: 1rem;
    }

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

    .main-content {
        padding: 15px;
    }

    .activite-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .btn-action {
        flex: 1 1 auto;
        min-width: fit-content;
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

/* ============================================
   Toast notification
   ============================================ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Bouton partage emoji */
.btn-action[data-action="share"] {
    min-width: auto;
    padding: 8px 12px;
}
