/*
 * Tigsi overrides for Eventy template.
 * Re-brands the Eventy palette with Tigsi colors while keeping
 * the Eventy visual structure (spacing, typography, components).
 */

:root {
    /* Tigsi brand palette */
    --tigsi-primary: #6DC6D4;
    --tigsi-purple: #667eea;
    --tigsi-violet: #764ba2;
    --tigsi-navy: #212C56;
    --tigsi-dark: #1a1d29;
    --tigsi-pink: #f093fb;
    --tigsi-success: #43e97b;
    --tigsi-warn: #ffc107;
    --tigsi-danger: #f5576c;

    --tigsi-gradient-primary: linear-gradient(90deg, #6DC6D4, #667eea);
    --tigsi-gradient-purple-violet: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* Remap Eventy theme variables to Tigsi palette */
    --theme-color: #667eea;       /* primary action */
    --theme-color2: #764ba2;      /* accent */
    --theme-bg-light: #F8F9FE;
    --color-dark: #212C56;
    --theme-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --slider-arrow-bg: rgba(102, 126, 234, .2);
    --footer-bg: #1a1d4c;
    --footer-bg2: #20246b;
}

/* Keep the brand logo readable in the header */
.navbar-brand img {
    max-height: 48px;
    width: auto;
}

.footer-logo img {
    max-height: 48px;
    width: auto;
}

/*
 * Eventy (style.css) masque le premier <li> du bandeau contact sous 1199px
 * (leur démo mettait l’adresse en premier). Chez Tigsi le premier item est l’email : on réaffiche.
 */
@media all and (max-width: 1199px) {
    .header-top-contact li:first-child {
        display: flex !important;
        align-items: center;
    }
}

/* Menu mobile : le max-height: 220px d’Eventy coupe le menu Tigsi (Plus + légal). */
@media all and (max-width: 991px) {
    .navbar .navbar-collapse {
        max-height: min(82vh, 520px) !important;
    }
}

/* Bandeau contact : éviter débordement horizontal sur très petits écrans */
@media (max-width: 575.98px) {
    .header-top-contact ul {
        justify-content: center;
        row-gap: 8px;
    }

    .header-top-contact a {
        font-size: 0.9rem;
        word-break: break-word;
    }

    .header-top-social span {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 6px;
    }

    .header-top-social {
        justify-content: center;
    }
}

/* Copyright : lisibilité mobile (Eventy aligne le menu à droite seulement ≥ md) */
@media (max-width: 767.98px) {
    .copyright .footer-menu {
        text-align: left !important;
        float: none !important;
        margin-top: 10px;
    }

    .copyright .footer-menu li:first-child {
        margin-left: 0;
    }
}

/* Scroll top — focus visible pour clavier */
.tigsi-scroll-top:focus-visible {
    outline: 2px solid var(--theme-color);
    outline-offset: 3px;
}

/* ========== Legacy utility classes still used by existing views ========== */

/* Nexa fonts were used in the legacy home page — map to Poppins headings */
.font-nexa-heavy,
.font-nexa-bold {
    font-family: var(--heading-font, "Poppins", sans-serif);
    font-weight: 800;
}

/* Legacy gradient helpers still referenced by a few legacy views */
.bg-tigsi-gradient-primary {
    background: var(--tigsi-gradient-primary) !important;
    color: #fff;
}

.bg-tigsi-gradient-purple-violet {
    background: var(--tigsi-gradient-purple-violet) !important;
    color: #fff;
}

/* ========== Compatibility with legacy Bootstrap .btn classes on .theme-btn ========== */

.theme-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 14px 30px;
    border-radius: 30px;
    font-weight: 600;
    color: var(--theme-color);
    background: transparent;
    border: 2px solid var(--theme-color);
    transition: var(--transition2);
    text-decoration: none;
}

.theme-btn-outline:hover {
    background: var(--theme-color);
    color: #fff;
}

/* ========== Legacy toast / alert (returnMessage partial) above Eventy breadcrumb ========== */

.vote-alert-success,
.vote-alert-danger {
    position: fixed;
    top: 120px;
    right: 20px;
    z-index: 9999;
    padding: 16px 20px;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-width: 380px;
    animation: tigsi-toast-in 0.35s ease-out;
}

.vote-alert-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.vote-alert-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

@keyframes tigsi-toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========== Header polish ========== */

.header-top-contact ul li a i {
    color: var(--theme-color);
}

/* ========== Page utility section for pages without their own hero ========== */

.tigsi-page-section {
    padding: 80px 0;
}

.tigsi-form-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--box-shadow, 0 0 40px 5px rgba(0,0,0,0.05));
    padding: 2.5rem;
}

@media (max-width: 767px) {
    .tigsi-form-card {
        padding: 1.5rem;
    }
}

/* ========== Ensure main content is pushed below fixed header on every page ========== */

body > main.main {
    min-height: 60vh;
}

/* ========== Custom form-control focus using Tigsi color ========== */

.form-control:focus,
.form-select:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* ========== Pagination brand color ========== */

.pagination .page-link {
    color: var(--theme-color);
}

.pagination .page-item.active .page-link {
    background: var(--theme-gradient);
    border-color: var(--theme-color);
    color: #fff;
}

/* ========== Common badges used in event cards / elections ========== */

.tigsi-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    background: var(--theme-gradient);
}

.tigsi-badge-live {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.tigsi-badge-upcoming {
    background: linear-gradient(135deg, #6DC6D4 0%, #667eea 100%);
}

.tigsi-badge-ended {
    background: linear-gradient(135deg, #757F95 0%, #4a4a5a 100%);
}

/* ========== Event / election card on listings ========== */

.tigsi-event-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--box-shadow, 0 0 40px 5px rgba(0,0,0,0.05));
    transition: var(--transition2, all 0.3s ease);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tigsi-event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
}

.tigsi-event-card-img {
    position: relative;
    padding-top: 62%;
    overflow: hidden;
    background: #eef0f7;
}

.tigsi-event-card-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tigsi-event-card:hover .tigsi-event-card-img img {
    transform: scale(1.05);
}

.tigsi-event-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tigsi-event-card-title {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--color-dark);
    margin-bottom: 0.75rem;
    line-height: 1.35;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tigsi-event-card-meta {
    color: var(--body-text-color);
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tigsi-event-card-meta i {
    color: var(--theme-color);
    width: 18px;
}

.tigsi-event-card-footer {
    padding-top: 1rem;
    margin-top: auto;
    border-top: 1px solid var(--border-info-color, rgba(0, 0, 0, 0.08));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

/* ========== Tigsi payment option chip ========== */

.tigsi-payment-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-info-color, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition2, all 0.3s ease);
    background: #fff;
}

.tigsi-payment-chip:hover {
    border-color: var(--theme-color);
}

.tigsi-payment-chip.selected,
.tigsi-payment-chip input[type="radio"]:checked ~ .tigsi-payment-chip-inner {
    border-color: var(--theme-color);
}

.tigsi-payment-chip img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

/* ========== Legacy hero-minimal (used by old home) ========== */

.hero-minimal {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-gradient);
    padding: 90px 20px;
    color: #fff;
    text-align: center;
}

.hero-minimal .hero-content,
.hero-minimal .hero-title,
.hero-minimal .hero-description {
    color: #fff;
}

/* ========== Legacy payment page (heading1 + buttons) ========== */

.heading1 {
    padding: 120px 0 60px;
    text-align: center;
    background: var(--theme-gradient);
    color: #fff;
    margin-bottom: 0;
}

.heading1 h1 {
    color: #fff;
    font-family: var(--heading-font, "Poppins", sans-serif);
    font-weight: 800;
    font-size: clamp(2rem, 4vw, 3rem);
    margin: 0;
}

.pay-button,
#pay-button,
#confirmButton,
#verifyPayment,
#openPayUrlButton {
    background: var(--theme-gradient) !important;
    border: none !important;
    color: #fff !important;
    border-radius: 30px !important;
    transition: var(--transition2, all 0.3s ease) !important;
}

.pay-button:hover,
#pay-button:hover,
#confirmButton:hover,
#verifyPayment:hover,
#openPayUrlButton:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.payment-section {
    background: var(--theme-bg-light) !important;
}

.payment-card {
    border-radius: 20px !important;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.08) !important;
}

.small-section {
    background: #fff !important;
    border: 1px solid rgba(102, 126, 234, 0.08);
    border-radius: 16px !important;
}

/* ========== Legacy support/static page heroes ========== */

.support-hero,
.faq-hero,
.privacy-hero,
.cgu-hero,
.pricing-hero,
.about-hero,
.features-hero {
    margin-top: 0;
}

/* ========== Breadcrumb / page-title compatibility ========== */

#main-content {
    min-height: 60vh;
}

/* ========== Miscellaneous cleanup ========== */

img {
    max-width: 100%;
    height: auto;
}

body {
    overflow-x: hidden;
}

/* ========== Theme-btn small size compat ========== */

.theme-btn.btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
}

.theme-btn-outline.btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
    border-radius: 24px;
}

/* ========== Make native select + input match form-control focus ========== */

select,
input,
textarea {
    font-family: inherit;
}

/* ========== Countdown widget (used by event cards and election pages) ========== */

.countdown {
    font-family: var(--heading-font, "Poppins", sans-serif);
    font-weight: 700;
    color: #fff;
}

.event-countdown-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(33, 44, 86, 0.85);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    z-index: 2;
}

.event-ribbon {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

/* ========== Home "choose" section: ensure FA icons are visible ========== */

.choose-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.choose-item-icon i,
.choose-item-icon .fa,
.choose-item-icon .far,
.choose-item-icon .fas,
.choose-item-icon .fab {
    color: #fff !important;
    font-size: 1.35rem;
    line-height: 1;
}
