/* ========================================
   NSTAAF Facts Display Styles
   ======================================== */

/* Container alignment */
.facts-container {
    max-width: 1000px;
}

/* Fact Display Wrapper */
.fact-display-wrapper {
    margin: 2rem 0;
    width: 100%;
}

/* Fact Header */
.random-facts h1 {
    font-size: 2rem;
}

/* Fact Card Container - this has the styling now */
.fact-card-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    margin: 2rem 0 2.5rem 0;
    background: #FFFEFF;
    border-radius: 1rem;
    padding: 3rem 1rem 2rem 1rem;
    box-shadow: 0.3125rem 0.3125rem 1.9rem rgba(82, 116, 138, 0.15);
    min-height: 360px;
}

/* Fact Card - no longer has its own styling */
.fact-card {
    flex: 1;
    max-width: 100%;
    display: flex;
    padding: 0 2rem;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: none; /* Remove transition for Tinder effect */
    touch-action: pan-y;
}

/* swipe effect */
.fact-card.swiping {
    transition: none;
}

/* Fact Content */
.fact-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 3rem;
    margin-top: 1rem;
}

.fact-text {
    font-size: 1.3rem;
    line-height: 1.6;
    color: #762314;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

/* Fact Footer - sticks to bottom */
.fact-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

/* Metadata - always at bottom */
.fact-metadata {
    display: flex;
    gap: 0.25rem 0.5rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}

.metadata-value {
    font-size: 0.9rem;
    color: #5D656C;
    font-weight: 400;
}

.metadata-separator {
    color: rgba(118, 35, 20, 0.3);
    font-size: 0.9rem;
}

/* Mobile Navigation Bar - now universal */
.mobile-nav-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(118, 35, 20, 0.1);
}

.mobile-nav-btn {
    width: 48px;
    height: 48px;
    background-color: transparent;
    border: 1px solid rgba(118, 35, 20, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #762314;
    position: relative;
}

.mobile-nav-btn:hover {
    background-color: rgba(118, 35, 20, 0.05);
    border-color: #762314;
}

.mobile-nav-btn:active {
    background-color: #762314;
    color: white;
    border-color: #762314;
}

#autoplay-toggle.active .icon-play {
    display: none;
}

#autoplay-toggle.active .icon-pause {
    display: block !important;
}

#autoplay-toggle.active {
    background-color: #762314;
    color: white;
    border-color: #762314;
}

/* Keyboard hint styling */
.keyboard-hint {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 60px;
    height: 40px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    cursor: help;
}

.keyboard-hint:hover {
    opacity: 1;
}

.keyboard-hint svg {
    width: 100%;
    height: 100%;
}

/* Tooltip styling */
.tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: #26373c;
    color: white;
    font-size: 0.85rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 1rem;
    border: 6px solid transparent;
    border-top-color: #26373c;
}

.keyboard-hint:hover .tooltip {
    opacity: 1;
}

/* Navigation button tooltips */
.mobile-nav-btn {
    position: relative;
}

.mobile-nav-btn .nav-tooltip {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 0.7rem;
    background-color: #26373c;
    color: white;
    font-size: 0.8rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.mobile-nav-btn .nav-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #26373c;
}

/* Show tooltip on hover (desktop only) */
@media (hover: hover) and (pointer: fine) {
    .mobile-nav-btn:hover .nav-tooltip {
        opacity: 1;
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media screen and (max-width: 1024px) {
    .random-facts h1 {
        font-size: 1.6rem;
    }

    .fact-content {
        padding: 0 2rem;
    }
    
    .keyboard-hint {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .random-facts h1 {
        font-size: 1.5rem;
    }

    .fact-intro {
        font-size: 1rem;
    }

    .fact-card-container {
        padding: 2.5rem 2rem 2rem 2rem;
        min-height: 380px;
    }

    .fact-content {
        padding: 0;
    }
}

@media screen and (max-width: 576px) {
    .fact-display-wrapper {
        margin: 1rem 0;
    }

    .fact-header {
        margin-bottom: 1.5rem;
    }

    .fact-text {
        font-size: 1.15rem;
    }

    .fact-intro {
        font-size: 0.9rem;
    }

    .fact-card {
        padding: 0 .5rem;
    }

    .fact-card-container {
        margin: 1.5rem 0 2rem 0;
        padding: 2rem 1.5rem 1.5rem 1.5rem;
        min-height: 50vh;
    }

    .metadata-value {
        font-size: 0.7rem;
    }

    .mobile-nav-btn {
        width: 44px;
        height: 44px;
    }

    .mobile-nav-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.mobile-nav-btn:focus {
    outline: 2px solid #762314;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .mobile-nav-btn {
        transition: none;
    }
}