/* =============================================
   REFRESH 2026 — visual modernization layer
   Loaded AFTER main.css, overrides via specificity
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
    --color-violet: #9382fb;
    --color-blue: #299bfd;
    --color-light-blue: #a3dffe;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--color-violet) #0a0a1a;
}

/* =============================================
   1. GLASSMORPHISM NAVIGATION
   ============================================= */
.navigation {
    transition: height 0.8s ease;
}

.navigation_scrolled {
    background: rgba(15, 20, 60, 0.85);
    border-bottom: 1px solid rgba(147, 130, 251, 0.12);
}

.navigation_scrolled:before {
    opacity: 0 !important;
}

/* Desktop only — underline + subtle hover color */
@media (min-width: 1200px) {
    .menu-item__link {
        position: relative;
        transition: color 0.3s ease, text-shadow 0.3s ease;
    }

    .menu-item__link:hover {
        color: var(--color-light-blue);
        text-shadow: 0 0 8px rgba(163, 223, 254, 0.4);
    }

    .menu-item__link.is-active {
        color: var(--color-light-blue);
    }

    .menu-item__link::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 50%;
        width: 0;
        height: 2px;
        background: linear-gradient(90deg, var(--color-blue), var(--color-violet));
        transition: width 0.3s var(--ease-out-expo), left 0.3s var(--ease-out-expo);
        border-radius: 2px;
    }

    .menu-item__link:hover::after,
    .menu-item__link.is-active::after {
        width: 100%;
        left: 0;
    }
}

/* =============================================
   2. GLOW PULSE — home title
   ============================================= */
@keyframes glow-pulse {
    0%, 100% {
        text-shadow:
            .1em 0 .5em #9382fb,
            -.1em 0 .5em #9382fb,
            0 .1em .5em #9382fb,
            0 -.1em .5em #9382fb;
    }
    50% {
        text-shadow:
            .2em 0 1.2em #9382fb,
            -.2em 0 1.2em #9382fb,
            0 .2em 1.2em #9382fb,
            0 -.2em 1.2em #9382fb,
            0 0 2.5em rgba(147, 130, 251, 0.35);
    }
}

.home__title .light-violet {
    animation: glow-pulse 3.5s ease-in-out infinite;
}

@keyframes glow-pulse-blue {
    0%, 100% {
        text-shadow:
            .1em 0 .5em #a3dffe,
            -.1em 0 .5em #a3dffe;
    }
    50% {
        text-shadow:
            .2em 0 1.2em #a3dffe,
            -.2em 0 1.2em #a3dffe,
            0 0 2em rgba(163, 223, 254, 0.3);
    }
}

.home__title .light-blue {
    animation: glow-pulse-blue 3.5s ease-in-out infinite;
}

/* =============================================
   3. LOGO REVEAL — contour glow via drop-shadow
   ============================================= */
.home__logo img {
    opacity: 0;
    filter: drop-shadow(0 0 0 transparent);
    animation: logoContourIn 2s ease 0.2s forwards;
}

@keyframes logoContourIn {
    0% {
        opacity: 0;
        filter: drop-shadow(0 0 0 transparent);
    }
    40% {
        opacity: 1;
        filter: drop-shadow(0 0 6px rgba(120, 200, 255, 0.6))
                drop-shadow(0 0 20px rgba(147, 130, 251, 0.4));
    }
    100% {
        opacity: 1;
        filter: drop-shadow(0 0 8px rgba(120, 200, 255, 0.5))
                drop-shadow(0 0 25px rgba(147, 130, 251, 0.3))
                drop-shadow(0 0 50px rgba(100, 80, 220, 0.15));
    }
}

/* =============================================
   4. SCROLL REVEAL ANIMATIONS
   ============================================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(35px); }
    to   { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    will-change: transform, opacity;
}

.reveal.is-visible {
    animation: fadeInUp 0.7s var(--ease-out-expo) forwards;
}

/* Stagger delays for cards in a row */
.reveal-stagger-2 { animation-delay: 0.1s; }
.reveal-stagger-3 { animation-delay: 0.2s; }
.reveal-stagger-4 { animation-delay: 0.3s; }
.reveal-stagger-5 { animation-delay: 0.4s; }

/* =============================================
   5. CARD HOVER EFFECTS
   ============================================= */
.course-card {
    transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s ease;
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 20px 50px rgba(147, 130, 251, 0.15),
        0 8px 20px rgba(0, 0, 0, 0.3);
}

.news-card,
.project-card,
.library-card,
.library-carousel__item,
.shop-card {
    transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s ease;
}

.news-card:hover,
.project-card:hover,
.library-card:hover,
.shop-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 15px 40px rgba(147, 130, 251, 0.12),
        0 5px 15px rgba(0, 0, 0, 0.25);
}

.library-carousel__item:hover {
    transform: translateY(-4px);
}

/* =============================================
   6. GRADIENT TEXT — section headers
   ============================================= */
.header__title {
    background: linear-gradient(135deg, #fff 0%, var(--color-light-blue) 50%, var(--color-violet) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header__title_highlight {
    background: linear-gradient(135deg, var(--color-light-blue) 0%, var(--color-violet) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================
   7. BUTTON ENHANCEMENTS
   ============================================= */
.btn_fill {
    transition: box-shadow 0.4s ease, opacity 0.3s ease !important;
}

.btn_fill:hover {
    box-shadow:
        0 0 15px rgba(41, 155, 253, 0.3),
        0 0 30px rgba(147, 130, 251, 0.15);
}

.btn_fill:active {
    opacity: 0.85;
    transition: opacity 0.1s ease !important;
}

.btn_border {
    transition: border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease !important;
}

.btn_border:hover {
    border-color: #fff !important;
    color: #fff !important;
    box-shadow: 0 0 12px rgba(147, 130, 251, 0.25);
}

.btn_border:active {
    opacity: 0.85;
    transition: opacity 0.1s ease !important;
}

/* =============================================
   8. PARALLAX HEADER BACKGROUNDS
   Only will-change hint — layout stays untouched.
   ============================================= */
.header__bg img {
    will-change: transform;
}

/* =============================================
   9. PAGE & HOME ENTRANCE ANIMATIONS
   ============================================= */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

.content {
    animation: fadeSlideUp 0.5s var(--ease-out-expo) both;
}

.page_home .home__title {
    animation: fadeSlideUp 0.9s var(--ease-out-expo) 0.5s both;
}

.page_home .home__action {
    animation: fadeSlideUp 0.7s var(--ease-out-expo) 0.8s both;
}

.page_home .home__info {
    animation: fadeSlideUp 0.7s var(--ease-out-expo) 1s both;
}

/* =============================================
   10. PARTICLES CANVAS
   ============================================= */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.page_home .page__inner {
    position: relative;
}

.page_home .home {
    position: relative;
    z-index: 1;
}

/* =============================================
   11. POPUP ENHANCEMENTS
   ============================================= */
@keyframes popupIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.popup.is-open .popup__layout {
    animation: popupIn 0.4s var(--ease-out-expo);
}

.popup__overlay {
    transition: opacity 0.3s ease !important;
}

/* =============================================
   12. FOOTER
   ============================================= */
.footer {
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(147, 130, 251, 0.3), transparent);
}

.footer-social__item {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}

.footer-social__item:hover {
    transform: translateY(-3px) scale(1.1);
    color: var(--color-violet);
}

/* =============================================
   13. SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0a0a1a; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-violet), var(--color-blue));
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a593ff, #3aabff);
}

/* =============================================
   14. MISC
   ============================================= */
::selection {
    background: rgba(147, 130, 251, 0.35);
    color: #fff;
}

.chip {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.chip:hover {
    transform: scale(1.05);
}

.tag {
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tag:hover {
    transform: translateY(-1px);
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.4); }
}

.dot.color-green {
    display: inline-block;
    animation: dot-pulse 2s ease-in-out infinite;
}

/* =============================================
   15. INPUT FOCUS GLOW
   ============================================= */
.form-input input[type="text"],
.form-input input[type="email"],
.form-input input[type="password"],
.form-input textarea,
.navigation-search__input {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.form-input input[type="text"]:focus,
.form-input input[type="email"]:focus,
.form-input input[type="password"]:focus,
.form-input textarea:focus,
.navigation-search__input:focus {
    box-shadow: 0 0 0 3px rgba(41, 155, 253, 0.2), 0 0 12px rgba(147, 130, 251, 0.15);
    border-color: var(--color-blue);
    outline: none;
}

/* =============================================
   16. PAGINATION HOVER
   ============================================= */
.pagination__item {
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.pagination__item:hover:not(.is-active) {
    background: rgba(41, 155, 253, 0.1);
    color: var(--color-blue);
    transform: translateY(-2px);
}

.pagination__item.is-active {
    box-shadow: 0 3px 10px rgba(41, 155, 253, 0.3);
}

/* =============================================
   17. NOTIFICATION BADGE PULSE
   ============================================= */
@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.navigation-messages__count {
    animation: badge-pulse 2.5s ease-in-out infinite;
}

/* =============================================
   18. LAZY-LOAD IMAGE FADE
   ============================================= */
.project-card__image img,
.shop-card__image img {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.project-card__image img.loaded,
.shop-card__image img.loaded {
    opacity: 1;
}

/* =============================================
   19. TOOLTIP / DROPDOWN ANIMATION
   ============================================= */
.tippy-box {
    animation: tooltipIn 0.2s var(--ease-out-expo);
}

@keyframes tooltipIn {
    from { opacity: 0; transform: translateY(-5px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.navigation-dropdown {
    animation: tooltipIn 0.25s var(--ease-out-expo);
}

/* =============================================
   20. SEARCH FIELD ANIMATION
   Original main.css uses top:0 (hidden) → top:100% (open).
   We add transition on top + opacity for smooth open/close.
   ============================================= */
@media (min-width: 1200px) {
    .navigation-search__field {
        transition: top 0.3s var(--ease-out-expo), opacity 0.3s ease !important;
    }
}

/* =============================================
   21. ICON MICRO-ANIMATIONS
   ============================================= */
/* Heart favorite — bounce on click */
@keyframes heart-pop {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.course-card__fav.is-favorite .icon-custom,
.lesson-card__fav.is-favorite .icon-custom {
    animation: heart-pop 0.4s ease;
    color: #ff4d6a;
}

/* Bell — ring on hover */
@keyframes bell-ring {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(12deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(6deg); }
    80% { transform: rotate(-3deg); }
}

.navigation-messages:hover .icon-notifications {
    animation: bell-ring 0.6s ease;
    transform-origin: top center;
}

/* Letter icon — subtle bounce on hover */
.navigation-messages:hover .icon-letter {
    animation: heart-pop 0.4s ease;
}

/* =============================================
   22. COURSE PROGRESS BAR (ready for template integration)
   ============================================= */
.course-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.course-progress__bar {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--color-blue), var(--color-violet));
    transition: width 0.6s var(--ease-out-expo);
    position: relative;
}

.course-progress__bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    filter: blur(4px);
    border-radius: 2px;
}

/* =============================================
   23. REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; }
    #particles-canvas { display: none; }
}
