/* CSS Variables */
:root {
    --text-dark: #1e293b;
    --text-gray: #333;
    --text-light: #94a3b8;
    --primary: #3b82f6;
    --secondary: #ec4899;
}

/* Hero Tags Styling */
.hero-tag {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.hero-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.95);
}

/* Animated Decorations */
.animate-spin-slow {
    animation: spin-slow 20s linear infinite !important;
    will-change: transform;
}

.animate-twinkle {
    animation: twinkle 3s ease-in-out infinite !important;
    will-change: transform, opacity;
}

@keyframes spin-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes twinkle {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1) rotate(0deg); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.3) rotate(180deg); 
    }
}

/* Star Positioning */
.star-deco {
    position: absolute !important;
    z-index: 10 !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    pointer-events: none;
}

.star-1 {
    top: 10% !important;
    right: 15% !important;
    width: 40px !important;
    height: 40px !important;
}

.star-2 {
    top: 22% !important;
    left: 54% !important;
    width: 28px !important;
    height: 28px !important;
}

.star-3 {
    top: 40% !important;
    right: 30% !important;
    width: 22px !important;
    height: 22px !important;
}

.sun-deco {
    position: absolute !important;
    top: 8% !important;
    left: 8% !important;
    width: 50px !important;
    height: 50px !important;
    z-index: 10 !important;
    filter: drop-shadow(0 2px 6px rgba(255, 200, 55, 0.5));
    pointer-events: none;
}

/* Confetti Animation */
.confetti-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    pointer-events: none;
    overflow: hidden;
    z-index: 5 !important;
    width: 100% !important;
    height: 100% !important;
}

.confetti {
    position: absolute !important;
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    animation: confetti-fall 6s linear infinite !important;
    will-change: transform, opacity;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

.confetti-1 {
    background: #ff6b9d !important;
    left: 10% !important;
    animation-delay: 0s !important;
}

.confetti-2 {
    background: #4ade80 !important;
    left: 30% !important;
    animation-delay: 1s !important;
}

.confetti-3 {
    background: #fbbf24 !important;
    left: 50% !important;
    animation-delay: 2s !important;
}

.confetti-4 {
    background: #3b82f6 !important;
    left: 70% !important;
    animation-delay: 0.5s !important;
}

.confetti-5 {
    background: #8b5cf6 !important;
    left: 85% !important;
    animation-delay: 1.5s !important;
}

.confetti-6 {
    background: #f59e0b !important;
    left: 20% !important;
    animation-delay: 2.5s !important;
}

.confetti-7 {
    background: #ec4899 !important;
    left: 60% !important;
    animation-delay: 3s !important;
}

.confetti-8 {
    background: #06b6d4 !important;
    left: 40% !important;
    animation-delay: 3.5s !important;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-50px) rotate(0deg) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(-30px) rotate(36deg) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(350px) rotate(324deg) scale(1);
    }
    100% {
        transform: translateY(400px) rotate(360deg) scale(0);
        opacity: 0;
    }
}

/* New temp2.html Card Layout */
.card-wrapper-gradient {
    position: relative;
    padding: 6px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 20%, #a1c4fd 60%, #c2e9fb 100%);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    max-width: 350px;
    width: 100%;
    animation: float-card 6s ease-in-out infinite;
}

.info-card-new {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    /* overflow: hidden; -- Removed to allow icons to float outside */
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Typography for new layout */
.card-name-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #222;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.card-meaning-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.card-details-list {
    margin-top: 1rem;
}

.card-detail-item {
    margin-bottom: 1rem;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.detail-label {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

/* Icons & Animations from temp2.html */
.icon {
    position: absolute;
    z-index: 0;
}

/* Sun Animations */
.sun-top {
    top: -20px;
    left: -20px;
    width: 100px;
    height: 100px;
    animation: spin 12s linear infinite;
}

.sun-bottom {
    bottom: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    animation: spin 15s linear infinite reverse;
}

/* Stars */
.star {
    width: 30px;
    height: 30px;
    animation: twinkle 3s ease-in-out infinite;
}

.star-1 { top: 30px; right: 50px; fill: #ffd700; animation-delay: 0s; }
.star-2 { width: 20px; height: 20px; fill: #ff9a9e; animation-delay: 1s; }
.star-3 { top: 20px; right: 80px; width: 15px; height: 15px; fill: #81ecec; animation-delay: 0.5s; }
.star-4 { bottom: 45px; left: 30px; width: 25px; height: 25px; fill: #ffeaa7; animation-delay: 1.5s; }
.star-5 { bottom: 30px; left: 80px; width: 20px; height: 20px; fill: #a29bfe; animation-delay: 2s; }
.star-6 { top: 30% !important;left: 75% !important; width: 18px; height: 18px; fill: #dfe6e9; animation-delay: 0.8s; }

/* Content positioning */
.content {
    position: relative;
    z-index: 1;
}

/* Card Container Enhancements */
.card-container {
    position: relative !important;
    z-index: 2;
    animation: float-card 6s ease-in-out infinite;
    min-height: 400px;
    width: 100%;
}

.info-card {
    position: relative;
    z-index: 3;
    /* Test animation - should be visible */
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { 
        border: 2px solid rgba(59, 130, 246, 0.3);
    }
    50% { 
        border: 2px solid rgba(59, 130, 246, 0.8);
    }
}

@keyframes test-pulse {
    0%, 100% { 
        transform: scale(1);
    }
    50% { 
        transform: scale(1.5);
    }
}

@keyframes simple-fall {
    0% {
        transform: translateY(0px);
        opacity: 1;
    }
    100% {
        transform: translateY(120px);
        opacity: 0;
    }
}

/* New temp2.html animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes twinkle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.8); opacity: 0.7; }
}

/* No Data Message Styling */
.no-data-message {
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.no-data-message:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.no-data-message i {
    display: block;
    margin-bottom: 12px;
}

.no-data-message p {
    margin: 0;
    font-weight: 500;
}

@keyframes float-card {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    50% { 
        transform: translateY(-10px) rotate(1deg); 
    }
}

/* Sparkle Effects */
.sparkle {
    position: absolute !important;
    width: 8px !important;
    height: 8px !important;
    background: #fbbf24 !important;
    border-radius: 50% !important;
    animation: sparkle 2s ease-in-out infinite !important;
    z-index: 15 !important;
    border: 2px solid #fff !important;
}

.sparkle-1 {
    top: 25%;
    left: 15%;
    animation-delay: 0s;
}

.sparkle-2 {
    top: 70%;
    left: 25%;
    animation-delay: 0.7s;
}

.sparkle-3 {
    top: 45%;
    left: 5%;
    animation-delay: 1.4s;
}

@keyframes sparkle {
    0%, 100% { 
        opacity: 0; 
        transform: scale(0); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.5); 
    }
}

/* Enhanced Card Labels */
.card-label {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.card-section {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(248, 250, 252, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.5);
    transition: all 0.2s ease;
}

.card-section:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Card Title Enhancement */
.card-title {
    background: linear-gradient(135deg, #1e293b, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.card-full-meaning {
    color: #64748b;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Pronunciation Cards */
.pronunciation-card {
    transition: all 0.3s ease;
}

.pronunciation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.pronunciation-play-btn {
    transition: all 0.2s ease;
}

.pronunciation-play-btn:hover {
    background: #2563eb !important;
    transform: translateY(-1px);
}

/* Enhanced Hero Tags */
.gender-tag {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
}

.pronunciation-tag {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.1));
    border-color: rgba(245, 158, 11, 0.2);
}

.ipa-tag {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    border-color: rgba(16, 185, 129, 0.2);
}

.origin-tag {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(79, 70, 229, 0.1));
    border-color: rgba(99, 102, 241, 0.2);
}

.religion-tag {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(185, 28, 28, 0.1));
    border-color: rgba(220, 38, 38, 0.2);
}

.language-tag {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(109, 40, 217, 0.1));
    border-color: rgba(124, 58, 237, 0.2);
}

/* New Section Styles */
.secondary-languages-grid .language-card {
    transition: all 0.3s ease;
}

.secondary-languages-grid .language-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #6366f1;
}

.religious-card {
    transition: all 0.3s ease;
}

.religious-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.historical-research-container {
    transition: all 0.3s ease;
}

.historical-research-container:hover {
    background: #f1f5f9;
    border-left-color: #2563eb;
}

.source-item {
    transition: all 0.3s ease;
}

.source-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left-color: #059669;
}

.famous-card {
    transition: all 0.3s ease;
}

.famous-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Enhanced Data Cards */
.data-card-mini:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Country Rankings Cards */
.data-grid .data-card-mini .mini-icon .fa-flag-usa {
    animation: wave-flag 2s ease-in-out infinite;
}

@keyframes wave-flag {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(2deg); }
    75% { transform: rotate(-2deg); }
}

/* Enhanced Mobile Navigation */
.mobile-sticky-nav {
    scroll-behavior: smooth;
    scrollbar-width: thin; /* Firefox - show thin scrollbar */
    scrollbar-color: linear-gradient(90deg, #3b82f6, #6366f1) transparent; /* Firefox gradient */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Custom Gradient Scrollbar for Webkit browsers */
.mobile-sticky-nav::-webkit-scrollbar {
    height: 4px;
    background: transparent;
}

.mobile-sticky-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.mobile-sticky-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #3b82f6, #6366f1, #8b5cf6);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-sticky-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #2563eb, #4f46e5, #7c3aed);
}

.mobile-sticky-nav.is-scrolling {
    scroll-behavior: auto; /* Disable smooth scroll during manual scrolling */
}

.mobile-nav-link {
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.mobile-nav-link.active {
    transform: scale(1.05);
    font-weight: 700;
    color: #fff !important; /* White text for active state */
}

.mobile-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, #fff, #f1f5f9);
    border-radius: 2px;
    animation: active-indicator 0.3s ease-out;
}

@keyframes active-indicator {
    0% {
        width: 0%;
        opacity: 0;
    }
    100% {
        width: 80%;
        opacity: 1;
    }
}

/* Sidebar Navigation Enhancements */
.sidebar-nav a {
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-nav a.active {
    font-weight: 700;
    color: #fff;
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6, #6366f1);
    border-radius: 2px;
    animation: sidebar-indicator 0.3s ease-out;
}

@keyframes sidebar-indicator {
    0% {
        height: 0%;
        opacity: 0;
    }
    100% {
        height: 100%;
        opacity: 1;
    }
}

/* Verification Badge Styles */
.verification-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.accuracy-high {
    background: linear-gradient(135deg, #10b981, #059669);
}

.accuracy-medium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.accuracy-low {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* AdSense Container Styles */
.adsense-container {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.adsense-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.adsense-placeholder {
    transition: all 0.3s ease;
    cursor: pointer;
}

.adsense-placeholder:hover {
    transform: scale(1.02);
}

/* Responsive AdSense */
@media (min-width: 768px) {
    .adsense-sidebar {
        display: block !important; /* Show sidebar ads on desktop */
    }
    
    .adsense-after-hero,
    .adsense-mid-content,
    .adsense-before-faq {
        max-width: 728px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 767px) {
    .adsense-sidebar {
        display: none !important; /* Hide sidebar ads on mobile */
    }
    
    .adsense-after-hero,
    .adsense-mid-content,
    .adsense-before-faq {
        margin: 20px 0;
        padding: 0 15px;
    }
    
    .adsense-placeholder {
        padding: 20px 15px !important;
        font-size: 12px !important;
    }
}

/* AdSense Animation */
@keyframes adsense-fade-in {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.adsense-container {
    animation: adsense-fade-in 0.6s ease-out;
}

/* Stagger animation for multiple ads */
.adsense-after-hero {
    animation-delay: 0.2s;
}

.adsense-mid-content {
    animation-delay: 0.4s;
}

.adsense-sidebar {
    animation-delay: 0.6s;
}

.adsense-before-faq {
    animation-delay: 0.8s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-info-tags {
        justify-content: center;
    }
    
    .hero-tag {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .star-deco, .sun-deco {
        display: none;
    }
    
    .confetti {
        display: none;
    }
    
    .pronunciation-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* New card responsive styles */
    .card-wrapper-gradient {
        max-width: 100%;
        margin: 0 auto;
    }
    
    .card-name-title {
        font-size: 2rem;
    }
    
    .card-meaning-text {
        font-size: 1rem;
    }
    
    .card-detail-item {
        font-size: 0.9rem;
    }
    /*
    .sun-top, .sun-bottom {
        display: none;
    }
    
    .star {
        display: none;
    }
    */
    .secondary-languages-grid {
        grid-template-columns: 1fr !important;
    }
    
    .language-card {
        padding: 14px !important;
    }
    
    .sources-grid {
        gap: 8px !important;
    }
    
    .source-item {
        padding: 12px !important;
    }
}