Files
HouseHub/modules/gift-list/gift-list.css
T
2026-04-13 11:11:31 +02:00

643 lines
13 KiB
CSS

/* modules/gift-list/gift-list.css */
/* --- 1. VARIABLES & BASE --- */
:root {
--primary: #2563eb;
--bg-page: #f8fafc;
--text-main: #1e293b;
--text-muted: #64748b;
--border-light: #e2e8f0;
--radius-card: 12px;
--shadow-card: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.pf-gift-list {
background-color: var(--bg-page);
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
sans-serif;
color: var(--text-main);
font-size: 13px;
}
.pf-gift-list h1 {
font-size: 1.6rem;
font-weight: 700;
color: #0f172a;
margin: 0;
}
.cl-legend {
font-size: 0.85rem;
color: var(--text-muted);
font-style: italic;
margin-top: 4px;
}
/* --- 2. HEADER & SWITCH --- */
.cl-titlebar {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 1rem;
margin-bottom: 2rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--border-light);
}
.cl-view-switch {
display: flex;
background: white;
padding: 4px;
border-radius: 8px;
border: 1px solid #cbd5e1;
}
.cl-view-btn {
padding: 6px 16px;
border-radius: 6px;
text-decoration: none;
font-size: 0.85rem;
font-weight: 600;
color: var(--text-muted);
}
.cl-view-btn.is-active {
background: #334155;
color: white;
}
/* --- 3. BLOCS OCCASIONS & GRILLE --- */
.cl-occasion-block {
margin-bottom: 40px;
}
.cl-occasion-title {
font-size: 1.2rem;
font-weight: 700;
color: #334155;
margin-bottom: 16px;
display: flex;
align-items: center;
gap: 10px;
text-transform: uppercase;
letter-spacing: 0.05em;
border-bottom: 2px solid #e2e8f0;
padding-bottom: 8px;
}
.cl-occasion-icon {
width: 24px;
height: 24px;
object-fit: contain;
}
/* --- GRILLE INTELLIGENTE --- */
.cl-occasion-children-tables {
display: grid;
gap: 20px;
align-items: start;
}
/* VUE STANDARD (Nadal) : 3 par ligne */
.cl-view-nadal .cl-occasion-children-tables {
grid-template-columns: repeat(3, 1fr);
}
/* VUE ANNIVERSARY : Layout spécifique demandé */
.cl-view-anniversary .cl-occasion-children-tables {
grid-template-columns: repeat(6, 1fr); /* Grille de 6 colonnes */
}
/* Pol et Pep : Prennent 3 colonnes sur 6 (donc 50% de largeur => 2 par ligne) */
.cl-view-anniversary .child-pol,
.cl-view-anniversary .child-pep {
grid-column: span 3;
}
/* Les autres : Prennent 2 colonnes sur 6 (donc 33% de largeur => 3 par ligne) */
.cl-view-anniversary .child-elna,
.cl-view-anniversary .child-bru,
.cl-view-anniversary .child-guim {
grid-column: span 2;
}
/* --- 4. TABLEAU PAR ENFANT (Card Unifiée) --- */
.cl-child-table {
background: white;
box-shadow: var(--shadow-card);
border-radius: 0 0 var(--radius-card) var(--radius-card);
border: 1px solid var(--border-light);
border-top: none;
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate;
border-spacing: 0;
}
/* CAPTION (Nom de l'enfant - Haut de la carte) */
.cl-child-table caption {
caption-side: top;
display: table-caption;
padding: 10px 16px;
text-align: left;
font-weight: 700;
font-size: 1.1rem;
border-radius: var(--radius-card) var(--radius-card) 0 0;
border: 1px solid var(--border-light);
border-bottom: 2px solid;
margin-bottom: 0;
position: relative;
}
/* Bouton Ajout (+) Rotatif */
.cl-child-add-btn {
position: absolute;
right: 12px;
top: 50%;
transform: translateY(-50%);
background: rgba(255, 255, 255, 0.6);
color: inherit;
border: 1px solid rgba(0, 0, 0, 0.1);
width: 28px;
height: 28px;
border-radius: 50%;
font-size: 18px;
line-height: 1;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
z-index: 2;
}
.cl-child-add-btn:hover {
background: white;
transform: translateY(-50%) rotate(90deg) scale(1.1);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
border-color: currentColor;
}
/* --- 5. COULEURS PAR ENFANT --- */
/* POL (Bleu) */
.child-pol {
border-color: #bcd3ff;
}
.child-pol caption {
background: #eaf2ff;
color: #1e3a8a;
border-color: #bcd3ff;
border-bottom-color: #93c5fd;
}
.child-pol thead th {
background: #f5f9ff;
}
/* PEP (Vert) */
.child-pep {
border-color: #b9e3b9;
}
.child-pep caption {
background: #eaf7ea;
color: #14532d;
border-color: #b9e3b9;
border-bottom-color: #86efac;
}
.child-pep thead th {
background: #f6fdf6;
}
/* ELNA (Rose) */
.child-elna {
border-color: #f3bfd7;
}
.child-elna caption {
background: #fdeaf3;
color: #831843;
border-color: #f3bfd7;
border-bottom-color: #f9a8d4;
}
.child-elna thead th {
background: #fff5f9;
}
/* BRU (Orange) */
.child-bru {
border-color: #ffd0a8;
}
.child-bru caption {
background: #fff3e6;
color: #7c2d12;
border-color: #ffd0a8;
border-bottom-color: #fdba74;
}
.child-bru thead th {
background: #fffaf5;
}
/* GUIM (Violet) */
.child-guim {
border-color: #d3c6ff;
}
.child-guim caption {
background: #f0eaff;
color: #4c1d95;
border-color: #d3c6ff;
border-bottom-color: #c4b5fd;
}
.child-guim thead th {
background: #fbf9ff;
}
/* --- 6. CONTENU DU TABLEAU --- */
.cl-child-table thead th {
padding: 8px;
font-size: 0.75rem;
color: var(--text-muted);
font-weight: 700;
text-transform: uppercase;
border-bottom: 1px solid var(--border-light);
border-right: 1px solid var(--border-light);
white-space: normal;
overflow: hidden;
text-overflow: ellipsis;
}
.cl-child-table thead th:last-child {
border-right: none;
}
.cl-th-inner {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 2px;
}
.cl-summary-adult-total {
font-size: 0.7rem;
color: var(--primary);
background: rgba(37, 99, 235, 0.1);
padding: 1px 4px;
border-radius: 4px;
}
.cl-child-table tbody td {
padding: 8px;
vertical-align: top;
border-bottom: 1px solid #f1f5f9;
border-right: 1px solid #f1f5f9;
font-size: 0.85rem;
}
.cl-child-table tbody td:last-child {
border-right: none;
}
.cl-child-table tr:last-child td {
border-bottom: none;
}
.cl-empty {
color: #e2e8f0;
text-align: center;
display: block;
font-size: 1.2rem;
line-height: 1;
}
/* --- 7. CADEAUX & INTERACTION (Overlay) --- */
.cl-gift-item {
display: flex;
flex-direction: column;
gap: 2px;
}
.cl-gift-line {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 4px;
position: relative;
min-height: 20px;
}
.cl-gift-desc,
.cl-gift-link {
font-weight: 500;
color: #0f172a;
line-height: 1.2;
font-size: 0.85rem;
word-wrap: break-word;
word-break: break-word;
hyphens: auto;
flex: 1;
}
.cl-gift-link {
color: var(--primary);
text-decoration: none;
}
.cl-gift-link:hover {
text-decoration: underline;
}
.cl-gift-right {
display: flex;
align-items: center;
justify-content: flex-end;
width: 55px; /* Ajusté légèrement */
flex-shrink: 0;
}
/* Le Prix (Visible par défaut sur desktop) */
.cl-gift-amount {
font-size: 0.75rem;
font-weight: 700;
color: #059669;
background: #ecfdf5;
padding: 1px 4px;
border-radius: 4px;
white-space: nowrap;
transition:
opacity 0.2s,
transform 0.2s;
opacity: 1;
transform: scale(1);
}
/* Les Actions (Masquées par défaut sur desktop) */
.cl-gift-actions {
display: flex;
gap: 4px;
position: absolute;
right: 0;
top: 0;
opacity: 0;
transform: scale(0.8);
pointer-events: none;
transition:
opacity 0.2s,
transform 0.2s;
}
/* === L'EFFET SWAP (Optimisé) === */
.cl-gift-line:hover .cl-gift-amount {
opacity: 0;
transform: scale(0.8);
}
.cl-gift-line:hover .cl-gift-actions {
opacity: 1;
transform: scale(1);
pointer-events: auto;
}
/* Boutons d'action */
.cl-gift-action-btn {
background: #f1f5f9;
border: 1px solid #cbd5e1;
width: 26px; /* Légèrement agrandi pour le tactile */
height: 26px;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: #475569;
font-size: 14px;
padding: 0;
transition: all 0.2s;
}
.cl-gift-action-btn:hover {
background: white;
border-color: var(--text-main);
}
.cl-gift-delete:hover {
color: #dc2626;
border-color: #dc2626;
background: #fef2f2;
}
/* --- 8. BUDGET & TRICOUNT --- */
.pf-section--panel {
margin-bottom: 32px;
}
.pf-section--panel h2 {
font-size: 1.3rem;
margin-bottom: 16px;
border-left: 5px solid var(--primary);
padding-left: 12px;
color: var(--text-main);
background: white;
padding: 12px;
border-radius: 0 8px 8px 0;
}
.cl-budget-wrapper {
background: white;
border-radius: var(--radius-card);
box-shadow: var(--shadow-card);
border: 1px solid var(--border-light);
overflow-x: auto;
-webkit-overflow-scrolling: touch; /* Scroll fluide sur iOS */
}
.pf-table {
width: 100%;
border-collapse: collapse;
}
.pf-table th,
.pf-table td {
padding: 10px 14px;
border-bottom: 1px solid var(--border-light);
font-size: 0.9rem;
}
.pf-table th {
background: #f8fafc;
font-weight: 600;
text-align: left;
color: var(--text-muted);
}
.cl-debt-matrix td {
text-align: right;
}
.cl-mtx-owe {
color: #dc2626;
background: #fef2f2;
font-weight: 700;
}
/* Matrice Tricount - Colonne Sticky */
.cl-debt-matrix th:first-child,
.cl-debt-matrix td:first-child {
position: sticky;
left: 0;
background: #f8fafc;
z-index: 2;
border-right: 2px solid var(--border-light);
}
/* --- 9. MODALES --- */
.cl-modal {
display: none;
}
.cl-modal.cl-open {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
inset: 0;
z-index: 9999;
}
.cl-modal-backdrop {
position: absolute;
inset: 0;
background: rgba(15, 23, 42, 0.5);
backdrop-filter: blur(2px);
}
.cl-modal-dialog {
position: relative;
background: white;
width: min(450px, 90vw);
border-radius: 12px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
z-index: 10;
padding: 0;
animation: modalPop 0.2s ease-out;
}
@keyframes modalPop {
from {
transform: scale(0.95);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}
}
.cl-modal-form {
padding: 24px;
display: flex;
flex-direction: column;
gap: 12px;
}
.cl-modal-form h3 {
margin: 0 0 12px;
font-size: 1.2rem;
color: var(--text-main);
}
.clm-label {
display: flex;
flex-direction: column;
gap: 4px;
font-weight: 600;
font-size: 0.85rem;
color: #475569;
}
.clm-label input,
.clm-label select {
padding: 8px;
border: 1px solid #cbd5e1;
border-radius: 6px;
font-size: 0.95rem;
background: #f8fafc;
}
.clm-label input:focus,
.clm-label select:focus {
background: white;
border-color: var(--primary);
outline: 2px solid rgba(37, 99, 235, 0.2);
}
.cl-modal-actions {
display: flex;
justify-content: flex-end;
gap: 10px;
margin-top: 10px;
}
.clm-cancel {
background: white;
border: 1px solid #cbd5e1;
padding: 8px 16px;
border-radius: 6px;
cursor: pointer;
color: var(--text-muted);
}
.clm-ok {
background: var(--primary);
color: white;
border: none;
padding: 8px 20px;
border-radius: 6px;
cursor: pointer;
font-weight: 600;
}
/* --- 10. OPTIMISATIONS MOBILES ET TACTILES --- */
@media (hover: none) {
/* Sur écran tactile, on annule l'effet de swap */
.cl-gift-line {
flex-direction: column; /* On empile texte et prix/boutons */
align-items: flex-start;
}
.cl-gift-amount {
opacity: 1 !important;
transform: none !important;
margin-bottom: 6px;
}
.cl-gift-right {
width: 100%;
justify-content: space-between; /* Prix à gauche, boutons à droite */
margin-top: 4px;
border-top: 1px dashed var(--border-light);
padding-top: 4px;
}
.cl-gift-actions {
position: relative;
opacity: 1 !important;
transform: none !important;
pointer-events: auto !important;
}
}
@media (max-width: 1000px) {
.cl-view-nadal .cl-occasion-children-tables,
.cl-view-anniversary .cl-occasion-children-tables {
grid-template-columns: 1fr;
}
.cl-view-anniversary .child-pol,
.cl-view-anniversary .child-pep,
.cl-view-anniversary .child-elna,
.cl-view-anniversary .child-bru,
.cl-view-anniversary .child-guim {
grid-column: span 1;
}
/* Transformation des tableaux en mode "Carrousel" horizontal */
.cl-child-table {
display: block;
overflow-x: auto;
scroll-snap-type: x mandatory; /* Effet de magnétisme */
-webkit-overflow-scrolling: touch;
padding-bottom: 10px; /* Espace pour la barre de scroll */
}
.cl-child-table caption {
/* Garde le nom de l'enfant visible même en scrollant à droite */
position: sticky;
left: 0;
z-index: 5;
}
.cl-child-table th,
.cl-child-table td {
min-width: 180px; /* Plus large pour la lisibilité tactile */
scroll-snap-align: start; /* S'arrête pile sur la colonne */
}
}