/* ============================================
   Fantasy Rugby — Reusable Component Styles
   ============================================ */

/* ============================================
   1. Carousel / Slider
   ============================================ */

.carousel-container {
    position: relative;
    overflow: clip;
    width: 100%;
}

.carousel-track {
    display: flex;
    align-items: flex-start;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                height   0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 4px;
    overflow: clip;
}

/* Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px 0;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--surface-3, rgba(255,255,255,0.11));
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--accent, #C8192B);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(200,25,43,0.5);
}

.carousel-dot:hover:not(.active) {
    background: var(--surface-3, rgba(255,255,255,0.2));
    transform: scale(1.1);
}

/* Arrow buttons (optional, for desktop) */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-2, rgba(255,255,255,0.07));
    border: 1px solid var(--border, rgba(255,255,255,0.07));
    color: var(--text, #EEF2FF);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 5;
}

.carousel-arrow:hover {
    background: var(--surface-3);
    border-color: var(--border-active);
}

.carousel-arrow-prev { left: 8px; }
.carousel-arrow-next { right: 8px; }

/* Counter */
.carousel-counter {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary, #8FA3C8);
    font-weight: 600;
    letter-spacing: 0.06em;
    margin-top: 4px;
}


/* ============================================
   2. InfoPopover  (portaled to <body>)
   ============================================ */

.popover-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface-2, rgba(255,255,255,0.07));
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    color: var(--text-secondary, #8FA3C8);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.25s ease;
    line-height: 1;
    user-select: none;
    vertical-align: middle;
}

.popover-trigger:hover {
    background: var(--accent, #C8192B);
    color: #fff;
    border-color: var(--accent);
    transform: scale(1.1);
}

/* Panel — always portaled to body, positioned via JS */
.popover-panel {
    position: fixed;
    z-index: 10001;
    background: rgba(10, 22, 55, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 20px 22px;
    min-width: 280px;
    max-width: 360px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.popover-panel.popover-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Arrow (desktop only) */
.popover-panel::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(10, 22, 55, 0.97);
    border-right: 1px solid rgba(255,255,255,0.12);
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

/* Backdrop (mobile bottom-sheet) */
.popover-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.popover-backdrop.popover-backdrop-visible {
    opacity: 1;
}

.popover-panel h4 {
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--text, #EEF2FF);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.popover-panel p {
    color: var(--text-secondary, #8FA3C8);
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
}

.popover-panel .popover-highlight {
    color: var(--gold, #D4A843);
    font-weight: 700;
}

/* Mobile: bottom-sheet style */
@media (max-width: 600px) {
    .popover-panel {
        border-radius: 18px 18px 0 0;
        padding: 24px 20px 32px;
        min-width: auto;
        max-width: none;
        box-shadow: 0 -12px 48px rgba(0,0,0,0.7);
    }

    .popover-panel::after {
        display: none;
    }
}


/* ============================================
   3. Loading Manager Styles
   ============================================ */

/* Full-screen overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(7, 14, 31, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.loading-overlay.loading-overlay-visible {
    opacity: 1;
}

.loading-overlay-content {
    text-align: center;
}

.loading-overlay-content .spinner {
    width: 48px;
    height: 48px;
    border-width: 4px;
    margin: 0 auto 20px;
}

.loading-overlay-content p {
    color: var(--text-secondary, #8FA3C8);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Button loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.btn-success-state {
    background: rgba(29,185,84,0.25) !important;
    border-color: rgba(29,185,84,0.5) !important;
    color: #6EE89B !important;
}

.btn-error-state {
    background: rgba(200,25,43,0.25) !important;
    border-color: rgba(200,25,43,0.5) !important;
    color: #FF8A94 !important;
}
