/* Full Potential AI Dashboard - Enhanced Professional Stylesheet */

:root {
    /* Refined Color Palette - Enhanced for visual appeal and accessibility */
    --primary-color: #64ffda;
    --primary-dark: #00e5a0;
    --primary-light: #a0ffe5;
    --secondary-color: #7c3aed;
    --secondary-dark: #5b21b6;
    --accent-color: #ff6b9d;
    --success-color: #2ed573;
    --warning-color: #ffa502;
    --danger-color: #ff6b6b;
    --info-color: #4facfe;

    /* Background System */
    --dark-bg: #0a0e1a;
    --dark-bg-secondary: #111827;
    --dark-surface: #1a1f35;
    --dark-surface-elevated: #222840;
    --glass-bg: rgba(26, 31, 53, 0.7);

    /* Text Colors - Enhanced Contrast */
    --text-color: #ffffff;
    --light-text: #f1f5f9;
    --muted-text: #cbd5e1;
    --ultra-muted: #94a3b8;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    --gradient-success: linear-gradient(135deg, #2ed573 0%, #10b981 100%);
    --gradient-mesh: linear-gradient(135deg, rgba(100, 255, 218, 0.1) 0%, rgba(79, 172, 254, 0.1) 100%);

    /* Shadows & Depth */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px rgba(100, 255, 218, 0.3);
    --shadow-glow-hover: 0 0 30px rgba(100, 255, 218, 0.5);

    /* Spacing Scale */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

/* Enhanced Typography Scale */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-color);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
    line-height: 1.7;
    color: #e2e8f0;
    font-weight: 400;
}

/* Selection styling */
::selection {
    background: var(--primary-color);
    color: var(--dark-bg);
}

::-moz-selection {
    background: var(--primary-color);
    color: var(--dark-bg);
}

/* Navigation - Glassmorphism Enhanced */
nav {
    background: var(--glass-bg);
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-base);
}

nav.scrolled {
    background: rgba(26, 31, 53, 0.95);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

nav .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(100, 255, 218, 0.3);
    transition: all var(--transition-base);
    cursor: pointer;
}

nav .logo:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav li {
    position: relative;
}

nav a {
    color: #f1f5f9;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transform: translateX(-50%);
    transition: width var(--transition-base);
}

nav a:hover {
    color: #ffffff;
    background: rgba(100, 255, 218, 0.15);
}

nav a:hover::after {
    width: 80%;
}

nav a.active {
    color: var(--primary-color);
    background: rgba(100, 255, 218, 0.12);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section - Enhanced with Depth */
.hero {
    text-align: center;
    padding: clamp(4rem, 10vh, 8rem) 2rem;
    background:
        radial-gradient(ellipse at top, rgba(100, 255, 218, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(79, 172, 254, 0.1) 0%, transparent 50%),
        var(--dark-bg);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(135deg, transparent 0%, rgba(100, 255, 218, 0.03) 50%, transparent 100%);
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-shadow: 0 0 40px rgba(100, 255, 218, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

.hero .tagline {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero .vision {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 800px;
    margin: 2rem auto;
    line-height: 1.8;
    color: var(--light-text);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Buttons - Modern Interactive Design */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    margin: 0.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    letter-spacing: 0.02em;
}

.btn::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;
    z-index: -1;
}

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

.btn-primary {
    background: var(--gradient-primary);
    color: #0a0e1a;
    font-weight: 700;
    text-shadow: none;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg), var(--shadow-glow-hover);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
    background: var(--dark-surface-elevated);
    color: #ffffff;
    font-weight: 600;
    border: 2px solid rgba(100, 255, 218, 0.3);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    background: rgba(100, 255, 218, 0.1);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
    box-shadow: var(--shadow-glow);
}

/* Status Widget */
.status-widget {
    background: var(--dark-surface);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 600px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem 0;
    background: var(--dark-bg);
    border-radius: 8px;
}

.status-online { color: var(--success-color); }
.status-degraded { color: var(--warning-color); }
.status-offline { color: var(--danger-color); }

/* Section */
section {
    padding: 4rem 2rem;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #ffffff;
    font-weight: 700;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.card {
    background: var(--dark-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid rgba(100, 255, 218, 0.1);
    transition: all var(--transition-slow);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-slow);
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(100, 255, 218, 0.3);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    background: var(--dark-surface-elevated);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 700;
    transition: color var(--transition-base);
}

.card:hover h3 {
    color: var(--primary-light);
    text-shadow: 0 0 20px rgba(100, 255, 218, 0.4);
}

/* Droplet Grid - Enhanced */
.droplet-card {
    background: var(--dark-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid rgba(100, 255, 218, 0.1);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.droplet-card:hover {
    transform: translateY(-4px);
    border-color: rgba(100, 255, 218, 0.3);
    box-shadow: var(--shadow-lg);
}

.droplet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.droplet-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: all var(--transition-base);
}

.droplet-status.online {
    background: var(--success-color);
    box-shadow: 0 0 12px var(--success-color), 0 0 24px rgba(46, 213, 115, 0.4);
    animation: pulse-online 2s ease-in-out infinite;
}

.droplet-status.offline {
    background: var(--danger-color);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.3);
}

.droplet-status.degraded {
    background: var(--warning-color);
    box-shadow: 0 0 10px var(--warning-color);
    animation: pulse-warning 1.5s ease-in-out infinite;
}

/* Sacred Loop Visualization */
.sacred-loop {
    max-width: 800px;
    margin: 3rem auto;
    text-align: center;
}

.loop-step {
    background: var(--dark-surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    border-left: 4px solid var(--primary-color);
    text-align: left;
}

.loop-step h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: var(--dark-surface);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
}

footer p {
    color: var(--muted-text);
}

/* Loading Spinner - Enhanced */
.spinner {
    width: 48px;
    height: 48px;
    margin: 2rem auto;
    border: 4px solid rgba(100, 255, 218, 0.1);
    border-top-color: var(--primary-color);
    border-right-color: var(--info-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    nav .container {
        flex-direction: column;
        gap: 1rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 3rem 1.5rem;
    }

    section {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0.75rem 0;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .card {
        padding: 1.5rem;
    }
}

/* ============================================ */
/* ANIMATIONS & KEYFRAMES */
/* ============================================ */

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-online {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
        box-shadow: 0 0 16px var(--success-color), 0 0 32px rgba(46, 213, 115, 0.6);
    }
}

@keyframes pulse-warning {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
        box-shadow: 0 0 14px var(--warning-color);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(100, 255, 218, 0.6), 0 0 40px rgba(100, 255, 218, 0.3);
    }
}

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

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Utility Classes */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

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

/* Focus States for Accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Smooth Scrollbar (Webkit) */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--info-color));
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
