/* 
 * Minimal Factoid System - TV News Style
 * Subtle, classy, simple presentation
 */

/* ===== FACTOID CONTAINER ===== */
.factoid-container {
    position: relative;
    margin-top: 0.75rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* ===== FACTOID CONTENT ===== */
.factoid-text {
    font-size: 0.80rem;
    font-weight: 400;
    line-height: 1.2;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    transition: color 0.5s ease;
    opacity: 0;
    transform: translateY(20px);
}

.factoid-text:hover {
    color: #374151;
}

.factoid-emoji {
    font-size: 1rem;
    opacity: 0.8;
}

.factoid-text strong {
    color: #1f2937;
    font-weight: 600;
}

/* ===== COLOR ACCENTS ===== */
.factoid-text[data-color="green"] strong {
    color: #059669;
}

.factoid-text[data-color="red"] strong {
    color: #dc2626;
}

.factoid-text[data-color="blue"] strong {
    color: #2563eb;
}

.factoid-text[data-color="orange"] strong {
    color: #ea580c;
}

.factoid-text[data-color="purple"] strong {
    color: #7c3aed;
}

/* ===== LOADING STATE ===== */
.factoid-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.factoid-spinner {
    width: 14px;
    height: 14px;
    border: 1.5px solid #e5e7eb;
    border-top: 1.5px solid #6b7280;
    border-radius: 50%;
    animation: subtleSpin 1.5s linear infinite;
}

/* ===== ERROR STATE ===== */
.factoid-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.factoid-error-icon {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ===== EMPTY STATE ===== */
.factoid-empty {
    display: flex;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.875rem;
    font-style: italic;
    padding: 0.25rem 0;
}

/* ===== CONTRIBUTION PROMPT ===== */
.contribution-prompt {
    display: flex;
    justify-content: center;
    padding: 0.25rem 0;
}

.contribution-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.contribution-link:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.contribution-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.contribution-points {
    background-color: #3b82f6;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 1rem;
    line-height: 1;
}

/* ===== ANIMATIONS ===== */
.factoid-text.slide-in {
    animation: slideUpIn 0.6s ease-out forwards;
}

.factoid-text.slide-out {
    animation: slideDownOut 0.4s ease-in forwards;
}

@keyframes slideUpIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDownOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes subtleSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 640px) {
    .factoid-text {
        font-size: 0.8rem;
    }
    
    .factoid-emoji {
        font-size: 0.9rem;
    }
    
    .contribution-link {
        padding: 0.75rem 1rem;
        min-height: 44px; /* Touch-friendly minimum height */
        min-width: 44px;
    }
    
    .contribution-text {
        font-size: 0.8rem;
    }
    
    .contribution-points {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

/* ===== MOTION PREFERENCES ===== */
@media (prefers-reduced-motion: reduce) {
    .factoid-text.slide-in {
        animation: none;
        opacity: 1;
        transform: translateY(0);
    }
    
    .factoid-text.slide-out {
        animation: none;
        opacity: 0;
        transform: translateY(0);
    }
    
    .factoid-spinner {
        animation: none;
        border-top-color: #9ca3af;
    }
    
    .factoid-text {
        transition: none;
    }
    
    .contribution-link {
        transition: none;
    }
    
    .contribution-link:hover {
        transform: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .factoid-container {
        break-inside: avoid;
    }
    
    .factoid-text {
        color: #000 !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
        animation: none !important;
    }
    
    .factoid-text strong {
        color: #000 !important;
    }
    
    .factoid-emoji {
        display: none;
    }
    
    .contribution-prompt {
        display: none; /* Hide contribution prompts in print */
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .factoid-text {
        color: #000000;
    }
    
    .factoid-text strong {
        color: #000000;
    }
    
    .factoid-text:hover {
        color: #000000;
    }
    
    .contribution-link {
        background-color: #ffffff;
        border-color: #000000;
        color: #000000;
    }
    
    .contribution-text {
        color: #000000;
    }
    
    .contribution-points {
        background-color: #000000;
        color: #ffffff;
    }
}