/* MAX Постер — Light & Cold Theme */

:root {
    --primary: #0066ff;
    --primary-hover: #0050cc;
    --accent: #00b4d8;
    --accent-light: #90e0ef;
    --gradient-primary: linear-gradient(135deg, #0066ff 0%, #00b4d8 100%);
    --gradient-hero: linear-gradient(135deg, #eaf4ff 0%, #ffffff 50%, #e8f8fc 100%);

    --bg: #ffffff;
    --bg-alt: #f4f7fb;
    --card-bg: #ffffff;
    --card-hover: #f0f5ff;

    --text: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #718096;

    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
}

/* ===== Base ===== */
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

h1,h2,h3,h4,h5,h6 { font-weight: 700; color: var(--text); }
a { color: var(--primary); }

.ai-main-content { min-height: calc(100vh - 76px - 260px); }

/* ===== Header / Navbar ===== */
.ai-header {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 1050 !important;
    background: rgba(255,255,255,.92) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: background .3s, box-shadow .3s;
}
.ai-header.scrolled {
    background: rgba(255,255,255,.98) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.ai-logo {
    font-weight: 800;
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}
.ai-logo:hover { opacity: .85; }

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    transition: color .2s;
    position: relative;
    margin: 0 8px;
}
.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 50%;
    width: 0; height: 2px;
    background: var(--primary);
    transition: width .25s;
    transform: translateX(-50%);
}
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after { width: 80%; }
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active { color: var(--primary) !important; }

/* hamburger icon colour override for light navbar */
.navbar-toggler { border-color: var(--border); }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%234a5568' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* ===== Buttons ===== */
.ai-cta-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: 28px;
    padding: 10px 24px;
    font-weight: 600;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(0,102,255,.25);
    transition: transform .2s, box-shadow .2s;
}
.ai-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,102,255,.35);
    color: #fff !important;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: 28px;
    padding: 12px 30px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,102,255,.2);
    transition: transform .2s, box-shadow .2s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,102,255,.3);
    background: var(--gradient-primary);
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
    border-radius: 28px;
    padding: 10px 28px;
    font-weight: 600;
    transition: background .2s, color .2s, transform .2s;
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ===== Hero ===== */
.ai-hero {
    background: var(--gradient-hero);
    padding: 140px 0 100px;
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.ai-hero .container { position: relative; z-index: 2; }
.ai-hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 1.5rem;
}
.ai-hero h1 .text-primary { color: var(--primary) !important; }
.ai-hero p.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 560px;
}

.ai-hero-graphic-3d { height: 400px; display: flex; align-items: center; justify-content: center; }
.ai-3d-container { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
/* hide old decorative 3d elements */
.ai-cube, .ai-sphere, .ai-pyramid, .ai-neural-network,
.ai-node, .ai-connection { display: none; }

/* ===== Floating Icons (Hero & Case Study) ===== */
.floating-icon {
    position: absolute;
    width: 52px; height: 52px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    color: var(--primary);
    box-shadow: var(--shadow);
    z-index: 3;
    animation: fi-float 5s ease-in-out infinite;
}

/* positions around the central Telegram icon (hero) */
.fi-1 { top: 8%;  left: 8%;   animation-delay: 0s;     }
.fi-2 { top: 4%;  right: 12%; animation-delay: -.7s;   }
.fi-3 { bottom: 12%; left: 4%;  animation-delay: -1.4s;  }
.fi-4 { bottom: 8%;  right: 6%; animation-delay: -2.1s;  }
.fi-5 { top: 44%; left: -2%;  animation-delay: -2.8s;  }
.fi-6 { top: 38%; right: -2%; animation-delay: -3.5s;  }
.fi-7 { top: 68%; left: 12%;  animation-delay: -4.2s;  }
.fi-8 { top: 18%; right: 2%;  animation-delay: -4.9s;  }

/* mini variant for case-study detail graphic */
.fi-mini { width: 40px; height: 40px; font-size: 1rem; }
.fi-m1 { top: 0;   left: 5%;  animation-delay: 0s;   }
.fi-m2 { top: 5%;  right: 0;  animation-delay: -1.2s;}
.fi-m3 { bottom: 5%; left: 0;  animation-delay: -2.4s;}
.fi-m4 { bottom: 0;  right: 5%;animation-delay: -3.6s;}

@keyframes fi-float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25%  { transform: translateY(-10px) rotate(3deg); }
    50%  { transform: translateY(-4px) rotate(-2deg); }
    75%  { transform: translateY(-14px) rotate(1deg); }
}

/* Case study detail decorative graphic */
.case-detail-graphic {
    width: 220px; height: 220px;
    position: relative;
    display: flex; align-items: center; justify-content: center;
}
.case-graphic-inner {
    position: relative;
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--gradient-hero);
    border-radius: 50%;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.statistics-section { max-width: 440px; }

/* ===== Sections ===== */
.ai-section { padding: 80px 0; }
.ai-section.bg-light,
.ai-section.bg-dark { background: var(--bg-alt) !important; color: var(--text) !important; }

.ai-section-title { text-align: center; margin-bottom: 3rem; }
.ai-section-title h2 {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1rem;
    /* remove old gradient text */
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}
.ai-section-title p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto;
}

/* ===== Cards (generic) ===== */
.ai-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: transform .3s, box-shadow .3s;
    box-shadow: var(--shadow);
    position: relative;
}
.ai-card::before { display: none; }
.ai-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.ai-card-icon {
    width: 60px; height: 60px;
    background: var(--gradient-primary);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.2rem;
    font-size: 1.5rem;
    color: #fff;
}
.ai-card h3, .ai-card h4, .ai-card h5 { color: var(--text); }
.ai-card p { color: var(--text-secondary); }

/* ===== Case Study Cards ===== */
.case-study-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform .3s, box-shadow .3s;
    box-shadow: var(--shadow);
}
.case-study-card::before { display: none; }
.case-study-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.case-study-card .card-body { padding: 1.5rem; }
.case-study-card .card-title { color: var(--text); }
.case-study-card .card-text { color: var(--text-secondary); }
.case-study-tag {
    background: var(--bg-alt);
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: .5rem;
    box-shadow: none;
}

/* ===== Blog Cards ===== */
.blog-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform .3s, box-shadow .3s;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.blog-card::before { display: none; }
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.blog-card img { height: 200px; object-fit: cover; width: 100%; }
.blog-card .card-body {
    padding: 1.5rem;
    display: flex; flex-direction: column; flex-grow: 1;
}
.blog-card .card-title { color: var(--text) !important; }
.blog-card .card-text { color: var(--text-secondary) !important; }
.blog-card .mt-auto { margin-top: auto !important; }

.blog-meta { font-size: .85rem; color: var(--text-muted); }
.blog-meta a { color: var(--primary); }

/* ===== Article (blog detail) ===== */
.article-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    padding: 2rem !important;
    box-shadow: var(--shadow) !important;
}
.article-card::before { display: none !important; }
.article-card:hover { box-shadow: var(--shadow-lg) !important; }
.article-card > * { position: relative; z-index: 1; }

.article-content {
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--text);
}
.article-content h1,.article-content h2,.article-content h3,
.article-content h4,.article-content h5,.article-content h6 {
    color: var(--text) !important;
    margin-top: 2rem; margin-bottom: 1rem;
}
.article-content h2 { font-size: 1.8rem; color: var(--primary) !important; }
.article-content strong, .article-content b { color: var(--text) !important; font-weight: 700; }
.article-content a { color: var(--primary); }
.article-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--bg-alt);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 6px;
    color: var(--text-secondary);
}
.article-content code {
    background: var(--bg-alt);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .9em;
}
.article-content pre {
    background: var(--bg-alt);
    padding: 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow-x: auto;
}
.article-content pre code { background: none; color: var(--text); }
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}
.article-content ul { list-style: disc; }
.article-content ul, .article-content ol { padding-left: 1.5rem; margin: 1rem 0; }
.article-content li { margin-bottom: .4rem; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.article-content th { background: var(--primary); color: #fff; padding: .6rem 1rem; text-align: left; }
.article-content td { padding: .6rem 1rem; border-bottom: 1px solid var(--border); }

/* ===== Testimonials ===== */
.testimonial-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.testimonial-stars { color: #f59e0b; margin-bottom: .75rem; font-size: 1.1rem; }
.testimonial-content { color: var(--text-secondary); font-style: italic; margin-bottom: 1rem; }
.testimonial-author { font-weight: 600; color: var(--text); }
.testimonial-company { color: var(--text-muted); font-size: .85rem; }

.testimonials-carousel-container {
    position: relative;
    overflow: hidden;
    height: 280px;
    border-radius: 12px;
}
.testimonials-carousel {
    display: flex;
    height: 100%;
    width: max-content;
    animation: infinite-scroll 28s linear infinite;
}
.testimonial-slide {
    min-width: 320px; flex-shrink: 0;
    padding: 0 16px; display: flex; align-items: center;
}
.testimonial-slide .testimonial-card { width: 100%; }
.testimonials-carousel-container:hover .testimonials-carousel { animation-play-state: paused; }
@keyframes infinite-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-320px * 5)); }
}

/* ===== Footer ===== */
.ai-footer {
    background: var(--bg-alt) !important;
    border-top: 1px solid var(--border);
    color: var(--text);
}
.ai-footer h5, .ai-footer h6 { color: var(--text); }
.ai-footer p, .ai-footer .text-muted { color: var(--text-muted) !important; }
.ai-footer a.text-muted { transition: color .2s; }
.ai-footer a.text-muted:hover { color: var(--primary) !important; }

/* ===== Breadcrumbs ===== */
.breadcrumb-item a { color: var(--primary) !important; }
.breadcrumb-item.active { color: var(--text-muted) !important; }

/* ===== Forms ===== */
.form-control, .form-select {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: 10px 14px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,102,255,.12);
    background: #fff;
    color: var(--text);
}

/* ===== Pagination ===== */
.pagination .page-link {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
}
.pagination .page-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ===== Misc utilities ===== */
.ai-glow { animation: glow 2s ease-in-out infinite; }
@keyframes glow {
    0%,100% { box-shadow: 0 0 5px rgba(0,102,255,.2); }
    50%     { box-shadow: 0 0 18px rgba(0,102,255,.35); }
}

/* Page header padding (to push content below fixed navbar) */
h1.display-4.fw-bold { margin-top: 2rem !important; }

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .ai-hero { padding: 110px 0 60px; min-height: auto; }
    .ai-hero h1 { font-size: 2.4rem; }

    /* Mobile nav: underline aligned to text start, not centered */
    .navbar-nav .nav-link { margin: 0; padding: .6rem 0; }
    .navbar-nav .nav-link::after {
        left: 0;
        transform: none;
        bottom: 2px;
    }
    .navbar-nav .nav-link:hover::after,
    .navbar-nav .nav-link.active::after { width: 40px; }

    /* Spacing between nav and CTA button */
    #navbarNav .d-flex { margin-top: .75rem; }
}
@media (max-width: 768px) {
    .ai-hero h1 { font-size: 2rem; }
    .ai-section { padding: 50px 0; }
    .ai-section-title h2 { font-size: 1.8rem; }
    .ai-hero-graphic-3d { height: 200px; }
    .floating-icon { width: 38px; height: 38px; font-size: .95rem; border-radius: 10px; }
    .fi-mini { width: 32px; height: 32px; font-size: .85rem; }
    .case-detail-graphic { width: 160px; height: 160px; }
    .case-detail-graphic .fab.fa-telegram { font-size: 3.5rem !important; }
    .testimonials-carousel { animation-duration: 18s; }
    .article-card { padding: 1rem !important; }
    .article-content { font-size: 1rem; line-height: 1.6; }
}
@media (max-width: 576px) {
    .ai-hero h1 { font-size: 1.7rem; }
    .ai-section-title h2 { font-size: 1.5rem; }
}

/* ===== Cookie Consent Popup ===== */
.cookie-consent-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.25rem 2rem;
    background: rgba(255, 255, 255, .6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, .4);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .06);
}

.cookie-consent-popup:not(.hidden) {
    animation: cookie-slide-up .5s ease-out;
}

.cookie-consent-popup.hidden {
    display: none !important;
}

@keyframes cookie-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.cookie-consent-text {
    flex: 1;
    font-size: .9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cookie-consent-text a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-consent-btn {
    flex-shrink: 0;
    background: var(--gradient-primary);
    border: none;
    border-radius: 28px;
    padding: 10px 28px;
    font-weight: 600;
    font-size: .95rem;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 102, 255, .25);
    transition: transform .2s, box-shadow .2s;
}

.cookie-consent-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 255, .35);
}

@media (max-width: 768px) {
    .cookie-consent-popup {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.25rem;
        gap: .75rem;
    }
    .cookie-consent-text {
        font-size: .8rem;
    }
    .cookie-consent-btn {
        align-self: stretch;
        text-align: center;
        padding: 10px 22px;
        font-size: .85rem;
    }
}
