@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Inter:wght@300;400;600&display=swap');

:root {
    --bg-color: #0f172a;
    --primary-color: #3b82f6;
    --accent-color: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --gradient-1: #7c3aed;
    --gradient-2: #2563eb;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: var(--font-heading);
    color: white;
}

/* Glassmorphism Utilities */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Navbar */
.navbar {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
    border: none;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    font-family: var(--font-heading);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gradient-2), var(--gradient-1));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.btn-outline-light {
    border-color: var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: pulse 8s infinite ease-in-out;
}

/* Tech Icons */
.tech-icon {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 140px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tech-icon:hover {
    transform: translateY(-8px) scale(1.05);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.tech-icon img {
    height: 50px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.tech-icon div {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.tech-icon:hover div {
    color: #fff;
}

/* Sections */
section {
    position: relative;
    z-index: 1;
}

.section-title {
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    bottom: -10px;
    left: 0;
    border-radius: 2px;
}

/* Contact Form */
.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    backdrop-filter: blur(4px);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
    color: #fff;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

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

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

.floating {
    animation: float 6s ease-in-out infinite;
}

/* Helper Text */
.text-gradient {
    background: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Modal Styles */
.modal-content.glass-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    color: var(--text-main);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.cursor-pointer {
    cursor: pointer;
}

.arch-section {
    padding: 0;
    /* Removed conflicting background to let body gradient show */
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.arch-title {
    font-size: 42px;
    margin-bottom: 60px;
    letter-spacing: 2px;
    font-weight: 600;
}

.arch-container-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 20px 250px;
}

.arch-container {
    position: relative;
    width: max-content;
    /* automatically grows with nodes */
    min-width: 100%;
    /* at least full viewport width */
    min-width: 1450px;
    /* Ensure SVG spans all nodes to prevent clipping on mobile */
    height: 570px;
    margin: 0 auto;
    /* center container horizontally */
    overflow-x: auto;
    /* scroll horizontally if content overflows */
    padding: 20px 40px;
    /* top/bottom 20px, left/right 40px */

    border-radius: 14px;

    --node-width: 180px;
    --row-1-top: 60px;
    --row-2-top: 240px;
    --row-3-top: 420px;

    --start-left: 40px;
    --column-gap: 185px;
}

/* Optional: make the parent section scrollable */
.arch-section {
    width: 100%;
    overflow-x: auto;
}

/* Global Arch Container Styling with Animated Border */
.arch-container {
    /* Animated Border for Arch Container */
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    /* Slight bg */
    border-radius: 20px;

    /* Dashed Animated Border */
    /* background-image:
        linear-gradient(90deg, rgba(255, 255, 255, 0.2) 50%, transparent 50%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.2) 50%, transparent 50%),
        linear-gradient(0deg, rgba(255, 255, 255, 0.2) 50%, transparent 50%),
        linear-gradient(0deg, rgba(255, 255, 255, 0.2) 50%, transparent 50%); */
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
    background-size: 20px 2px, 20px 2px, 2px 20px, 2px 20px;
    background-position: 0px 0px, 100% 100%, 0px 100%, 100% 0px;
    animation: border-dance 60s linear infinite;
    border: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

/* Style the node like a Docker container with Animated Border */
.docker-node {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 2px;

    /* Animated Dashed Border using Gradients */
    background-image:
        linear-gradient(90deg, #188ed6 50%, transparent 50%),
        linear-gradient(90deg, #188ed6 50%, transparent 50%),
        linear-gradient(0deg, #188ed6 50%, transparent 50%),
        linear-gradient(0deg, #188ed6 50%, transparent 50%);
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
    background-size: 15px 2px, 15px 2px, 2px 15px, 2px 15px;
    background-position: 0px 0px, 100% 100%, 0px 100%, 100% 0px;
    border: none;
    /* Remove standard border */
    animation: border-dance 40s linear infinite;

    border-radius: 14px;
    font-weight: bold;
    box-sizing: border-box;
    width: 95%;
    height: 90%;
    pointer-events: none;
    position: absolute;
    top: 5;
    left: 5;
}

@keyframes border-dance {
    0% {
        background-position: 0px 0px, 100% 100%, 0px 100%, 100% 0px;
    }

    100% {
        background-position: 300px 0px, -200px 100%, 0px -200px, 100% 300px;
    }
}

/* Glass Nodes */
.arch-node {
    position: absolute;
    width: 180px;
    height: 90px;
    /* Matching global glass card style */
    /* More opaque background to hide connection lines behind the node */
    background: #131b2e;

    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    transition: 0.4s;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    animation: float 6s ease-in-out infinite;
    z-index: 2;
}

.arch-node:active {
    cursor: grabbing;
}

.arch-node:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 45px rgba(59, 130, 246, 0.6);
    /* Primary color glow */
}

/* ... existing styles ... */

/* Cloud Path Animation */
#cloud-path {
    transition: all 0.3s ease;
    cursor: pointer;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.2));
    stroke-dasharray: 15;
    animation: dashMove 60s linear infinite;
}

#cloud-path:hover {
    stroke: rgba(59, 130, 246, 0.8);
    /* Blue glow */
    stroke-width: 4;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.6));
}

/* Animated Lines */
.arch-lines line,
.arch-lines path {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 2;
    stroke-dasharray: 10;
    stroke-linecap: round;
    fill: none;
    animation: dashMove 30s linear infinite;
}

.node-title {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

/* Mini Slider Styles */
.node-content-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 15px;
    width: 100%;
    height: 100%;
}

.node-slider {
    width: 74px;
    /* Exactly (22px icon + 15px gap) * 2 */
    height: 32px;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);

    /* center content inside slider */
    display: flex;
    justify-content: center;
    align-items: center;
}

.slider-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: slide-tech 10s linear infinite;
    will-change: transform;
}

.slider-item {
    width: 37px;
    /* 22px icon + 15px gap */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.slider-track img {
    height: 22px;
    width: 22px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.arch-node:hover .slider-track img {
    opacity: 1;
}

.arch-node:hover .slider-track {
    animation-play-state: paused;
}

@keyframes slide-tech {
    0% {
        transform: translateX(0);
    }

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

/* Adjust Node Size for Slider */
.arch-node {
    width: 230px;
    /* Slightly wider to accommodate slider */
    height: 60px;
}

/* Node Positions - Perfectly Centered in 1000px */
/* Center X = 500. Node Width = 180. Center-Left = 410. */
/* Gap = 190. */

#frontend {
    top: var(--row-2-top);
    left: calc(var(--start-left) + (0 * var(--column-gap)));
}

#reverse-proxy {
    top: var(--row-2-top);
    left: calc(var(--start-left) + (2 * var(--column-gap)));
}

#backend {
    top: var(--row-2-top);
    left: calc(var(--start-left) + (4 * var(--column-gap)));
}

#worker {
    top: var(--row-2-top);
    left: calc(var(--start-left) + (6 * var(--column-gap)));
}

#monitoring {
    top: var(--row-1-top);
    left: calc(var(--start-left) + (6 * var(--column-gap)));
}

#database {
    top: var(--row-3-top);
    left: calc(var(--start-left) + (4 * var(--column-gap)));
}

#cache {
    top: var(--row-3-top);
    left: calc(var(--start-left) + (6 * var(--column-gap)));
}

#devops {
    top: var(--row-3-top);
    left: calc(var(--start-left) + (0 * var(--column-gap)));
}

/* Architecture Groups */
.arch-group {
    position: absolute;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    pointer-events: none;
    /* Let clicks pass through */
    z-index: 0;
}

.group-label {
    position: absolute;
    top: -12px;
    left: 20px;
    background: #1e293b;
    /* Match bg color approx - will blend or need backdrop filter */
    padding: 0 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
}

.cloud-group {
    top: 10px;
    left: 10px;
    width: 980px;
    height: 480px;
    border-color: rgba(59, 130, 246, 0.3);
    /* Blue tint for Cloud */
}

.docker-group {
    top: 40px;
    left: 20px;
    width: 960px;
    height: 170px;
    border-color: rgba(16, 185, 129, 0.3);
    /* Green tint for Docker */
}

/* Floating Animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

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

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

/* Animated Lines */
.arch-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Apply same style to BOTH lines and curves */
.arch-lines line,
.arch-lines path {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 2;
    stroke-dasharray: 10;
    stroke-linecap: round;
    fill: none;
    animation: dashMove 30s linear infinite;
}


@keyframes dashMove {
    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: -1000;
    }
}

/* Creative Tooltip Styles */
.tooltip-content {
    text-align: center;
    padding: 8px;
}

.tooltip-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tooltip-icons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    justify-items: center;
}

.tooltip-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 65px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    transition: all 0.3s ease;
}

.tooltip-icon:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tooltip-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.tooltip-icon span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.tech-intro {
    max-width: 720px;
    margin: 15px auto 40px;
    text-align: center;
    color: #9ca3af;
    font-size: 16px;
    line-height: 1.7;
}

/* Primary Tech Stack Styles */
#primary-stack {
    position: relative;
    overflow: hidden;
}

.primary-stack-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

.primary-stack-card:hover {
    transform: translateY(-10px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 20px 50px rgba(59, 130, 246, 0.15);
}

.stack-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.featured-tech {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 1;
}

.featured-tech img {
    height: 80px;
    width: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.3));
    transition: all 0.3s ease;
}

.featured-tech:hover img {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 25px rgba(59, 130, 246, 0.6));
}

.featured-tech span {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-main);
}

.stack-list {
    list-style: none;
}

.stack-list li span {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.stack-list li strong {
    color: #fff;
}


/* Responsive adjustments */
@media (max-width: 1400px) {
    .arch-container-wrapper {
        padding: 20px 100px;
    }
}

@media (max-width: 1200px) {
    .arch-container {
        height: 700px;
        padding: 20px 30px;
        /* reduce horizontal padding on smaller screens */
    }
}

@media (max-width: 992px) {
    .arch-container-wrapper {
        padding: 20px 50px;
    }

    .arch-container {
        height: 600px;
        padding: 15px 20px;
    }

    #experienceModal .modal-dialog {
        max-width: 70%;
    }
}

@media (max-width: 768px) {
    .arch-container-wrapper {
        padding: 20px 15px;
    }

    .arch-container {
        height: 500px;
        padding: 10px 15px;
    }

    .glass-card {
        padding: 1.5rem;
    }

    .hero-glow {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .arch-container {
        height: 400px;
        padding: 5px 10px;
    }
}