* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Display', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #ffffff;
    color: #111827;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Navigation */
nav {
    animation: slideDown 0.6s ease-out;
}

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

/* Toggle Button Styles */
.toggle-btn {
    color: #6B7280;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.toggle-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.toggle-btn:hover:not(.active) {
    color: #111827;
    background: rgba(0, 0, 0, 0.05);
}

/* Content Visibility */
.customer-content,
.investor-content {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.customer-content.hidden,
.investor-content.hidden {
    display: none;
    opacity: 0;
}

/* Metric Cards */
.metric-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: #3B82F6;
}

/* Problem Cards */
.problem-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.problem-card:hover {
    transform: translateY(-6px) scale(1.02);
}

/* Feature Cards */
.feature-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #3B82F6, #6366F1, #8B5CF6);
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover::after {
    transform: translateX(0);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Chart Containers */
#marketChart,
#growthChart,
#financialProjections {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}

/* D3 Chart Styling */
.chart-line {
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-area {
    opacity: 0.15;
}

.chart-dot {
    stroke-width: 2;
    stroke: #ffffff;
    transition: all 0.2s ease;
}

.chart-dot:hover {
    r: 7;
    stroke-width: 3;
}

.chart-axis line,
.chart-axis path {
    stroke: #E5E7EB;
    stroke-width: 1;
}

.chart-axis text {
    fill: #6B7280;
    font-size: 11px;
    font-weight: 500;
}

.chart-label {
    font-size: 12px;
    font-weight: 600;
    fill: #374151;
}

.chart-value {
    font-size: 11px;
    font-weight: 500;
    fill: #6B7280;
}

.chart-grid line {
    stroke: #F3F4F6;
    stroke-width: 1;
    stroke-dasharray: 2, 4;
}

/* Bar Chart Styling */
.bar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar:hover {
    opacity: 0.8;
    filter: brightness(1.1);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Section Animations */
section {
    animation: fadeIn 0.8s ease-out;
}

/* Gradient Text */
.bg-gradient-to-r {
    background-size: 200% auto;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Hover Effects for Links/Buttons */
a, button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3B82F6, #6366F1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563EB, #4F46E5);
}

/* Code/Mono Text Styling */
.font-mono {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    letter-spacing: -0.01em;
}

/* Box Shadows */
.shadow-lg {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
}

.shadow-xl {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1), 0 16px 20px -12px rgba(0, 0, 0, 0.08);
}

.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 20px 25px -15px rgba(0, 0, 0, 0.12);
}

/* Hover Shadow Transitions */
.hover\:shadow-xl:hover {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12), 0 16px 20px -12px rgba(0, 0, 0, 0.1);
}

.hover\:shadow-2xl:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.18), 0 20px 25px -15px rgba(0, 0, 0, 0.15);
}

/* Border Glow Effect */
@keyframes borderGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
    }
}

.border-glow {
    animation: borderGlow 3s ease-in-out infinite;
}

/* Timeline Styling */
.timeline-dot {
    transition: all 0.3s ease;
}

.timeline-dot:hover {
    transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .metric-card {
        margin-bottom: 1rem;
    }
    
    nav .flex {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Print Styles */
@media print {
    nav,
    .toggle-btn {
        display: none;
    }
    
    .customer-content,
    .investor-content {
        display: block !important;
    }
}

/* Loading Animation */
.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Backdrop Blur Support */
@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
    nav {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Selection Styling */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: #111827;
}

::-moz-selection {
    background: rgba(59, 130, 246, 0.2);
    color: #111827;
}

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

/* Data Visualization Tooltips */
.tooltip {
    position: absolute;
    padding: 8px 12px;
    background: rgba(17, 24, 39, 0.95);
    color: #ffffff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tooltip.show {
    opacity: 1;
}

/* Grid Overlay for Technical Feel */
.grid-overlay {
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Accent Lines */
.accent-line {
    position: relative;
}

.accent-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #3B82F6, #6366F1, #8B5CF6);
    border-radius: 2px;
}

/* Number Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-up {
    animation: countUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Flip Effect for Interactive Elements */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.active {
    background: #10B981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-indicator.pending {
    background: #F59E0B;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.status-indicator.inactive {
    background: #6B7280;
}

/* Progress Bar */
.progress-bar {
    height: 6px;
    background: #E5E7EB;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #6366F1);
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.badge-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #1E40AF;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-green {
    background: rgba(16, 185, 129, 0.1);
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-orange {
    background: rgba(249, 115, 22, 0.1);
    color: #9A3412;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

/* Technical Diagram Lines */
.diagram-line {
    stroke: #3B82F6;
    stroke-width: 2;
    stroke-dasharray: 5, 5;
    animation: dash 20s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -100;
    }
}

/* Metric Animation on Scroll */
.metric-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Data Table Styling */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: #F9FAFB;
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    border-bottom: 2px solid #E5E7EB;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #F3F4F6;
    font-size: 14px;
    color: #374151;
}

tr:hover {
    background: #F9FAFB;
}

/* Interactive Elements */
.interactive:hover {
    cursor: pointer;
    transform: scale(1.02);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        #F3F4F6 0%,
        #E5E7EB 50%,
        #F3F4F6 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Performance Optimization */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .toggle-btn.active {
        border: 2px solid #000000;
    }
    
    .metric-card,
    .feature-card,
    .problem-card {
        border-width: 3px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
