/* /assets/css/featured-animation.css */

/* Featured Article Animation Styles */
@keyframes aurora {
    0%, 100% { transform: translate(0%, 0%) rotate(0deg); }
    33% { transform: translate(30%, -30%) rotate(120deg); }
    66% { transform: translate(-20%, 20%) rotate(240deg); }
}

@keyframes rotate-globe {
    from { transform: rotateY(0deg) rotateX(10deg); }
    to { transform: rotateY(360deg) rotateX(10deg); }
}

@keyframes migrate {
    0%, 100% { opacity: 0; transform: translateY(20px) scaleY(0); }
    50% { opacity: 1; transform: translateY(0) scaleY(1); }
}

@keyframes pulse-logo {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1); 
        box-shadow: 0 10px 40px rgba(255, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3); 
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.05); 
        box-shadow: 0 15px 50px rgba(255, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4); 
    }
}

@keyframes float-document {
    0%, 100% { opacity: 0; transform: translateY(20px) scale(0.8) rotate(-5deg); }
    50% { opacity: 1; transform: translateY(0) scale(1) rotate(5deg); }
}

@keyframes rotate-orbit {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes counter-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

@keyframes scroll-ticker {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

@keyframes blink-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px #ff0000; }
    50% { opacity: 0.3; box-shadow: 0 0 5px #ff0000; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

.immigration-container {
    min-height: 400px;
    background: radial-gradient(ellipse at center, #1a2342 0%, #0a0e27 100%);
    position: relative;
    overflow: hidden; /* This should already be there, but double-check */
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-aurora {
    position: absolute; 
    top: -50%; 
    left: -50%;
    width: 200%; 
    height: 200%;
    background: linear-gradient(125deg, transparent, rgba(255, 0, 0, 0.1), transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: aurora 15s ease-in-out infinite;
    filter: blur(60px);
}

.featured-aurora:nth-child(2) {
    background: linear-gradient(-125deg, transparent, rgba(255, 255, 255, 0.1), transparent, rgba(255, 0, 0, 0.1), transparent);
    animation-delay: -7.5s; 
    animation-direction: reverse;
}

.featured-globe-container {
    position: absolute; 
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px; 
    height: 180px;
}

.featured-globe {
    width: 100%; 
    height: 100%;
    position: relative; 
    transform-style: preserve-3d;
    animation: rotate-globe 30s linear infinite;
}

.featured-globe-sphere {
    position: absolute; 
    width: 100%; 
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent),
                radial-gradient(circle at 70% 70%, transparent, rgba(0, 50, 150, 0.3));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset -20px -20px 40px rgba(0, 0, 0, 0.5),
               inset 20px 20px 40px rgba(255, 255, 255, 0.05),
               0 0 50px rgba(100, 150, 255, 0.2);
}

.featured-meridian {
    position: absolute; 
    width: 100%; 
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.featured-meridian:nth-child(2) { transform: rotateY(30deg); }
.featured-meridian:nth-child(3) { transform: rotateY(60deg); }
.featured-meridian:nth-child(4) { transform: rotateY(90deg); }
.featured-meridian:nth-child(5) { transform: rotateX(30deg); }
.featured-meridian:nth-child(6) { transform: rotateX(60deg); }

.featured-migration-path {
    position: absolute; 
    width: 2px;
    background: linear-gradient(to bottom, transparent, #ff0000, #ffffff, transparent);
    transform-origin: center; 
    opacity: 0;
    animation: migrate 4s ease-in-out infinite;
}

.featured-migration-path:nth-child(1) { 
    height: 150px; 
    top: 20%; 
    left: 15%; 
    transform: rotate(45deg); 
    animation-delay: 0s; 
}

.featured-migration-path:nth-child(2) { 
    height: 120px; 
    top: 30%; 
    right: 20%; 
    transform: rotate(-30deg); 
    animation-delay: 1s; 
}

.featured-migration-path:nth-child(3) { 
    height: 140px; 
    bottom: 25%; 
    left: 25%; 
    transform: rotate(60deg); 
    animation-delay: 2s; 
}

.featured-logo-badge {
    position: absolute; 
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px; 
    height: 100px;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.9), rgba(255, 0, 0, 0.7));
    border-radius: 16px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    z-index: 20;
    box-shadow: 0 10px 40px rgba(255, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: pulse-logo 3s ease-in-out infinite;
}

.featured-document {
    position: absolute; 
    width: 60px; 
    height: 80px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px; 
    padding: 8px;
    backdrop-filter: blur(10px);
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    font-size: 24px; 
    color: rgba(255, 255, 255, 0.8);
    opacity: 0; 
    animation: float-document 8s ease-in-out infinite;
}

.featured-document::before {
    content: ""; 
    position: absolute;
    top: 8px; 
    left: 8px; 
    right: 8px; 
    height: 3px;
    background: rgba(255, 255, 255, 0.3); 
    border-radius: 2px;
}

.featured-document::after {
    content: ""; 
    position: absolute;
    top: 16px; 
    left: 8px; 
    right: 20px; 
    height: 2px;
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 1px;
}

.featured-document:nth-child(4) { top: 15%; left: 10%; animation-delay: 0s; }
.featured-document:nth-child(5) { top: 15%; right: 10%; animation-delay: 2s; }
.featured-document:nth-child(6) { bottom: 15%; left: 10%; animation-delay: 4s; }
.featured-document:nth-child(7) { bottom: 15%; right: 10%; animation-delay: 6s; }

.featured-programs-orbit {
    position: absolute; 
    top: 50%; 
    left: 50%;
    width: 320px; 
    height: 320px;
    transform: translate(-50%, -50%);
    animation: rotate-orbit 40s linear infinite;
}

.featured-program-node {
    position: absolute; 
    width: 70px; 
    height: 70px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: counter-rotate 40s linear infinite;
    cursor: pointer; 
    transition: all 0.3s ease;
}

.featured-program-node:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.featured-program-node i { 
    font-size: 20px; 
    color: #ffffff; 
    margin-bottom: 4px; 
}

.featured-program-node span { 
    font-size: 8px; 
    color: rgba(255, 255, 255, 0.8); 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    text-align: center; 
}

.featured-program-node:nth-child(1) { top: -35px; left: 50%; transform: translateX(-50%); }
.featured-program-node:nth-child(2) { top: 50%; right: -35px; transform: translateY(-50%); }
.featured-program-node:nth-child(3) { bottom: -35px; left: 50%; transform: translateX(-50%); }
.featured-program-node:nth-child(4) { top: 50%; left: -35px; transform: translateY(-50%); }

.featured-news-ticker {
    position: absolute; 
    bottom: 0; 
    left: 0;
    width: 100%; 
    height: 40px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
    border-top: 1px solid rgba(255, 0, 0, 0.3);
    display: flex; 
    align-items: center; 
    overflow: hidden;
    /* Add mask to fade edges */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 5%, black 95%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, black 5%, black 95%, transparent 100%);
}

.featured-ticker-wrapper {
    display: flex;
    align-items: center;
    animation: scroll-ticker 30s linear infinite;
}

.featured-ticker-content {
    display: flex; 
    white-space: nowrap;
    padding-right: 50px; /* Gap before loop repeats */
}


/* Updated animation to scroll within bounds */
@keyframes scroll-ticker {
    0% { 
        transform: translateX(0); 
    }
    100% { 
        transform: translateX(-50%); /* Only scroll half since we duplicate content */
    }
}

.featured-ticker-item {
    padding: 0 30px; 
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px; 
    font-weight: 500; 
    letter-spacing: 0.5px;
    display: flex; 
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* Remove the ::before pseudo-element since we're using FontAwesome */
.featured-ticker-item::before { 
    content: none;
}

.ticker-icon {
    color: #ff0000;
    margin-right: 10px;
    font-size: 14px;
}

.featured-status-badge {
    position: absolute; 
    top: 20px; 
    left: 20px;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.5);
    border-radius: 20px; 
    padding: 8px 16px;
    display: flex; 
    align-items: center; 
    gap: 8px;
    backdrop-filter: blur(10px);
}

.featured-status-dot {
    width: 8px; 
    height: 8px;
    background: #ff0000; 
    border-radius: 50%;
    animation: blink-dot 2s ease-in-out infinite;
}

.featured-status-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px; 
    font-weight: 600;
    letter-spacing: 1px; 
    text-transform: uppercase;
}

.featured-particle {
    position: absolute; 
    width: 3px; 
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%; 
    pointer-events: none;
}

.featured-shimmer {
    position: absolute; 
    top: -50%; 
    left: -50%;
    width: 200%; 
    height: 200%;
    background: linear-gradient(105deg, transparent 45%, rgba(255, 255, 255, 0.008) 50%, transparent 55%); /* Ultra diluted at 0.008 */
    animation: shimmer 8s infinite; /* Even slower at 8s */
}

.featured-rcic-badge {
    position: absolute; 
    top: 20px; 
    right: 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 8px; 
    padding: 6px 12px;
    font-size: 10px; 
    font-weight: 700; 
    letter-spacing: 1px;
    color: rgba(255, 215, 0, 0.9); 
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .featured-programs-orbit { width: 280px; height: 280px; }
    .featured-program-node { width: 60px; height: 60px; }
    .featured-globe-container { width: 150px; height: 150px; }
}

/* Make program nodes work as links */
/* Ensure program nodes have borders in normal state */
.featured-program-node,
a.featured-program-node {
    position: absolute; 
    width: 70px; 
    height: 70px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.3); /* Ensure border is always present */
    border-radius: 12px;
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: counter-rotate 40s linear infinite;
    cursor: pointer; 
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

/* Ensure documents have borders in normal state */
.featured-document,
a.featured-document {
    position: absolute; 
    width: 60px; 
    height: 80px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2); /* Ensure border is always present */
    border-radius: 8px; 
    padding: 8px;
    backdrop-filter: blur(10px);
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    font-size: 24px; 
    color: rgba(255, 255, 255, 0.8);
    opacity: 0; 
    animation: float-document 8s ease-in-out infinite;
    text-decoration: none;
}

/* Hover states with enhanced borders */
a.featured-program-node:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.5); /* Brighter border on hover */
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

a.featured-document:hover {
    border: 1px solid rgba(255, 255, 255, 0.4); /* Brighter border on hover */
    transform: translateY(-5px) scale(1.05) rotate(5deg);
}

/* Make ticker items clickable */
a.featured-ticker-item {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.3s ease;
}

a.featured-ticker-item:hover {
    color: #ffffff;
    text-decoration: none;
}

/* Make logo badge clickable */
a.featured-logo-badge {
    text-decoration: none;
}