/* D4 Technologies — Ocean Theme */
:root {
    --background: #1a1f36;
    --foreground: #ffffff;
    --card: #252b47;
    --card-foreground: #ffffff;
    --popover: #1e2440;
    --popover-foreground: #ffffff;
    --primary: #4fd1c7;
    --primary-foreground: #0f172a;
    --secondary: #334155;
    --secondary-foreground: #ffffff;
    --muted: #2d3748;
    --muted-foreground: #a0aec0;
    --accent: #38bdf8;
    --accent-foreground: #0f172a;
    --border: #475569;
    --input: #374151;
    --ring: #4fd1c7;
    --destructive: #ef4444;
    --radius: 0.625rem;
}

/* Global Styles */
html {
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    background-image: url("/static/images/background.92ae6b3df140.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.1);
    z-index: -1;
    pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--muted);
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 209, 199, 0.8);
}

/* Support Tree Controls */
#tree-controls {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    overflow: hidden;
    pointer-events: all;
}
#tree-controls button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    color: #1a202c;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer ;
    transition: background 0.2s;
}
#tree-controls button:last-child { border-bottom: none; }
#tree-controls button:hover { background: #f1f5f9; }

/* Card border fix */
[class*="bg-card"] {
    border-color: rgba(71, 85, 105, 0.5) ;
}

/* Icon spin-in animation */
@keyframes iconSpinIn {
    from { opacity: 0; transform: rotate(-180deg); }
    to { opacity: 1; transform: rotate(0deg); }
}
.icon-spin-in {
    animation: iconSpinIn 0.6s ease 0.3s both;
}

/* Scroll reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px) scale(0.99);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-reveal.visible {
    opacity: 1;
    transform: none;
}

/* Card Component */
.card {
    background-color: rgba(37, 43, 71, 0.4);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem 0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.card-header { padding-left: 1.5rem; padding-right: 1.5rem; }
.card-content { padding-left: 1.5rem; padding-right: 1.5rem; }

/* Nav Link */
.nav-link {
    display: inline-flex;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.nav-link:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

/* Highlight Box */
.highlight-box {
    background: linear-gradient(to right, #eff6ff, #eef2ff);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.highlight-box p {
    color: #374151;
}

/* Swiper Customization (для обычного слайдера .certificates-swiper) */
.certificates-swiper {
    padding-bottom: 3rem;
    width: 100%;
}
.certificates-swiper .swiper-slide {
    height: auto;
}
.certificates-swiper .swiper-slide img {
    max-height: 100%;
    width: auto;
    margin: 0 auto;
    display: block;
}
.swiper-button-prev,
.swiper-button-next {
    background: rgba(26, 31, 54, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 16px;
    color: var(--foreground);
}
.swiper-pagination-bullet {
    background: var(--muted-foreground);
    opacity: 0.4;
    width: 16px ;
    height: 16px ;
}
.swiper-pagination-bullet-active {
    background: var(--primary);
    opacity: 1;
    width: 16px ;
    height: 16px ;
}

/* Support Tree (SVG paths) */
.tree-canvas { overflow: hidden; }
.tree-node {
    position: absolute;
    z-index: 2;
    pointer-events: auto;
}
.tree-path {
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-dasharray: 8 4;
    opacity: 0.7;
    animation: dashFlow 1.5s linear infinite;
}
@keyframes dashFlow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -24; }
}
@keyframes nodeFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Header active link */
.nav-link-active {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--foreground);
    font-weight: 500;
}

/* Action / Decision Nodes */
.action-node {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border: 2px solid var(--primary);
}
.action-node:hover {
    background-color: rgba(79, 209, 199, 0.9);
}
.decision-node {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    border: 2px solid rgba(255, 255, 255, 0.2);
}
.decision-node:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

/* Form Inputs */
.form-input {
    background-color: transparent;
    border: 1px solid var(--input);
    color: var(--foreground);
    border-radius: 0.375rem;
    padding: 0.25rem 0.75rem;
    height: 2.25rem;
    width: 100%;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-textarea {
    background-color: transparent;
    border: 1px solid var(--input);
    color: var(--foreground);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-input:focus,
.form-textarea:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px rgba(79, 209, 199, 0.3);
}
.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--muted-foreground);
}

/* Primary Button */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    color: var(--primary-foreground);
    font-weight: 500;
    font-size: 0.875rem;
    height: 2.25rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s;
    cursor: pointer;
    border: none;
}
.btn-primary:hover {
    background-color: rgba(79, 209, 199, 0.9);
}

/* Success Alert */
.alert-success {
    background-color: rgba(79, 209, 199, 0.1);
    border: 1px solid rgba(79, 209, 199, 0.3);
    color: var(--primary);
    border-radius: var(--radius);
}

/* ===== Cover Flow обёртка ===== */
.coverflow-wrapper {
    width: 100%;
    overflow: hidden;          /* скрываем скроллбар */
    position: relative;
}

/* Скрываем скроллбар для мобильной галереи */
.coverflow-wrapper::-webkit-scrollbar {
    display: none;
}
.coverflow-wrapper {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ===== Coverflow контейнер ===== */
.coverflow-container {
    width: 100%;
    min-height: 420px;
    padding: 20px 0 40px;
    position: relative;
    perspective: 500px;
    perspective-origin: 50% 50%;
    overflow: visible !important;
}

.ui-coverflow-item {
    width: 35vw !important;
    max-width: 380px !important;
    height: 50vh !important;
    max-height: 550px !important;
    min-width: 140px !important;
    min-height: 180px !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    background: #ffffff;
    transition: box-shadow 0.3s ease, transform 0.4s ease;
}

.ui-coverflow-item img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    background: #fff;
}

.ui-coverflow-item.active {
    box-shadow: 0 0 40px rgba(79, 209, 199, 0.5);
}

/* ===== Swiper Coverflow (десктоп) – ГЛОБАЛЬНО ===== */
.swiper-coverflow {
    width: 100%;
    min-height: 420px;
    padding: 20px 0 40px;
    overflow: hidden;
}

.swiper-coverflow .swiper-slide {
    /* убираем width: 280px !important; – теперь Swiper сам рассчитает */
    height: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swiper-coverflow .swiper-slide img {
    width: 100%;
    height: auto;
    max-height: 600px;       /* Увеличиваем для лучшей читаемости */
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    background: #ffffff;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.swiper-coverflow .swiper-slide-active img {
    box-shadow: 0 0 40px rgba(79, 209, 199, 0.5);
}

/* ===== Адаптив для мобильных ===== */
@media (max-width: 1024px) {
    .ui-coverflow-item {
        width: 30vw !important;
        height: 40vh !important;
        max-width: 300px !important;
        max-height: 420px !important;
    }
}

@media (max-width: 768px) {
    .coverflow-container {
        min-height: 380px;
        padding: 20px 0 30px;
    }
    .ui-coverflow-item {
        width: 45vw !important;
        height: 45vh !important;
        max-width: 320px !important;
        max-height: 400px !important;
        min-width: 160px !important;
        min-height: 200px !important;
    }
}

@media (max-width: 480px) {
    .coverflow-container {
        min-height: 320px;
        padding: 10px 0 20px;
    }
    .ui-coverflow-item {
        width: 55vw !important;
        height: 40vh !important;
        max-width: 280px !important;
        max-height: 340px !important;
        min-width: 140px !important;
        min-height: 180px !important;
    }
    /* Стили swiper-coverflow убраны отсюда — они теперь глобальные */
}