/**
 * Recap Hub - Styles
 *
 * Styles for the /recap hub page with tabbed interface.
 * Light theme to match the Safaroto site design.
 */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    --rh-primary: #24B8F4;
    --rh-primary-dark: #1a8fc2;
    --rh-accent: #FFB800;
    --rh-bg-light: #f8f9fa;
    --rh-bg-white: #ffffff;
    --rh-text-dark: #1a1a2e;
    --rh-text-muted: #6c757d;
    --rh-border-color: #e0e0e0;
    --rh-card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --rh-card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --rh-transition: 0.3s ease;
    --rh-border-radius: 16px;
}

/* ============================================
   Container
   ============================================ */
.recap-hub-container {
    min-height: 60vh;
    background: var(--rh-bg-light);
    color: var(--rh-text-dark);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    padding-bottom: 60px;
}

/* ============================================
   Header Section
   ============================================ */
.recap-hub-header {
    background: linear-gradient(180deg, rgba(36, 184, 244, 0.08) 0%, transparent 100%);
    padding: 40px 20px 20px;
    text-align: center;
}

.recap-hub-header-content {
    max-width: 800px;
    margin: 0 auto;
    padding-left: 0;
}

.recap-hub-title {
    font-size: 2rem !important;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--rh-text-dark) !important;
    white-space: nowrap;
}

.recap-hub-subtitle {
    font-size: 1rem;
    color: var(--rh-text-muted);
    margin: 0;
}

/* ============================================
   Tabs Section
   ============================================ */
.recap-hub-tabs-section {
    padding: 0 20px;
    margin-bottom: 30px;
}

.recap-hub-tabs-container {
    max-width: 1200px;
    margin: 0 auto;
}

.recap-hub-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--rh-border-color);
    padding-bottom: 0;
}

.recap-hub-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: var(--rh-text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--rh-transition);
}

.recap-hub-tab:hover {
    color: var(--rh-primary);
}

.recap-hub-tab.active {
    color: var(--rh-primary);
    border-bottom-color: var(--rh-primary);
}

/* ============================================
   Content Header (Year Filter)
   ============================================ */
.recap-hub-content-header {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Past Year Dropdown in Content Area */
.recap-hub-past-year-dropdown {
    padding: 10px 36px 10px 16px;
    background: var(--rh-bg-white);
    border: 1px solid var(--rh-border-color);
    border-radius: 10px;
    color: var(--rh-text-dark);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: all var(--rh-transition);
    box-shadow: var(--rh-card-shadow);
}

.recap-hub-past-year-dropdown:hover {
    border-color: var(--rh-primary);
}

.recap-hub-past-year-dropdown:focus {
    outline: none;
    border-color: var(--rh-primary);
    box-shadow: 0 0 0 3px rgba(36, 184, 244, 0.15);
}

/* ============================================
   Tab Content
   ============================================ */
.recap-hub-tab-content {
    display: none;
}

.recap-hub-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   Grid Container
   ============================================ */
.recap-hub-grid-container {
    padding: 0 20px;
}

.recap-hub-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ============================================
   Preview Card
   ============================================ */
.recap-preview-card {
    position: relative;
    border-radius: var(--rh-border-radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 5;
    transition: all var(--rh-transition);
    box-shadow: var(--rh-card-shadow);
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.recap-preview-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--rh-card-shadow-hover);
}

/* "Your Recap" Card Highlight */
.recap-preview-card--yours {
    box-shadow: 0 0 0 3px var(--rh-primary), var(--rh-card-shadow);
}

.recap-preview-card--yours:hover {
    box-shadow: 0 0 0 3px var(--rh-primary), var(--rh-card-shadow-hover);
}

/* "Your Recap" Badge */
.recap-preview-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    padding: 6px 12px;
    background: var(--rh-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(36, 184, 244, 0.4);
}

/* Refresh Button */
.recap-refresh-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255, 255, 255, 0.95);
    color: var(--rh-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all var(--rh-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
}

.recap-preview-card:hover .recap-refresh-btn,
.recap-preview-card--yours .recap-refresh-btn:focus {
    opacity: 1;
}

.recap-refresh-btn:hover {
    background: var(--rh-primary);
    color: #fff;
    transform: scale(1.1);
}

.recap-refresh-btn:active {
    transform: scale(0.95);
}

.recap-refresh-btn.refreshing {
    opacity: 1;
    pointer-events: none;
}

.recap-refresh-btn.refreshing i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Card Background */
.recap-preview-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.recap-preview-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recap-preview-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

/* Card Content */
.recap-preview-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    color: #fff;
}

/* User Info */
.recap-preview-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.recap-preview-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.recap-preview-user-info {
    display: flex;
    flex-direction: column;
}

.recap-preview-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.recap-preview-year {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Stats */
.recap-preview-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.recap-preview-stat {
    display: flex;
    flex-direction: column;
}

.recap-preview-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.recap-preview-stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Country Flags */
.recap-preview-flags {
    display: flex;
    gap: 6px;
}

.recap-preview-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.recap-preview-flag-more {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Play Button Overlay */
.recap-preview-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all var(--rh-transition);
}

.recap-preview-play i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

.recap-preview-card:hover .recap-preview-play {
    opacity: 1;
}

/* ============================================
   Empty States
   ============================================ */
.recap-hub-empty-tab {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    text-align: center;
    color: var(--rh-text-muted);
}

.recap-hub-empty-tab i {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 16px;
}

.recap-hub-empty-tab p {
    font-size: 1rem;
    margin: 0;
}

.recap-hub-empty {
    padding: 80px 20px;
    text-align: center;
}

.recap-hub-empty-content {
    max-width: 400px;
    margin: 0 auto;
}

.recap-hub-empty-content i {
    font-size: 4rem;
    color: var(--rh-primary);
    opacity: 0.5;
    margin-bottom: 24px;
}

.recap-hub-empty-content h2 {
    font-size: 1.5rem;
    margin: 0 0 12px;
    color: var(--rh-text-dark);
}

.recap-hub-empty-content p {
    color: var(--rh-text-muted);
    margin: 0 0 24px;
}

.recap-hub-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--rh-primary);
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--rh-transition);
}

.recap-hub-login-btn:hover {
    background: var(--rh-primary-dark);
    color: #fff;
    text-decoration: none;
}

/* ============================================
   Loading State
   ============================================ */
.recap-hub-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--rh-text-muted);
}

.recap-hub-loading i {
    font-size: 1.5rem;
    color: var(--rh-primary);
}

/* ============================================
   Fullscreen Wrapper
   ============================================ */
.recap-fullscreen-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    background: #0a1628;
}

.recap-fullscreen-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recap-fullscreen-loading-content {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.recap-fullscreen-loading-content i {
    color: var(--rh-primary);
    margin-bottom: 16px;
    animation: planeFloat 2s ease-in-out infinite;
}

@keyframes planeFloat {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.recap-fullscreen-content {
    width: 100%;
    height: 100%;
}

/* Hide loading when content is ready */
.recap-fullscreen-wrapper.loaded .recap-fullscreen-loading {
    display: none;
}

/* Error state */
.recap-fullscreen-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
    text-align: center;
    padding: 40px;
}

.recap-fullscreen-error i {
    font-size: 3rem;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.recap-fullscreen-error p {
    font-size: 1.25rem;
    margin-bottom: 20px;
}

.recap-error-close-btn {
    padding: 12px 24px;
    background: var(--rh-primary);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--rh-transition);
}

.recap-error-close-btn:hover {
    background: var(--rh-primary-dark);
}

/* ============================================
   Body class when fullscreen is active
   ============================================ */
body.recap-fullscreen-active {
    overflow: hidden !important;
}

body.recap-fullscreen-active #wpadminbar,
body.recap-fullscreen-active .admin-bar-fix,
body.recap-fullscreen-active header,
body.recap-fullscreen-active .site-header,
body.recap-fullscreen-active .elementor-location-header,
body.recap-fullscreen-active nav.primary-navigation,
body.recap-fullscreen-active .nav-primary,
body.recap-fullscreen-active footer,
body.recap-fullscreen-active .site-footer,
body.recap-fullscreen-active .safaroto-mobile-nav {
    display: none !important;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .recap-hub-header {
        padding: 30px 16px 16px;
    }

    .recap-hub-title {
        font-size: 1.5rem;
    }

    .recap-hub-subtitle {
        font-size: 0.9375rem;
    }

    .recap-hub-tabs-section {
        padding: 0 16px;
    }

    .recap-hub-tabs {
        flex-wrap: wrap;
    }

    .recap-hub-tab {
        padding: 12px 16px;
        font-size: 0.9375rem;
    }

    .recap-hub-content-header {
        padding: 0px;
    }

    .recap-hub-grid-container {
        padding: 0 16px;
    }

    .recap-hub-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .recap-preview-card {
        aspect-ratio: 16 / 12;
    }
}

@media (max-width: 480px) {
    .recap-hub-header {
        padding: 24px 12px 12px;
    }

    .recap-hub-title {
        font-size: 1.375rem;
    }

    .recap-hub-tab {
        padding: 10px 12px;
        font-size: 0.875rem;
    }

    .recap-hub-content-header {
        padding: 0px;
    }

    .recap-hub-past-year-dropdown {
        padding: 8px 30px 8px 12px;
        font-size: 0.9375rem;
    }

    .recap-preview-stats {
        gap: 12px;
    }

    .recap-preview-stat-value {
        font-size: 1.125rem;
    }

    .recap-preview-badge {
        font-size: 0.6875rem;
        padding: 5px 10px;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recap-hub-header-content {
    animation: fadeInUp 0.5s ease forwards;
}

.recap-hub-tabs-container {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.recap-hub-grid-container {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

/* Stagger preview cards */
.recap-preview-card:nth-child(1) { animation-delay: 0.3s; }
.recap-preview-card:nth-child(2) { animation-delay: 0.4s; }
.recap-preview-card:nth-child(3) { animation-delay: 0.5s; }
.recap-preview-card:nth-child(4) { animation-delay: 0.6s; }
.recap-preview-card:nth-child(5) { animation-delay: 0.7s; }
.recap-preview-card:nth-child(6) { animation-delay: 0.8s; }
.recap-preview-card:nth-child(n+7) { animation-delay: 0.9s; }
