/* ========================================
   TIMPO - Cartes Premium + Tableau
   Version 6.2 - Compact, contrasté, responsive
   ======================================== */

/* ===== VUE CARTES PREMIUM - CONTAINER ===== */

.cards-container {
    width: 100%;
    padding: 1rem 0;
}

.cards-container h2 {
    font-size: 2rem;
    color: #4a6fa5;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

/* ===== GRILLE DES CARTES ===== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2rem;
}

/* PC large : 4 cartes par rangée, bien espacées */
@media (min-width: 1400px) {
    .cards-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 2.2rem;
    }
}

/* Tablette : 3 cartes */
@media (max-width: 992px) {
    .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

/* Mobile : 1 carte par ligne */
@media (max-width: 600px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ===== CARTE PREMIUM COMPACTE ===== */

.friend-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border: 1.5px solid rgba(0,0,0,0.12);
    transition: all 0.25s ease;
    min-height: 300px;
}

.friend-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.22);
    border-color: rgba(0,0,0,0.18);
}

/* Bandeau haut (type) */
.friend-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

/* Variantes de fond selon genre (optionnel, léger) */
.friend-card.homme {
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 60%);
}
.friend-card.femme {
    background: linear-gradient(135deg, #fce4ec 0%, #ffffff 60%);
}
.friend-card.neutre {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 60%);
}

/* États urgent / soon (bordure) */
.friend-card.urgent {
    border-color: rgba(244, 67, 54, 0.6);
}
.friend-card.soon {
    border-color: rgba(255, 152, 0, 0.5);
}

/* ===== EN-TÊTE DE CARTE ===== */

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.card-name-link {
    text-decoration: none;
    flex: 1;
}

.card-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: #2c3e50;
}

.card-name-link:hover .card-name {
    color: #667eea;
}

.card-delay {
    padding: 0.35rem 0.9rem;
    font-size: 0.95rem;
    border-radius: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.card-delay.urgent {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}
.card-delay.soon {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

/* ===== CONTENU DE LA CARTE ===== */

.card-event {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a6fa5;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 10px;
}

.card-event i {
    font-size: 1.1rem;
    color: #667eea;
}

.card-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(0,0,0,0.03);
    border-radius: 8px;
}

.card-date i {
    color: #667eea;
}

.card-particularite {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    padding: 0.75rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.card-jours {
    font-size: 1.25rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.4rem;
}

.card-part-desc {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.4rem;
}

.card-evt-date {
    font-size: 0.85rem;
    color: #6b7280;
}

/* ===== GRILLE DES BOUTONS ===== */

.card-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 1rem;
}

/* Tablette : 3 colonnes */
@media (max-width: 992px) {
    .card-buttons-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Mobile : 8 boutons en 2 rangées de 4 */
@media (max-width: 600px) {
    .card-buttons-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.5rem;
    }
}

/* Boutons compacts */

.cal-btn {
    width: 100%;
    height: 54px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 1.05rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea, #764ba2);
    position: relative;
    transition: all 0.25s ease;
    padding: 2px;
}

.cal-btn i {
    font-size: 1.1rem;
}

.cal-label {
    font-size: 0.6rem;
    margin-top: 2px;
    white-space: nowrap;
    line-height: 1;
}

.cal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* Couleurs spécifiques */

.cal-png      { background: linear-gradient(135deg, #10b981, #059669); }
.cal-pdf      { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.cal-google   { background: linear-gradient(135deg, #4285f4, #34a853); }
.cal-apple    { background: linear-gradient(135deg, #555, #000); }
.cal-outlook  { background: linear-gradient(135deg, #0078d4, #106ebe); }
.cal-email    { background: linear-gradient(135deg, #ea4335, #c5221f); }
.cal-whatsapp { background: linear-gradient(135deg, #25d366, #128c7e); }

.cal-carte-main.anniversaire-active {
    background: linear-gradient(135deg, #e8798b, #d85f73);
}

/* ===== TABLEAU MODERNE ===== */

.tableau-container {
    width: 100%;
    padding: 1rem 0;
}

.tableau-container h2 {
    font-size: 2rem;
    color: #4a6fa5;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.tableau-personnalise {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.tableau-personnalise thead {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.tableau-personnalise thead th {
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    padding: 1.25rem 1rem;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tableau-personnalise tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #e5e7eb;
}

.tableau-personnalise tbody tr:last-child {
    border-bottom: none;
}

.tableau-personnalise tbody tr:nth-child(even) {
    background: rgba(102, 126, 234, 0.03);
}

.tableau-personnalise tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.tableau-personnalise tbody td {
    padding: 1rem;
    color: #2c3e50;
    font-size: 0.95rem;
}

/* Première colonne (Délai) */
.tableau-personnalise tbody td:first-child {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
    min-width: 120px;
}

/* Colonne Ami/Prénom */
.tableau-personnalise tbody td:nth-child(2) {
    font-weight: 600;
    font-size: 1.05rem;
}

.tableau-personnalise tbody td a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tableau-personnalise tbody td a:hover {
    color: #667eea;
}

.tableau-personnalise tbody td a::before {
    content: '👤';
    font-size: 1.2rem;
}

/* Bouton calendrier dans le tableau */
.delay-calendar-button {
    display: inline-flex;
    margin-left: 0.75rem;
    vertical-align: middle;
}

.delay-calendar-button .cal-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

/* ===== RESPONSIVE TABLEAU ===== */

@media (max-width: 768px) {
    .tableau-personnalise thead th,
    .tableau-personnalise tbody td {
        padding: 0.75rem 0.6rem;
        font-size: 0.9rem;
    }

    .delay-calendar-button .cal-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* ===== PRINT ===== */

@media print {
    .card-buttons-grid,
    .delay-calendar-button,
    .cal-btn {
        display: none !important;
    }

    .friend-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .tableau-personnalise tbody tr:hover {
        transform: none;
        box-shadow: none;
    }
}
