/**
 * Betformatics Navigation Dropdown Styles
 *
 * Hover-triggered dropdown menu for navigation items
 * Wide horizontal grid layout for child pages
 *
 * @package Betformatics
 */

/* ==========================================================================
   DROPDOWN CONTAINER
   ========================================================================== */
.bf-nav-dropdown {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

.bf-nav-dropdown[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ==========================================================================
   DROPDOWN INNER - Wide horizontal layout (compact)
   ========================================================================== */
.bf-nav-dropdown__inner {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 12px 16px;
    width: 1140px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Casino dropdown - wider layout */
#bf-dropdown-casino .bf-nav-dropdown__inner {
    width: 1400px;
}

/* ==========================================================================
   DROPDOWN HEADER - Title left, CTAs right (compact)
   ========================================================================== */
.bf-nav-dropdown__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.bf-nav-dropdown__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.bf-nav-dropdown__header-ctas {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ==========================================================================
   DROPDOWN LIST - 5 column grid (compact)
   ========================================================================== */
.bf-nav-dropdown__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

/* ==========================================================================
   DROPDOWN ITEM
   ========================================================================== */
.bf-nav-dropdown__item {
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   DROPDOWN LINK - Button style with icon left, text center, arrow right
   ========================================================================== */
.bf-nav-dropdown__link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    height: 60px;
    text-decoration: none;
    color: #1a1a2e;
    font-size: 13px;
    font-weight: 500;
    border-radius: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.bf-nav-dropdown__link:hover {
    background: #ffffff;
    border-color: #dee2e6;
    color: #1a1a2e;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.bf-nav-dropdown__link:focus {
    outline: 2px solid #1848A0;
    outline-offset: -2px;
    background: #ffffff;
}

/* ==========================================================================
   DROPDOWN THUMBNAIL - Icon on the left (fixed size)
   ========================================================================== */
.bf-nav-dropdown__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.bf-nav-dropdown__thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.15s ease;
}

.bf-nav-dropdown__link:hover .bf-nav-dropdown__thumb img {
    transform: scale(1.1);
}

/* ==========================================================================
   DROPDOWN ICON - Fallback when no thumbnail
   ========================================================================== */
.bf-nav-dropdown__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: #e8f5e9;
    border-radius: 8px;
    color: #16a34a;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.bf-nav-dropdown__link:hover .bf-nav-dropdown__icon {
    background: #c8e6c9;
    color: #15803d;
}

.bf-nav-dropdown__icon svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   DROPDOWN TEXT - Centered, takes available space
   ========================================================================== */
.bf-nav-dropdown__text {
    flex: 1;
    text-align: center;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   DROPDOWN ARROW - Right side arrow icon
   ========================================================================== */
.bf-nav-dropdown__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #adb5bd;
    transition: color 0.15s ease, transform 0.15s ease;
}

.bf-nav-dropdown__arrow svg {
    width: 16px;
    height: 16px;
}

.bf-nav-dropdown__link:hover .bf-nav-dropdown__arrow {
    color: #1848A0;
    transform: translateX(2px);
}

/* ==========================================================================
   RESPONSIVE - Tablet
   ========================================================================== */
@media (max-width: 1440px) {
    #bf-dropdown-casino .bf-nav-dropdown__inner {
        width: 95vw;
        max-width: 1400px;
    }
}

@media (max-width: 1200px) {
    .bf-nav-dropdown__inner {
        width: 95vw;
        max-width: 1140px;
        padding: 16px 20px;
    }

    .bf-nav-dropdown--posts .bf-nav-dropdown__inner--wide {
        width: 95vw;
        max-width: 1140px;
    }

    .bf-nav-dropdown__list {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .bf-nav-dropdown__link {
        height: 52px;
        padding: 0 10px;
        gap: 8px;
        font-size: 12px;
    }

    .bf-nav-dropdown__thumb {
        width: 30px;
        height: 30px;
    }

    .bf-nav-dropdown__icon {
        width: 30px;
        height: 30px;
    }

    .bf-nav-dropdown__arrow {
        width: 16px;
        height: 16px;
    }

    .bf-nav-dropdown__arrow svg {
        width: 14px;
        height: 14px;
    }
}

/* ==========================================================================
   RESPONSIVE - Hide on mobile (touch devices use direct links)
   ========================================================================== */
@media (max-width: 768px) {
    .bf-nav-dropdown {
        display: none;
    }
}

/* ==========================================================================
   POSTS DROPDOWN VARIANT (Anmeldelser)
   ========================================================================== */
.bf-nav-dropdown--posts .bf-nav-dropdown__inner--wide {
    width: 1140px;
    padding: 16px 20px;
}

/* Posts Grid - Horizontal scrollable grid of bookmaker logos */
.bf-nav-dropdown__posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

/* Individual post item - bookmaker card style (matches reviews-logo.css) */
.bf-nav-dropdown__post-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 70px;
    background-color: var(--bookmaker-bg, #1a1a2e);
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.bf-nav-dropdown__post-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bf-nav-dropdown__post-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.bf-nav-dropdown__post-logo img {
    max-width: calc(100% - 16px);
    max-height: calc(100% - 16px);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.bf-nav-dropdown__post-name {
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    line-height: 1.2;
    padding: 4px;
}

/* CTAs section - smaller buttons */
.bf-nav-dropdown__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.bf-nav-dropdown__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
    background: #f3f4f6;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.bf-nav-dropdown__cta:hover {
    background: #e5e7eb;
    color: #1f2937;
    text-decoration: none;
}

/* "Alle anmeldelser" link - uses site primary color */
.bf-nav-dropdown__cta--all {
    background: transparent;
    color: #1848A0;
    font-weight: 600;
}

.bf-nav-dropdown__cta--all:hover {
    background: rgba(24, 72, 160, 0.08);
    color: #133a80;
}

/* Legacy primary variant (kept for backwards compatibility) */
.bf-nav-dropdown__cta--primary {
    background: #1848A0;
    color: #ffffff;
}

.bf-nav-dropdown__cta--primary:hover {
    background: #133a80;
    color: #ffffff;
}

.bf-nav-dropdown__cta svg {
    flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVE - Posts dropdown tablet
   ========================================================================== */
@media (max-width: 1200px) {
    .bf-nav-dropdown__posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .bf-nav-dropdown__post-item {
        height: 60px;
    }

    .bf-nav-dropdown__post-logo {
        padding: 8px;
    }

    .bf-nav-dropdown__post-logo img {
        max-width: calc(100% - 16px);
        max-height: calc(100% - 16px);
    }

    .bf-nav-dropdown__cta {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* ==========================================================================
   ACCESSIBILITY - Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .bf-nav-dropdown,
    .bf-nav-dropdown__link,
    .bf-nav-dropdown__thumb img,
    .bf-nav-dropdown__post-item {
        transition: none;
    }

    .bf-nav-dropdown__link:hover,
    .bf-nav-dropdown__post-item:hover {
        transform: none;
    }
}
