/* D4 Technologies — Ocean Theme (exact match to Next.js version) */

/* ===== CSS Variables — 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;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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 (match React Flow controls panel) ===== */
#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 !important;
    transition: background 0.2s;
}
#tree-controls button:last-child { border-bottom: none; }
#tree-controls button:hover { background: #f1f5f9; }

/* ===== Fix card border color — override Tailwind default gray-200 ===== */
[class*="bg-card"] {
    border-color: rgba(71, 85, 105, 0.5) !important;
}

/* ===== Icon spin-in animation (match Next.js rotate(-180deg) → none) ===== */
@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 {
    opacity: 0;
    transform: translateY(30px) scale(0.99);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: none;
}

/* ===== Main content font scale +20% ===== */

/* ===== Footer font scale +20% ===== */

/* ===== Card Component (exact match: bg-card/40 backdrop-blur rounded-xl) ===== */
.card {
    background-color: rgba(37, 43, 71, 0.4);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    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 (match NavigationMenuLink hover style) ===== */
.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 (original: from-blue-50 to-indigo-50 — LIGHT box with DARK text) ===== */
.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 {
    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 !important;
    height: 16px !important;
}

.swiper-pagination-bullet-active {
    background: var(--primary);
    opacity: 1;
    width: 16px !important;
    height: 16px !important;
}

/* ===== Support Tree (SVG paths matching ReactFlow) ===== */
.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 (match: bg-accent/70 text-accent-foreground font-medium) ===== */
.nav-link-active {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--foreground);
    font-weight: 500;
}

/* ===== Action Nodes (bg-primary text-primary-foreground) ===== */
.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 Nodes (bg-secondary) ===== */
.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 (match: bg-transparent border-input rounded-md shadow-xs) ===== */
.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 (match: bg-primary text-primary-foreground h-9 px-4 py-2 rounded-md shadow-xs hover:bg-primary/90) ===== */
.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);
}
