/* =============================================
   VIPER AI - Main Stylesheet
   Zoptymalizowany CSS bez duplikatów
   ============================================= */

/* ===========================================
   1. GLOBAL STYLES
   =========================================== */
html {
    overflow-x: hidden;
}

body {
    background-color: #131022;
    background-image: url('../img2/tlo.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    overflow-x: hidden;
}

/* ===========================================
   2. GRID CANVAS BACKGROUND
   =========================================== */
#grid-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ===========================================
   3. PRELOADER
   =========================================== */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: #131022;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

#preloader.hidden-preloader {
    opacity: 0;
    visibility: hidden;
}

/* ===========================================
   4. FOOTER STYLES
   =========================================== */
footer .container {
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    footer .container {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Fixed Footer on Desktop */
@media (min-width: 1024px) {
    footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 40;
    }

    main {
        padding-bottom: 80px;
    }
}

footer p {
    font-size: 0.875rem;
}

footer a {
    color: #d1d5db;
    transition: color 0.3s;
}

footer a:hover {
    color: #ffffff;
}

/* ===========================================
   5. PORTFOLIO ANIMATIONS
   =========================================== */
.portfolio-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease-out forwards;
}

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

.portfolio-item:nth-child(1) {
    animation-delay: 0.1s;
}

.portfolio-item:nth-child(2) {
    animation-delay: 0.2s;
}

.portfolio-item:nth-child(3) {
    animation-delay: 0.3s;
}

.portfolio-item:nth-child(4) {
    animation-delay: 0.4s;
}

.portfolio-item:nth-child(5) {
    animation-delay: 0.1s;
}

.portfolio-item:nth-child(6) {
    animation-delay: 0.2s;
}

.portfolio-item:nth-child(7) {
    animation-delay: 0.3s;
}

.portfolio-item:nth-child(8) {
    animation-delay: 0.4s;
}

/* ===========================================
   6. SCROLL ANIMATIONS
   =========================================== */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.fade-in-up {
    transform: translateY(30px);
}

.fade-in-left {
    transform: translateX(-30px);
}

.fade-in-right {
    transform: translateX(30px);
}

.scale-in {
    transform: scale(0.9);
}

.is-visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* ===========================================
   7. HOVER EFFECTS
   =========================================== */
.hover-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(75, 43, 238, 0.3);
    border-color: rgba(75, 43, 238, 0.5);
}

/* ===========================================
   8. ENTRY ANIMATIONS
   =========================================== */
@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fade-in-up 0.6s ease-out forwards;
    opacity: 0;
}

.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

/* ===========================================
   9. LOGO CAROUSEL
   =========================================== */
.logo-carousel {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.logo-track {
    display: flex;
    width: max-content;
    animation: scroll 30s linear infinite;
    gap: 4rem;
    padding: 1rem 0;
    align-items: center;
}

.logo-track:hover {
    animation-play-state: paused;
}

.logo-track img {
    height: 3rem;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.logo-track img:hover {
    transform: scale(1.1);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ===========================================
   10. 3D PRICING CAROUSEL
   =========================================== */
.gallery-container {
    position: relative;
    width: 100%;
    height: 600px;
    perspective: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin: 40px 0;
}

.gallery-wheel {
    position: relative;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
}

.pricing-card-3d {
    position: absolute;
    width: 380px;
    height: 550px;
    left: -190px;
    top: -275px;
    transform-style: preserve-3d;
    cursor: pointer;
    transition: box-shadow 0.3s, transform 0.3s;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.pricing-card-3d:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 100, 255, 0.2);
}

.pricing-card-3d.zoomed {
    box-shadow: 0 0 60px rgba(0, 100, 255, 0.4);
    z-index: 10000 !important;
    border-color: rgba(0, 100, 255, 0.5);
}

/* Card Content Styles for 3D Carousel */
.pricing-card-3d h2 {
    font-size: 28px;
    margin: 0 0 10px 0;
    font-weight: 700;
    color: white;
}

.pricing-card-3d .price {
    font-size: 36px;
    font-weight: 800;
    margin: 20px 0;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pricing-card-3d .price span {
    font-size: 16px;
    color: #888;
    -webkit-text-fill-color: #888;
    font-weight: 400;
}

.pricing-card-3d .description {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.pricing-card-3d ul.features {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.pricing-card-3d ul.features li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    color: #ddd;
    font-size: 14px;
    position: relative;
    padding-left: 0;
}

.pricing-card-3d ul.features li::before {
    content: "✓";
    color: #00f2fe;
    margin-right: 10px;
    font-weight: bold;
}

.pricing-btn {
    background: linear-gradient(90deg, #0061ff 0%, #60efff 100%);
    border: none;
    padding: 15px;
    border-radius: 30px;
    color: #000;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: transform 0.2s;
    margin-top: 20px;
    display: block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.pricing-btn:hover {
    transform: scale(1.05);
}

/* Specific Card Styles */
.card-start {
    border-top: 4px solid #4facfe;
}

.card-standard {
    border-top: 4px solid #00f2fe;
    background: rgba(255, 255, 255, 0.07);
}

.card-pro {
    border-top: 4px solid #a18cd1;
}

.card-pro .price {
    background: linear-gradient(90deg, #a18cd1 0%, #fbc2eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-pro .pricing-btn {
    background: linear-gradient(90deg, #a18cd1 0%, #fbc2eb 100%);
}

.pricing-card-3d .badge {
    position: absolute;
    top: -15px;
    right: 20px;
    background: #0061ff;
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 97, 255, 0.4);
}

/* Mobile Responsiveness for 3D Carousel */
@media (max-width: 1024px) {
    .gallery-container {
        height: auto;
        perspective: none;
        flex-direction: column;
        padding: 20px;
        margin: 0;
    }

    .gallery-wheel {
        width: 100%;
        height: auto;
        transform-style: flat;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .pricing-card-3d {
        position: relative;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: 100%;
        max-width: 380px;
        height: auto;
        min-height: 550px;
        margin: 0;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .pricing-card-3d.zoomed {
        transform: none !important;
        z-index: 1;
    }
}

/* ===========================================
   11. COMPARISON MODULE
   =========================================== */
.comparison-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

@media (min-width: 768px) {
    .comparison-container {
        aspect-ratio: 16/9;
    }
}

.comparison-container .img-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    pointer-events: none;
}

.comparison-container .img-before {
    z-index: 2;
    clip-path: inset(0 calc(100% - var(--position, 50%)) 0 0);
    will-change: clip-path;
}

.comparison-container .img-after {
    z-index: 1;
}

.comparison-container .slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--position, 50%);
    width: 2px;
    background: rgba(255, 255, 255, 0.8);
    z-index: 20;
    pointer-events: none;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.comparison-container .slider-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.comparison-container .slider-circle::after,
.comparison-container .slider-circle::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
    transform: rotate(45deg);
}

.comparison-container .slider-circle::before {
    transform: rotate(-135deg);
    margin-right: -2px;
}

.comparison-container .slider-circle::after {
    margin-left: -2px;
}

/* ===========================================
   12. SCROLL TO TOP BUTTON
   =========================================== */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: #1191fa;
    border-color: #1191fa;
    box-shadow: 0 0 20px rgba(17, 145, 250, 0.5);
    transform: scale(1.1) translateY(-5px);
}

#back-to-top .material-symbols-outlined {
    font-size: 24px;
    transition: transform 0.3s ease;
}

#back-to-top:hover .material-symbols-outlined {
    transform: translateY(-2px);
}

/* Mobile adjustment for back-to-top - position above chatbot bubble */
@media (max-width: 768px) {
    #back-to-top {
        bottom: 85px;
        /* Above Dify button which is at 15px-80px */
        right: 15px;
        width: 45px;
        height: 45px;
        z-index: 2147483645;
        /* Just below chatbot window but above everything else */
    }
}

/* Desktop adjustment - above fixed footer */
@media (min-width: 1024px) {
    #back-to-top {
        bottom: 100px;
    }
}

/* ===========================================
   13. VIDEO HERO SECTION
   =========================================== */
.video-hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Video Background */
.video-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.video-hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Dark Overlay */
.video-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
            rgba(19, 16, 34, 0.7) 0%,
            rgba(19, 16, 34, 0.5) 50%,
            rgba(19, 16, 34, 0.8) 100%);
    z-index: 1;
}

/* Content Layer */
.video-hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1280px;
    padding: 0 1.5rem;
    margin: 0 auto;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

/* Badge */
.video-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(17, 145, 250, 0.15);
    border: 1px solid rgba(17, 145, 250, 0.3);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #1191fa;
}

.badge-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #1191fa;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Headline */
.video-hero-headline {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    color: #ffffff;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    margin: 0;
}

.video-hero-headline .gradient-text {
    background: linear-gradient(135deg, #1191fa 0%, #a855f7 50%, #ec4899 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Subtitle */
.video-hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    line-height: 1.7;
    margin: 0;
}

/* CTA Buttons */
.video-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.video-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.video-hero-btn.primary {
    background: linear-gradient(135deg, #1191fa 0%, #0066cc 100%);
    color: #ffffff;
    box-shadow: 0 10px 40px rgba(17, 145, 250, 0.4);
}

.video-hero-btn.primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 50px rgba(17, 145, 250, 0.6);
}

.video-hero-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.video-hero-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
}

.video-hero-btn .material-symbols-outlined {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.video-hero-btn.primary:hover .material-symbols-outlined {
    transform: translateX(4px);
}

/* Scroll Indicator */
.video-hero-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    animation: float-scroll 2s ease-in-out infinite;
}

.scroll-mouse {
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.scroll-wheel {
    width: 4px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    animation: scroll-wheel 1.5s ease-in-out infinite;
}

@keyframes scroll-wheel {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(12px);
    }
}

@keyframes float-scroll {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(10px);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .video-hero-section {
        height: 100svh;
        min-height: 500px;
        /* Use small viewport height for mobile */
    }

    .video-hero-content {
        padding: 0 1rem;
        padding-top: 60px; /* Space for mobile header */
        padding-bottom: 80px; /* Space for scroll indicator */
    }

    .video-hero-inner {
        gap: 1.25rem;
    }

    .video-hero-badge {
        font-size: 0.65rem;
        padding: 0.4rem 0.8rem;
    }

    .video-hero-cta {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .video-hero-btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.5rem;
    }

    .video-hero-scroll-indicator {
        bottom: 1.5rem;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .video-hero-video {
        animation: none;
    }

    .badge-dot,
    .scroll-wheel,
    .video-hero-scroll-indicator {
        animation: none;
    }
}