/* scte-val.css - Styles modernes alignés sur courriers.css */

:root {
    --primary-color: #9b59b6;
    --primary-hover: #8e44ad;
    --primary-light: #e8daef;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3298dc;
    --background: #f8fafc;
    --background-light: #f1f5f9;
    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition-fast: 0.15s ease-out;
    --transition-base: 0.2s ease-out;
    --transition-slow: 0.3s ease-out;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background décoratif */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/family_design.png');
    background-size: cover;
    background-position: center;
    opacity: 0.06;
    pointer-events: none;
    z-index: -1;
}

/* Container principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
}

/* Header moderne */
.header-container {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    padding: 24px 32px;
    background: var(--card-background);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.header-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.12));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation par onglets */
.tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    background: var(--card-background);
    padding: 8px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    min-height: 48px;
}

.tab-btn:hover {
    background: var(--background-light);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--primary-color);
}

/* Contenu des onglets */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 4px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2::before {
    content: '';
    width: 4px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    border-radius: 2px;
}

/* Boutons modernes */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-icon {
    font-size: 1.1em;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

/* Container de table moderne */
.table-container-modern {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.table-container-modern .table {
    background: transparent;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-container-modern .table thead {
    background: var(--background-light);
}

.table-container-modern .table thead th {
    padding: 16px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table-container-modern .table tbody tr {
    transition: all var(--transition-fast);
}

.table-container-modern .table tbody tr:hover {
    background: var(--background-light);
    transform: scale(1.01);
}

.table-container-modern .table tbody td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

/* Boutons d'actions dans les tables */
.table-container-modern .button.is-small {
    padding: 6px 12px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-weight: 500;
}

.table-container-modern .button.is-small:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.table-container-modern .button.is-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: transparent;
}

.table-container-modern .button.is-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: transparent;
}

.table-container-modern .button.is-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: transparent;
}

/* Barre de recherche */
.search-container {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
}

.search-input {
    flex: 1;
    max-width: 500px;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    transition: all var(--transition-base);
    background: var(--card-background);
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.btn-secondary {
    background: var(--card-background);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--background-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Tri des colonnes */
.sortable-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
    position: relative;
    padding-right: 30px;
}

.sortable-table thead th.sortable:hover {
    background: var(--primary-light);
    color: var(--primary-hover);
}

.sortable-table thead th.no-sort {
    cursor: default;
}

.sort-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    transition: all var(--transition-fast);
    font-size: 0.8em;
}

.sortable-table thead th.sortable:hover .sort-icon {
    opacity: 0.6;
}

.sortable-table thead th.sorted-asc .sort-icon {
    opacity: 1;
    color: var(--primary-color);
}

.sortable-table thead th.sorted-desc .sort-icon {
    opacity: 1;
    color: var(--primary-color);
}

.sortable-table thead th.sorted-asc .sort-icon::before {
    content: "\f0de"; /* fa-sort-up */
}

.sortable-table thead th.sorted-desc .sort-icon::before {
    content: "\f0dd"; /* fa-sort-down */
}

/* Highlight des lignes filtrées */
.table-container-modern tbody tr.filtered-out {
    display: none;
}

.table-container-modern tbody tr.highlight {
    background: var(--primary-light) !important;
    animation: highlightFade 2s ease-out;
}

@keyframes highlightFade {
    from {
        background: var(--primary-light);
    }
    to {
        background: transparent;
    }
}

/* Largeurs de colonnes pour tables compte courant */
.table-col-inclure {
    width: 60px;
}

.table-col-pourcent {
    width: 110px;
}

.table-col-montant {
    width: 160px;
}

.table-col-obs {
    width: 220px;
}

.table-col-held {
    width: 140px;
}

.table-col-action {
    width: 50px;
}

/* Modales larges */
.modal-large {
    max-width: 980px;
    width: 95%;
}

/* Amélioration des modales Bulma */
.modal-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.modal-card-head {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-bottom: none;
    padding: 20px 24px;
}

.modal-card-title {
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-card-head .delete {
    background: rgba(255, 255, 255, 0.2);
}

.modal-card-head .delete:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-card-body {
    padding: 24px;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.modal-card-foot {
    background: var(--background-light);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    justify-content: flex-end;
    gap: 12px;
}

/* Amélioration des champs de formulaire */
.field .label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
}

.field .input,
.field .textarea,
.field .select select {
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    transition: all var(--transition-base);
    font-size: 0.95rem;
}

.field .input:focus,
.field .textarea:focus,
.field .select select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.field .help {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Badge de pourcentage */
#pctSumBadge {
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

#pctSumBadge.is-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

#pctSumBadge.is-warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: white;
}

#pctSumBadge.is-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
}

/* Messages fixes */
.message-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
    max-width: 450px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .logo {
        width: 60px;
    }

    .title {
        font-size: 1.5rem;
    }

    .tabs-container {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .table-container-modern {
        padding: 16px;
        overflow-x: auto;
    }

    .modal-card {
        width: 95%;
    }

    .message-fixed {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

/* Amélioration des tags info */
.tag.is-info.is-light {
    background: var(--primary-light);
    color: var(--primary-hover);
    font-weight: 500;
    border-radius: var(--radius-sm);
}

/* User info placement */
.header-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

/* Loader spécifique déjà défini dans general.css */
/* On s'assure juste qu'il est visible */
.famivest-loader {
    display: none;
}

.famivest-loader:not(.is-hidden) {
    display: flex;
}
/* scte-val.html modals */
#valoModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#detailsModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#ccModal.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#detailsModalCc.is-active .modal-card-foot {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}