/* ==========================================
   VISUAL ENHANCEMENTS - Premium Design
   Dynamic effects, animations, and polish
   ========================================== */

/* ==========================================
   1. CUSTOM SCROLLBAR
   ========================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--cream, #faf8f3);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--emerald-deep, #0d4d3d), var(--emerald-medium, #1a6b54));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--champagne-gold, #d4af37), var(--gold-light, #e8c96f));
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--emerald-deep, #0d4d3d) var(--cream, #faf8f3);
}

/* ==========================================
   2. GLASSMORPHISM NAVBAR
   ========================================== */
.navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

body.dark-mode .navbar {
    background: rgba(26, 26, 26, 0.85) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================
   3. DYNAMIC GRADIENT HERO BACKGROUND
   ========================================== */
.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(212, 175, 55, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(13, 77, 61, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(232, 201, 111, 0.1) 0%, transparent 30%);
    animation: gradientFloat 15s ease-in-out infinite;
    z-index: -1;
}

@keyframes gradientFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, 2%) rotate(1deg); }
    50% { transform: translate(-1%, 3%) rotate(-1deg); }
    75% { transform: translate(3%, -2%) rotate(2deg); }
}

/* Page header gradient animation */
.page-header,
.article-header {
    position: relative;
    overflow: hidden;
}

.page-header::before,
.article-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmerHeader 3s infinite;
}

@keyframes shimmerHeader {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ==========================================
   4. GRADIENT TEXT ANIMATION
   ========================================== */
.hero-title,
.page-header h1,
.section-title {
    background-size: 200% auto;
    animation: gradientText 4s linear infinite;
}

@keyframes gradientText {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

/* Shine effect on titles */
.hero-title::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: titleShine 5s ease-in-out infinite;
}

@keyframes titleShine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

/* ==========================================
   5. ENHANCED CARD HOVER ANIMATIONS
   ========================================== */
.blog-card,
.service-card,
.problem-card,
.product-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.blog-card:hover,
.service-card:hover,
.problem-card:hover,
.product-card:hover {
    transform: translateY(-15px) rotateX(5deg);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(212, 175, 55, 0.1);
}

/* Glow effect on hover */
.blog-card::after,
.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.3);
    pointer-events: none;
}

.blog-card:hover::after,
.service-card:hover::after {
    opacity: 1;
}

/* ==========================================
   6. LAYERED SHADOWS
   ========================================== */
.service-card,
.blog-card,
.sidebar-card,
.calculator-card {
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 8px 16px rgba(0, 0, 0, 0.06),
        0 16px 32px rgba(0, 0, 0, 0.08);
}

/* ==========================================
   7. IMAGE HOVER ZOOM
   ========================================== */
.blog-image {
    overflow: hidden;
    position: relative;
}

.blog-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 0;
}

.blog-card:hover .blog-image::before {
    transform: scale(1.1);
}

/* Overlay gradient on hover */
.blog-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.blog-card:hover .blog-image::after {
    opacity: 1;
}

/* ==========================================
   8. BUTTON RIPPLE EFFECT
   ========================================== */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* ==========================================
   9. NAVIGATION UNDERLINE ANIMATION
   ========================================== */
.nav-menu a:not(.btn-nav) {
    position: relative;
}

.nav-menu a:not(.btn-nav)::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--champagne-gold), var(--gold-light));
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translateX(-50%);
}

.nav-menu a:not(.btn-nav):hover::after {
    width: 100%;
}

/* ==========================================
   10. QUOTE/BLOCKQUOTE STYLING
   ========================================== */
blockquote,
.article-body blockquote {
    position: relative;
    padding: 30px 40px;
    margin: 30px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid var(--champagne-gold);
    border-radius: 0 15px 15px 0;
    font-style: italic;
    font-size: 1.1rem;
    color: #555;
}

blockquote::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 60px;
    font-family: Georgia, serif;
    color: var(--champagne-gold);
    opacity: 0.3;
    line-height: 1;
}

body.dark-mode blockquote {
    background: linear-gradient(135deg, #2d2d2d 0%, #3d3d3d 100%);
    color: #ccc;
}

/* ==========================================
   11. SCROLL-TRIGGERED ANIMATIONS
   ========================================== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for grids */
.blog-grid .blog-card,
.services-grid .service-card,
.problems-grid .problem-card {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 0.6s ease forwards;
}

.blog-grid .blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-grid .blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-grid .blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-grid .blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-grid .blog-card:nth-child(5) { animation-delay: 0.5s; }
.blog-grid .blog-card:nth-child(6) { animation-delay: 0.6s; }

.services-grid .service-card:nth-child(1) { animation-delay: 0.1s; }
.services-grid .service-card:nth-child(2) { animation-delay: 0.2s; }
.services-grid .service-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   12. DECORATIVE FLOATING SHAPES
   ========================================== */
.hero::after {
    content: '☯';
    position: absolute;
    top: 20%;
    right: 10%;
    font-size: 150px;
    opacity: 0.03;
    animation: floatShape 6s ease-in-out infinite;
    pointer-events: none;
}

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

/* Additional decorative elements */
.problems::before {
    content: '卦';
    position: absolute;
    top: 10%;
    left: 5%;
    font-size: 200px;
    opacity: 0.02;
    font-family: 'Noto Sans SC', sans-serif;
    pointer-events: none;
}

/* ==========================================
   13. CUSTOM CURSOR (Desktop Only)
   ========================================== */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: none;
    }

    .custom-cursor {
        width: 20px;
        height: 20px;
        border: 2px solid var(--champagne-gold);
        border-radius: 50%;
        position: fixed;
        pointer-events: none;
        z-index: 99999;
        transition: transform 0.15s ease, background 0.15s ease;
        mix-blend-mode: difference;
    }

    .custom-cursor.hover {
        transform: scale(1.5);
        background: rgba(212, 175, 55, 0.3);
    }

    .custom-cursor-dot {
        width: 5px;
        height: 5px;
        background: var(--champagne-gold);
        border-radius: 50%;
        position: fixed;
        pointer-events: none;
        z-index: 99999;
    }

    a, button, .btn, input, textarea, select {
        cursor: none;
    }
}

/* ==========================================
   14. FLOATING PARTICLES (Subtle)
   ========================================== */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--champagne-gold);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 20s infinite linear;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ==========================================
   15. SKELETON LOADING
   ========================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 2em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-image {
    height: 200px;
    width: 100%;
}

/* ==========================================
   16. FOCUS STATES (Accessibility)
   ========================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--champagne-gold);
    outline-offset: 3px;
}

/* ==========================================
   17. SMOOTH TRANSITIONS EVERYWHERE
   ========================================== */
*,
*::before,
*::after {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

/* Exclude elements that need instant response */
input,
textarea,
[role="button"],
button {
    transition-property: background-color, border-color, box-shadow, transform;
}

/* ==========================================
   18. ENHANCED FEATURED BADGE ANIMATION
   ========================================== */
.service-badge {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ==========================================
   19. CTA BOX GLOW
   ========================================== */
.article-cta,
.cta-box {
    position: relative;
    overflow: hidden;
}

.article-cta::before,
.cta-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(212, 175, 55, 0.1),
        transparent,
        rgba(212, 175, 55, 0.1),
        transparent
    );
    animation: ctaGlow 4s linear infinite;
}

@keyframes ctaGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   20. PRODUCT PROMO BANNER ANIMATION
   ========================================== */
.promo-banner {
    position: relative;
    overflow: hidden;
}

.promo-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: promoBannerShine 3s ease-in-out infinite;
}

@keyframes promoBannerShine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* ==========================================
   DARK MODE ADJUSTMENTS
   ========================================== */
body.dark-mode .skeleton {
    background: linear-gradient(
        90deg,
        #3d3d3d 25%,
        #4d4d4d 50%,
        #3d3d3d 75%
    );
    background-size: 200% 100%;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #1a1a1a;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4CAF50, #2e7d32);
}

/* ==========================================
   REDUCED MOTION PREFERENCE
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
