/* ============================================
   embtrace - Custom Styles & Animations
   ============================================ */

/* Page Load Animation */
body {
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.page-loaded {
    opacity: 1;
}

/* Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #1e3a8a, #2563EB);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Header Scroll Effect */
header {
    transition: all 0.3s ease;
}

header.header-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Mobile Menu Animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#mobile-menu:not(.hidden) {
    max-height: 400px;
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Fade Animations */
.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Slide Animations */
.animate-slide-up {
    animation: slideUp 0.5s ease forwards;
}

.animate-slide-down {
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

/* Tilt Card Effect */
.tilt-card {
    transition: transform 0.15s ease;
    transform-style: preserve-3d;
}

/* Feature Cards Hover */
.feature-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(26, 54, 93, 0.07), transparent);
    transition: left 0.5s ease;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(26, 54, 93, 0.15);
}

/* Primary module cards (larger) */
.feature-card-primary {
    border-left: 3px solid #2563EB;
}

/* Button Hover Effects */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #1e3a8a, #2563EB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Floating Animation */
.float-animation {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Pulse Animation for CTAs */
.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(26, 54, 93, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(26, 54, 93, 0); }
}

/* Icon Container Hover */
.icon-container {
    transition: all 0.3s ease;
}

.feature-card:hover .icon-container {
    transform: scale(1.1) rotate(5deg);
    background: #1e3a8a;
}

.feature-card:hover .icon-container svg {
    color: white;
}

/* Hero Background Pattern */
.hero-pattern {
    background-image:
        radial-gradient(circle at 20% 80%, rgba(26, 54, 93, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(45, 125, 70, 0.06) 0%, transparent 50%);
}

/* Section Dividers */
.section-divider {
    position: relative;
}

.section-divider::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #1e3a8a, #2563EB);
    border-radius: 2px;
}

/* Link Underline Animation */
.link-animated {
    position: relative;
}

.link-animated::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #1e3a8a;
    transition: width 0.3s ease;
}

.link-animated:hover::after {
    width: 100%;
}

/* Pipeline Flow */
.pipeline-step {
    transition: all 0.3s ease;
}

.pipeline-step:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(26, 54, 93, 0.15);
}

.pipeline-arrow {
    color: #2563EB;
}

/* Tech Pills */
.tech-pill {
    transition: all 0.3s ease;
}

.tech-pill:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(26, 54, 93, 0.2);
}

/* Code Block Styles */
.code-block {
    background: #1e293b;
    border-radius: 0.5rem;
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
}

.code-block pre {
    margin: 0;
    white-space: pre;
}

.code-comment {
    color: #64748b;
}

.code-command {
    color: #e2e8f0;
}

.code-output {
    color: #94a3b8;
}

.code-success {
    color: #4ade80;
}

.code-warning {
    color: #fbbf24;
}

/* CRA Timeline */
.timeline-bar {
    position: relative;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 1.5rem 0;
}

.timeline-bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 33%;
    background: #2563EB;
    border-radius: 2px;
}

/* Pipeline boundary visualization */
.pipeline-boundary {
    border: 2px dashed #cbd5e0;
    border-radius: 0.75rem;
    padding: 1rem;
}

.pipeline-boundary-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #718096;
    margin-bottom: 0.5rem;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: rgba(26, 54, 93, 0.2);
    color: #1a202c;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #1e3a8a;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563EB;
}
