/* =============================================================================
 * Avalonia Gaming Effects v1.0 — gaming aesthetic visual polish
 * =============================================================================
 * Tilt cards, neon borders, live pulse, glitch numbers, scanlines, toast,
 * latency bars, cursor trail. Vanilla CSS, no framework.
 * Respektuje prefers-reduced-motion + mobile.
 * ========================================================================== */

/* -------------------------------------------------------------------------- */
/*  1) NEON GRADIENT BORDER — server rows + feature cards                     */
/* -------------------------------------------------------------------------- */
.server-row,
.feature-card,
.stat-box,
.faq-item {
    position: relative;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
    will-change: transform;
}

/* Neon glow border — objaví sa na hover */
.server-row::after,
.feature-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(var(--secondary-color-rgb, 124, 58, 237), 0.8) 25%,
        rgba(var(--tertiary-color-rgb, 168, 85, 247), 1) 50%,
        rgba(var(--secondary-color-rgb, 124, 58, 237), 0.8) 75%,
        transparent 100%
    );
    background-size: 300% 300%;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
    animation: neonFlow 3s linear infinite paused;
}

.server-row:hover::after,
.feature-card:hover::after {
    opacity: 1;
    animation-play-state: running;
}

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

.server-row:hover,
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 40px rgba(var(--secondary-color-rgb, 124, 58, 237), 0.25),
        0 0 30px rgba(var(--tertiary-color-rgb, 168, 85, 247), 0.15);
}

/* -------------------------------------------------------------------------- */
/*  2) LIVE STATUS PULSE — zelený bod pri online serveroch                   */
/* -------------------------------------------------------------------------- */
.stat-value.online {
    position: relative;
    padding-left: 18px !important;
}

.stat-value.online::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: livePulse 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0    rgba(34, 197, 94, 0.7); transform: scale(1); }
    50%  { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);   transform: scale(1.15); }
    100% { box-shadow: 0 0 0 0    rgba(34, 197, 94, 0);   transform: scale(1); }
}

/* Offline pulse — tlmený červený */
.stat-value.offline {
    position: relative;
    padding-left: 18px !important;
    opacity: 0.7;
}

.stat-value.offline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-radius: 50%;
    background: #ef4444;
    opacity: 0.6;
}

/* -------------------------------------------------------------------------- */
/*  3) SERVER ICON GLOW — ikony serverov svietia                             */
/* -------------------------------------------------------------------------- */
.server-row-icon {
    position: relative;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: visible;
}

.server-row-icon::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    background: radial-gradient(circle at center,
        rgba(var(--secondary-color-rgb, 124, 58, 237), 0.4),
        transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    filter: blur(8px);
    z-index: -1;
}

.server-row:hover .server-row-icon {
    transform: scale(1.1) rotate(-3deg);
}

.server-row:hover .server-row-icon::before {
    opacity: 1;
}

/* Game-specific icon colors + hover glow */
.server-row-icon.minecraft::before { background: radial-gradient(circle, rgba(34, 197, 94, 0.5), transparent 70%); }
.server-row-icon.hytale::before    { background: radial-gradient(circle, rgba(249, 115, 22, 0.5), transparent 70%); }
.server-row-icon.discord::before   { background: radial-gradient(circle, rgba(88, 101, 242, 0.5), transparent 70%); }
.server-row-icon.nmrih::before     { background: radial-gradient(circle, rgba(239, 68, 68, 0.5), transparent 70%); }

/* -------------------------------------------------------------------------- */
/*  4) FEATURE CARD ICON — rotating glow ring                                 */
/* -------------------------------------------------------------------------- */
.feature-icon {
    position: relative;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.feature-icon::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: inherit;
    border: 2px solid transparent;
    border-top-color: rgba(var(--tertiary-color-rgb, 168, 85, 247), 0.8);
    border-right-color: rgba(var(--secondary-color-rgb, 124, 58, 237), 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: spinRing 2s linear infinite;
}

.feature-card:hover .feature-icon {
    transform: scale(1.15) rotate(5deg);
}

.feature-card:hover .feature-icon::after {
    opacity: 1;
}

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

/* -------------------------------------------------------------------------- */
/*  5) STAT NUMBER GLITCH — digital feel na hero statoch                     */
/* -------------------------------------------------------------------------- */
.stat-number {
    position: relative;
    display: inline-block;
    font-variant-numeric: tabular-nums;
    text-shadow:
        0 0 15px rgba(var(--tertiary-color-rgb, 168, 85, 247), 0.4),
        0 0 30px rgba(var(--secondary-color-rgb, 124, 58, 237), 0.2);
}

.stat-box:hover .stat-number {
    animation: digitalGlitch 0.4s ease-out;
}

@keyframes digitalGlitch {
    0%   { transform: translate(0); text-shadow: 0 0 15px rgba(var(--tertiary-color-rgb, 168, 85, 247), 0.4); }
    20%  { transform: translate(-1px, 1px);  text-shadow: 2px 0 0 rgba(255, 0, 100, 0.7), -2px 0 0 rgba(0, 200, 255, 0.7); }
    40%  { transform: translate(1px, -1px);  text-shadow: -2px 0 0 rgba(255, 0, 100, 0.7), 2px 0 0 rgba(0, 200, 255, 0.7); }
    60%  { transform: translate(-1px, -1px); text-shadow: 2px 0 0 rgba(255, 0, 100, 0.7), -2px 0 0 rgba(0, 200, 255, 0.7); }
    80%  { transform: translate(1px, 1px);   text-shadow: -2px 0 0 rgba(255, 0, 100, 0.7), 2px 0 0 rgba(0, 200, 255, 0.7); }
    100% { transform: translate(0); text-shadow: 0 0 15px rgba(var(--tertiary-color-rgb, 168, 85, 247), 0.4); }
}

/* -------------------------------------------------------------------------- */
/*  6) SCANLINE OVERLAY — retro CRT feel cez hero                             */
/* -------------------------------------------------------------------------- */
#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 2px,
        rgba(255, 255, 255, 0.015) 2px,
        rgba(255, 255, 255, 0.015) 3px
    );
    z-index: 1;
    opacity: 0.6;
}

/* -------------------------------------------------------------------------- */
/*  7) LATENCY BAR — "ping" animované stĺpce pri online serveroch            */
/* -------------------------------------------------------------------------- */
.latency-bar {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
    margin-left: 8px;
    vertical-align: middle;
}

.latency-bar span {
    display: block;
    width: 3px;
    background: linear-gradient(to top, #22c55e, #4ade80);
    border-radius: 1px;
    animation: latencyPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.6);
}

.latency-bar span:nth-child(1) { height: 30%; animation-delay: 0s;    }
.latency-bar span:nth-child(2) { height: 55%; animation-delay: 0.15s; }
.latency-bar span:nth-child(3) { height: 75%; animation-delay: 0.3s;  }
.latency-bar span:nth-child(4) { height: 100%; animation-delay: 0.45s; }

@keyframes latencyPulse {
    0%, 100% { opacity: 0.4; transform: scaleY(0.8); }
    50%      { opacity: 1;   transform: scaleY(1); }
}

/* -------------------------------------------------------------------------- */
/*  8) CYBERPUNK SECTION TITLE — gaming header                                */
/* -------------------------------------------------------------------------- */
.section-title {
    position: relative;
    display: inline-block;
}

.section-title::before {
    content: '[ ';
    color: var(--tertiary-color);
    opacity: 0.5;
    font-weight: 400;
}

.section-title::after {
    content: ' ]';
    color: var(--tertiary-color);
    opacity: 0.5;
    font-weight: 400;
}

/* -------------------------------------------------------------------------- */
/*  9) ACHIEVEMENT TOAST                                                      */
/* -------------------------------------------------------------------------- */
.achievement-toast {
    position: fixed;
    bottom: 30px;
    right: -400px;
    width: 340px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(135deg,
        rgba(10, 10, 20, 0.98),
        rgba(20, 10, 40, 0.98));
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(var(--tertiary-color-rgb, 168, 85, 247), 0.3);
    z-index: 10000;
    transition: right 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    background-clip: padding-box;
}

.achievement-toast::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg,
        var(--secondary-color),
        var(--tertiary-color),
        var(--secondary-color));
    background-size: 200% 200%;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    animation: neonFlow 2s linear infinite;
    pointer-events: none;
}

.achievement-toast.show { right: 30px; }

.achievement-toast-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
    animation: trophySpin 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes trophySpin {
    0%   { transform: rotate(-180deg) scale(0); }
    100% { transform: rotate(0deg) scale(1); }
}

.achievement-toast-text { flex: 1; min-width: 0; }

.achievement-toast-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #fbbf24;
    margin-bottom: 3px;
}

.achievement-toast-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -------------------------------------------------------------------------- */
/*  10) CURSOR TRAIL DOT (desktop only, na optional usage)                    */
/* -------------------------------------------------------------------------- */
.cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tertiary-color, #a855f7);
    box-shadow: 0 0 10px var(--tertiary-color, #a855f7);
    pointer-events: none;
    z-index: 10001;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.15s ease;
    mix-blend-mode: screen;
}

.cursor-trail.visible { opacity: 0.7; }

/* -------------------------------------------------------------------------- */
/*  11) COUNT-UP NUMBERS — keď statistika poskočí                            */
/* -------------------------------------------------------------------------- */
.counting::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 0.9em;
    background: var(--tertiary-color);
    margin-left: 3px;
    animation: cursorBlink 0.8s step-end infinite;
    vertical-align: middle;
}

@keyframes cursorBlink {
    50% { opacity: 0; }
}

/* -------------------------------------------------------------------------- */
/*  12) HEADER SCROLL — backdrop blur intensifies                            */
/* -------------------------------------------------------------------------- */
#header {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: backdrop-filter 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

#header.scrolled {
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    background: rgba(10, 10, 20, 0.85) !important;
    border-bottom-color: rgba(var(--tertiary-color-rgb, 168, 85, 247), 0.4) !important;
    box-shadow: 0 4px 30px rgba(var(--secondary-color-rgb, 124, 58, 237), 0.15);
}

/* -------------------------------------------------------------------------- */
/*  13) CTA SECTION — intense gaming glow                                     */
/* -------------------------------------------------------------------------- */
.cta-section {
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 300%;
    background: radial-gradient(ellipse at center,
        rgba(var(--secondary-color-rgb, 124, 58, 237), 0.25),
        transparent 50%);
    transform: translate(-50%, -50%);
    animation: ctaGlowRotate 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.cta-section > .container { position: relative; z-index: 1; }

@keyframes ctaGlowRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* -------------------------------------------------------------------------- */
/*  14) FAQ ACCORDION — smooth expand animation                              */
/* -------------------------------------------------------------------------- */
.faq-item {
    overflow: hidden;
}

.faq-question {
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.faq-question:hover {
    color: var(--tertiary-color);
    padding-left: 6px;
}

.faq-question i {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.faq-item.open .faq-question i {
    transform: rotate(180deg);
}

/* -------------------------------------------------------------------------- */
/*  15) BUTTON HOVER — scanning shine                                         */
/* -------------------------------------------------------------------------- */
.btn-main {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.25) 50%,
        transparent 100%);
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
}

.btn-main:hover::before {
    left: 100%;
}

/* -------------------------------------------------------------------------- */
/*  Accessibility + mobile                                                    */
/* -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .server-row::after,
    .feature-card::after,
    .feature-icon::after,
    .cta-section::before,
    .stat-value.online::before,
    .latency-bar span,
    .achievement-toast::before,
    .btn-main::before {
        animation: none !important;
    }
    #hero::before { display: none; }
    .cursor-trail { display: none !important; }
    .stat-box:hover .stat-number { animation: none !important; }
}

@media (max-width: 768px) {
    #hero::before { display: none; }
    .cursor-trail { display: none !important; }
    .server-row:hover,
    .feature-card:hover { transform: none; }
}

@media (hover: none) {
    .cursor-trail { display: none !important; }
}
