/* Primary button */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    color: var(--primary-foreground);
    font-weight: 600;
    border: none;
    border-radius: 0 0 var(--radius-button) 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Secondary button */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--muted);
    color: var(--foreground);
    font-weight: 600;
    border: none;
    border-radius: 0 0 0 var(--radius-button);
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-secondary:hover {
    opacity: 0.8;
}

/* Brand utility classes */
.bg-brand {
    background-color: var(--color-brand);
}

.bg-brand-dark {
    background-color: var(--color-brand-dark);
}

.bg-brand-light {
    background-color: var(--color-brand-bg);
}

.text-brand {
    color: var(--color-brand);
}

.border-brand {
    border-color: var(--color-brand);
}

.btn-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: 2px solid var(--color-brand);
    color: var(--color-brand);
    padding: 0.5rem 1.5rem;
    border-radius: 0 0 var(--radius-button) 0;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.btn-brand:hover {
    background-color: var(--color-brand);
    color: white;
}

/* Nav underline effect */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--color-brand);
    transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--color-brand);
}

/* Action card hover effects */
.action-card:hover .action-circle {
    transform: scale(1.05);
    background-color: var(--color-brand);
}

.action-card:hover .action-icon {
    color: white;
}

/* News section title underline */
.section-title-underline {
    position: relative;
    padding-bottom: 1rem;
}

.section-title-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background-color: var(--color-brand);
}

/* Hero gradient overlay */
.hero-gradient {
    background: linear-gradient(90deg, rgba(20, 90, 142, 0.85) 0%, rgba(43, 43, 43, 0.6) 100%);
}

/* Welcome section gradient */
.welcome-gradient {
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-dark) 100%);
}

/* Data table theme */
.data-table thead {
    background-color: var(--color-brand-bg);
}

/* Category breadcrumb */
.breadcrumb-link {
    background: none;
    border: none;
    color: var(--color-accent-blue);
    font-weight: 600;
    font-size: inherit;
    cursor: pointer;
    padding: 0;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-link.breadcrumb-current {
    cursor: default;
    color: var(--color-text-dark);
}

.breadcrumb-link.breadcrumb-current:hover {
    text-decoration: none;
}

.breadcrumb-separator {
    color: var(--color-text-light);
}

/* Category bubbles */
.category-bubble {
    display: inline-block;
    border: 1px solid var(--color-text-dark);
    border-radius: 25px;
    padding: 0.4rem 1.2rem;
    background: transparent;
    color: var(--color-text-dark);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-align: left;
}

.category-bubble:hover {
    border-color: var(--color-brand);
    color: var(--color-brand);
}

.category-bubble.selected {
    border-color: var(--color-brand);
    background-color: var(--color-brand);
    color: white;
}

/* Filtres liste des alertes : aligne les champs ux-autocomplete (Tom Select)
   sur l'apparence des <select> natifs de la barre de filtres. */
.alert-filters select {
    min-width: 13rem;
}

.alert-filters .ts-wrapper {
    width: auto;
    min-width: 13rem;
    margin: 0;
}

.alert-filters .ts-control {
    min-height: 2.5rem;
    border: 1px solid var(--color-border);
    border-radius: 0.25rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    background-color: #fff;
    box-shadow: none;
}

.alert-filters .ts-wrapper.focus .ts-control {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 2px var(--color-brand);
}

/* =====================================================================
   Infobulles personnalisées (controller Stimulus « tooltip »)
   Rendu identique sur tous les navigateurs, sans le délai du `title` natif.
   ===================================================================== */
.tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-gray-600);
    line-height: 1;
    cursor: pointer;
    /* Zone tactile d'au moins 24px sans décaler l'icône dans le texte. */
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.tooltip-trigger::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
}

.tooltip-trigger:hover,
.tooltip-trigger[aria-describedby] {
    color: var(--color-brand);
}

.tooltip-trigger:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
    border-radius: 50%;
}

.tooltip-bubble {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1080;
    max-width: min(20rem, calc(100vw - 1rem));
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background-color: var(--color-gray-900);
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 90ms ease-out, transform 90ms ease-out;
}

.tooltip-bubble[data-visible="true"] {
    opacity: 1;
    transform: none;
}

.tooltip-bubble__arrow {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: inherit;
    transform: translateX(-50%) rotate(45deg);
}

.tooltip-bubble[data-placement="top"] .tooltip-bubble__arrow {
    bottom: -4px;
}

.tooltip-bubble[data-placement="bottom"] .tooltip-bubble__arrow {
    top: -4px;
}

@media (prefers-reduced-motion: reduce) {
    .tooltip-bubble {
        transition: none;
        transform: none;
    }
}
