/* Custom styles for PSK-Dom AI-Seller Landing */

/* Base styles */
html {
    scroll-behavior: smooth;
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

.animate-slide-in-right {
    animation: slide-in-right 0.6s ease-out forwards;
}

.delay-100 {
    animation-delay: 0.1s;
    opacity: 0;
}

.delay-200 {
    animation-delay: 0.2s;
    opacity: 0;
}

.delay-300 {
    animation-delay: 0.3s;
    opacity: 0;
}

/* Section animations (triggered on scroll) */
.section-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children animation */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.6s; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Typewriter cursor */
.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background-color: #ec3a39;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f4f4f5;
}

::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    background: #e4e4e7;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #ec3a39;
    border-radius: 50%;
    margin-top: -6px;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

input[type="range"]::-moz-range-track {
    height: 8px;
    background: #e4e4e7;
    border-radius: 4px;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ec3a39;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}

/* Mermaid diagram styling */
.mermaid {
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding: 1rem 0;
}

.mermaid svg {
    max-width: 100%;
    height: auto;
}

/* Table hover effects */
table tbody tr {
    transition: background-color 0.15s ease;
}

/* Package card hover effects */
.package-card {
    transition: all 0.3s ease;
}

.package-card:hover {
    transform: translateY(-4px);
}

/* Risk accordion */
.risk-accordion button {
    cursor: pointer;
}

.risk-accordion .risk-icon {
    transition: transform 0.3s ease;
}

.risk-accordion.open .risk-icon {
    transform: rotate(180deg);
}

.risk-accordion .risk-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.risk-accordion.open .risk-content {
    max-height: 200px;
}

/* Form focus states */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #ec3a39;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* Button pulse animation for CTA */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 10px 25px -3px rgba(5, 150, 105, 0.25);
    }
    50% {
        box-shadow: 0 10px 40px -3px rgba(5, 150, 105, 0.4);
    }
}

.cta-pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Navbar show/hide transition */
#navbar {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

#navbar.visible {
    transform: translateY(0);
}

/* Count-up animation placeholder */
[data-count] {
    font-variant-numeric: tabular-nums;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .section-animate {
        transform: translateY(20px);
    }

    /* Smaller touch targets on mobile */
    input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
        margin-top: -8px;
    }
}

/* Print styles */
@media print {
    .no-print,
    #navbar,
    #scroll-progress,
    #mobile-menu {
        display: none !important;
    }

    .section-animate {
        opacity: 1 !important;
        transform: none !important;
    }

    body {
        font-size: 12pt;
    }

    a {
        text-decoration: none;
        color: inherit;
    }
}

/* Smooth scroll offset for fixed header */
[id] {
    scroll-margin-top: 80px;
}

/* Loading state for mermaid */
.mermaid:not([data-processed="true"]) {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mermaid:not([data-processed="true"])::before {
    content: "Загрузка диаграммы...";
    color: #71717a;
    font-size: 0.875rem;
}

/* Mobile sticky CTA */
@media (max-width: 768px) {
    .mobile-sticky-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1rem;
        background: white;
        border-top: 1px solid #e4e4e7;
        box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
        z-index: 40;
    }
}

/* Gradient text (if needed) */
.gradient-text {
    background: linear-gradient(135deg, #ec3a39 0%, #047857 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass morphism effect for cards (optional) */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Highlight animation for comparison table */
@keyframes highlight-row {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(5, 150, 105, 0.1);
    }
}

.highlight-row {
    animation: highlight-row 1s ease;
}
