/* Global Reset & Base */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    --brand-cyan: #22d3ee;
    --brand-indigo: #4f46e5;
    --brand-emerald: #10b981;
    --brand-rose: #f43f5e;
    --bg-dark: #020617;
    --glass: rgba(15, 23, 42, 0.7);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-dark);
    color: #cbd5e1;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Enhanced Glassmorphism */
.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(34, 211, 238, 0.3);
    transform: translateY(-4px);
}

.glow-cyan {
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
    animation: glow-pulse 3s infinite ease-in-out;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(34, 211, 238, 0.3); }
    50% { box-shadow: 0 0 30px rgba(34, 211, 238, 0.5); }
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(90deg, #22d3ee 0%, #4f46e5 50%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animations */
@keyframes slide-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scan-line {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

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

@keyframes bounce-subtle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

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

@keyframes slide-in-left {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(4); opacity: 0; }
}

@keyframes modal-fade-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.animate-slide-in {
    animation: slide-in 0.6s ease forwards;
}

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

.animate-fade-in {
    animation: fade-in 0.8s ease forwards;
}

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

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

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

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

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.8), transparent);
    animation: scan-line 3s linear infinite;
    pointer-events: none;
}

/* Scroll-Spy Navigation */
.sub-nav-btn,
.feature-nav-btn,
.deployment-nav-btn,
.security-nav-btn,
.resources-nav-btn {
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    padding: 8px 12px;
    border-radius: 8px;
    color: #94a3b8;
}

.sub-nav-btn:hover,
.feature-nav-btn:hover,
.deployment-nav-btn:hover,
.security-nav-btn:hover,
.resources-nav-btn:hover {
    color: #22d3ee;
    background: rgba(34, 211, 238, 0.1);
}

.sub-nav-btn.active,
.feature-nav-btn.active,
.deployment-nav-btn.active,
.security-nav-btn.active,
.resources-nav-btn.active {
    color: #22d3ee;
    background: rgba(34, 211, 238, 0.1);
    border-color: #22d3ee;
}

.sub-nav-btn.active::after,
.feature-nav-btn.active::after,
.deployment-nav-btn.active::after,
.security-nav-btn.active::after,
.resources-nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #22d3ee;
    border-radius: 2px;
}

/* Enhanced Cards */
.enhanced-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.enhanced-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.7s ease;
}

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

.enhanced-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Image Container Hover Effects */
.image-container {
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    background: #0f172a;
    transition: transform 0.4s ease;
    cursor: pointer;
}

.image-container:hover {
    transform: scale(1.03);
}

.image-container:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 50%);
}

.image-container .group-hover\\:text-cyan-400 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: all 0.3s ease;
}

.image-container:hover .group-hover\\:text-cyan-400 {
    transform: translate(-50%, -50%) scale(1.2);
}

/* Image Modal */
#image-modal {
    backdrop-filter: blur(10px);
    animation: modal-fade-in 0.3s ease;
}

#image-modal img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* Progress Bars */
.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22d3ee, #4f46e5);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 2s infinite;
}

/* Hover Effects for Buttons */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
}

.btn-hover-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.6);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn-hover-effect:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

/* Form Enhancements */
.input-enhanced {
    transition: all 0.3s ease;
    background: rgba(30, 41, 59, 0.5) !important;
    border: 1px solid rgba(71, 85, 105, 0.5) !important;
}

.input-enhanced:focus {
    border-color: #22d3ee !important;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1) !important;
    transform: translateY(-1px);
}

.input-enhanced:hover:not(:focus) {
    border-color: rgba(71, 85, 105, 0.8) !important;
    background: rgba(30, 41, 59, 0.7) !important;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Table Row Hover Effects */
.table-row-hover {
    transition: all 0.3s ease;
}

.table-row-hover:hover {
    background: rgba(30, 41, 59, 0.5) !important;
    transform: scale(1.005);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #0f172a;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    border: 1px solid #334155;
    font-size: 12px;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Demo Preview */
#demo-preview {
    transition: all 0.3s ease;
}

/* Chart Bars */
#chart-container div {
    transition: all 0.3s ease;
    cursor: pointer;
}

#chart-container div:hover {
    opacity: 0.8;
    transform: scaleY(1.1);
}

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

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #22d3ee, #4f46e5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4f46e5, #22d3ee);
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: transform 0.3s ease-in-out, opacity 0.3s ease;
    transform-origin: top center;
}

#mobile-menu.hidden {
    opacity: 0;
    transform: scaleY(0);
    display: none !important;
}

#mobile-menu:not(.hidden) {
    opacity: 1;
    transform: scaleY(1);
    display: block !important;
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    animation: ripple-animation 0.6s linear;
}

@keyframes ripple-animation {
    to {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}

/* Floating Elements */
.floating {
    animation: float 6s ease-in-out infinite;
}

.floating-delay-1 {
    animation-delay: 1s;
}

.floating-delay-2 {
    animation-delay: 2s;
}

/* Shine Effect */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.7s ease;
}

.shine-effect:hover::before {
    left: 100%;
}

/* Staggered Animation for Lists */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: slide-in 0.6s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }

/* Typing Effect */
.typing-effect {
    overflow: hidden;
    border-right: 2px solid #22d3ee;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #22d3ee; }
}

/* Gradient Border */
.gradient-border {
    position: relative;
    background: linear-gradient(#0f172a, #0f172a) padding-box,
                linear-gradient(90deg, #22d3ee, #4f46e5) border-box;
    border: 2px solid transparent;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 3px solid #22d3ee;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .glass {
        backdrop-filter: blur(8px);
    }
    
    .animate-float {
        animation: none;
    }
    
    .sub-nav-btn,
    .feature-nav-btn,
    .deployment-nav-btn,
    .security-nav-btn,
    .resources-nav-btn {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    #image-modal {
        padding: 1rem;
    }
    
    #image-modal img {
        max-height: 70vh;
    }
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #020617;
    }
}

/* Print Styles */
@media print {
    .glass,
    .enhanced-card,
    .scan-line {
        box-shadow: none !important;
        background: white !important;
        color: black !important;
        border: 1px solid #ddd !important;
    }
    
    .no-print {
        display: none !important;
    }
}

/* Selection Color */
::selection {
    background-color: rgba(34, 211, 238, 0.3);
    color: white;
}

::-moz-selection {
    background-color: rgba(34, 211, 238, 0.3);
    color: white;
}
