/* ========================================
   CSS VARIABLES SYNCED WITH TAILWIND CONFIG
   These match the colors defined in header.html tailwind.config
   ======================================== */
:root {
    /* Primary Brand Colors - Synced with Tailwind */
    --color-primary: #0a2540;
    --color-primary-light: #3d6b9c;
    --color-primary-dark: #07192c;
    
    --color-secondary: #8b5cf6;
    --color-secondary-light: #a78bfa;
    --color-secondary-dark: #7c3aed;
    
    --color-accent: #06b6d4;
    --color-accent-light: #2dd4bf;
    --color-accent-dark: #0891b2;
    
    /* Design System Colors */
    --color-background-primary: #ffffff;
    --color-background-secondary: #f8fafc;
    --color-text-primary: #1e293b;
    --color-text-secondary: #64748b;
    
    --background: #f8fafc;
    --foreground: #1e293b;
    --card: #ffffff;
    --card-foreground: #1e293b;
    --muted: #f1f5f9;
    --muted-foreground: #64748b;
    --border: #e2e8f0;
    --input: #f8fafc;
    --ring: #0a2540;
    
    /* Gradient Colors */
    --gradient-start: #0a2540;
    --gradient-end: #8b5cf6;
    
    /* Shadows */
    --shadow-color: #000000;
    --shadow-2xs: 0rem 0.25rem 0.5rem 0rem hsl(0 0% 0% / 0.05);
    --shadow-xs: 0rem 0.25rem 0.5rem 0rem hsl(0 0% 0% / 0.05);
    --shadow-sm: 0rem 0.25rem 0.5rem 0rem hsl(0 0% 0% / 0.10), 0rem 1px 2px -1px hsl(0 0% 0% / 0.10);
    --shadow-md: 0rem 0.25rem 0.5rem 0rem hsl(0 0% 0% / 0.10), 0rem 2px 4px -1px hsl(0 0% 0% / 0.10);
    --shadow-lg: 0rem 0.25rem 0.5rem 0rem hsl(0 0% 0% / 0.10), 0rem 4px 6px -1px hsl(0 0% 0% / 0.10);
    --shadow-xl: 0rem 0.25rem 0.5rem 0rem hsl(0 0% 0% / 0.10), 0rem 8px 10px -1px hsl(0 0% 0% / 0.10);
    --shadow-2xl: 0rem 0.25rem 0.5rem 0rem hsl(0 0% 0% / 0.25);
    
    /* Border Radius */
    --radius: 0.5rem;
}

/* ========================================
   BASE STYLES
   ======================================== */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Inter', 'Nunito', sans-serif;
    color: var(--color-text-primary);
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
    padding-top: 64px; /* Height of fixed navbar on mobile */
}

@media (min-width: 768px) {
    body {
        padding-top: 80px; /* Height of fixed navbar on desktop */
    }
}

nav {
    position: fixed;
    top: 0;
    z-index: 100;
}

/* Prevent horizontal overflow - keep containers fluid */
.container {
    max-width: 100%;
}

/* Ensure box-sizing for all elements */
* {
    box-sizing: border-box;
}

/* Allow flex and grid containers to shrink */
.flex, .grid, [class*="flex"], [class*="grid"] {
    min-width: 0;
}

/* Ensure images and media respect bounds */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* Force text to wrap and prevent overflow */
h1, h2, h3, h4, h5, h6, p, span, div, a {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Prevent whitespace from causing overflow */
pre, code {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Mobile-specific overflow prevention */
@media (max-width: 768px) {
    * {
        box-sizing: border-box;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    section {
        width: 100%;
        max-width: 100vw;
    }
    
    /* Prevent grid and flex overflow */
    .grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Ensure all content boxes fit */
    .bg-white, .bg-gray-50, .bg-gradient-to-br {
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Ensure padding doesn't cause overflow */
    [class*="px-"], [class*="pl-"], [class*="pr-"] {
        max-width: 100%;
    }
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero-section {
    /* Use dynamic viewport height for better mobile support */
    min-height: 100vh;
    min-height: 100dvh; /* For browsers that support dvh */
}

/* Ensure hero content is never too cramped on mobile */
@media (max-width: 768px) {
    .hero-section {
        min-height: calc(100vh - 64px); /* Account for navbar */
        min-height: calc(100dvh - 64px);
    }
}

/* ========================================
   BRAIN ANIMATION
   ======================================== */
.brain-animation, .brain-animation-small {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
}

.brain-animation-small {
    width: 200px;
    height: 200px;
}

.brain-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.6);
}

.brain-animation-small .brain-core {
    width: 40px;
    height: 40px;
}

.brain-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid rgba(139, 92, 246, 0.2);
}

.orbit-1 {
    width: 120px;
    height: 120px;
    animation: rotate 20s linear infinite;
}

.orbit-2 {
    width: 200px;
    height: 200px;
    animation: rotate 30s linear infinite reverse;
}

.orbit-3 {
    width: 280px;
    height: 280px;
    animation: rotate 40s linear infinite;
}

.brain-animation-small .orbit-1 {
    width: 80px;
    height: 80px;
}

.brain-animation-small .orbit-2 {
    width: 130px;
    height: 130px;
}

.brain-animation-small .orbit-3 {
    width: 180px;
    height: 180px;
}

.brain-node {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--color-secondary);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
}

.brain-animation-small .brain-node {
    width: 8px;
    height: 8px;
}

.orbit-1 .brain-node:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.orbit-1 .brain-node:nth-child(2) {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.orbit-2 .brain-node:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.orbit-2 .brain-node:nth-child(2) {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.orbit-2 .brain-node:nth-child(3) {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.orbit-3 .brain-node:nth-child(1) {
    top: 20%;
    right: 20%;
}

.orbit-3 .brain-node:nth-child(2) {
    bottom: 20%;
    left: 20%;
}

.orbit-3 .brain-node:nth-child(3) {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

@keyframes rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }
}

/* ========================================
   CUSTOM COMPONENTS & EFFECTS
   Use Tailwind classes where possible, these are special effects
   ======================================== */

.modern-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.modern-card:hover {
    transform: translateY(-0.5rem);
    box-shadow: var(--shadow-xl);
}

/* Glass Morphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pattern Background */
.pattern-bg {
    background-color: #f8fafc;
    background-image: 
        radial-gradient(circle at 20px 20px, rgba(10, 37, 64, 0.03) 1px, transparent 0),
        radial-gradient(circle at 80px 80px, rgba(139, 92, 246, 0.03) 1px, transparent 0);
    background-size: 100px 100px;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
    overflow: hidden;
}

/* Fluid Background - General styles for any section */
.fluid-background-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.fluid-background-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-section .fluid-background-container {
    pointer-events: none;
}

.hero-section .fluid-background-container canvas {
    pointer-events: none;
}

.highlight {
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 0.1em;
    left: 0;
    right: 0;
    height: 0.3em;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
    opacity: 0.2;
    z-index: -1;
}

/* ========================================
   TAB SYSTEM
   ======================================== */
.tab-button {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tab-button.active {
    background: var(--color-secondary);
    color: white;
    border-color: var(--color-secondary);
}

.tab-button:not(.active):hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.use-case-content {
    display: none;
}

.use-case-content.active {
    display: grid;
    animation: fadeIn 0.5s ease-in-out;
}

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

/* ========================================
   CODE PREVIEW
   ======================================== */
.code-preview {
    position: relative;
    overflow: hidden;
}

.code-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-preview div {
    line-height: 1.8;
}

/* ========================================
   SECURITY VISUAL
   ======================================== */
.shield {
    position: relative;
    animation: float 6s ease-in-out infinite;
}

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

/* ========================================
   FADE IN ANIMATION
   ======================================== */
.fade-in {
    opacity: 1;
    animation: fadeInUp 0.6s ease-out;
}

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

/* ========================================
   SECTION SPACING
   ======================================== */
.section {
    position: relative;
}

/* ========================================
   WORKFLOW ITEMS
   ======================================== */
.workflow-item {
    transition: transform 0.2s ease;
}

.workflow-item:hover {
    transform: translateX(10px);
}

/* ========================================
   BUTTONS
   ======================================== */
.button {
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.button:hover::before {
    width: 300px;
    height: 300px;
}

/* ========================================
   CUSTOM SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-secondary);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
    .brain-animation {
        width: 200px;
        height: 200px;
    }
    
    .brain-core {
        width: 40px;
        height: 40px;
    }
    
    .orbit-1 {
        width: 80px;
        height: 80px;
    }
    
    .orbit-2 {
        width: 130px;
        height: 130px;
    }
    
    .orbit-3 {
        width: 180px;
        height: 180px;
    }
    
    .brain-node {
        width: 8px;
        height: 8px;
    }
    
    .hero-section {
        min-height: auto;
        padding: 3rem 0;
    }
    
    .code-preview {
        font-size: 0.75rem;
        padding: 1rem !important;
    }
}

/* ========================================
   INTEGRATION LOGOS
   ======================================== */
.integration-logo {
    transition: all 0.3s ease;
    opacity: 0.6;
}

.integration-logo:hover {
    opacity: 1;
    color: var(--color-secondary) !important;
    transform: scale(1.1);
}

/* ========================================
   STEP NUMBERS
   ======================================== */
.step-number {
    position: relative;
    z-index: 1;
}

.step-number::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: var(--color-secondary);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.1;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.1;
    }
}

/* ========================================
   SECURITY ICONS
   ======================================== */
.security-icon i {
    /* Animation removed for cleaner appearance */
}

.security-icon i:nth-child(2) {
    /* Animation removed for cleaner appearance */
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.tagline {
    letter-spacing: 0.1em;
}

/* ========================================
   INTEGRATIONS SCROLL
   ======================================== */
.integrations-scroll-container {
    width: 100%;
    overflow: hidden;
}

.integrations-row {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.integrations-track {
    display: inline-flex;
    gap: 1.5rem;
    animation: scroll-right 30s linear infinite;
}

.integrations-row.reverse .integrations-track {
    animation: scroll-left 30s linear infinite;
}

.integration-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    background: white;
    border: 2px solid rgba(139, 92, 246, 0.1);
    border-radius: 1rem;
    min-width: 140px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.integration-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.15);
}

.integration-card i {
    color: #64748b;
    transition: color 0.3s ease;
}

.integration-card:hover i {
    color: #8b5cf6;
}

.integration-card span {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

@keyframes scroll-right {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes scroll-left {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

.integrations-row:hover .integrations-track {
    animation-play-state: paused;
}

/* ========================================
   QUIZ ANIMATIONS
   ======================================== */
.fade-in {
    animation: fadeIn 0.4s ease-in;
}

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

/* ========================================
   SMOOTH TRANSITIONS
   ======================================== */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

button, a, .card {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}
