/* HostMox Website - Custom Styles */

/* CSS Variables for Design Tokens */
:root {
    --color-primary: #1953AC;
    --color-primary-light: #2F6FE0;
    --color-primary-dark: #0F3C8A;
    --color-secondary: #FFFFFF;
    --color-accent: #1953AC;
    --color-accent-hover: #0F3C8A;
    --color-text-primary: #1E293B;
    --color-text-secondary: #64748B;
    --color-text-light: #94A3B8;
    --color-surface: #F4F8FF;
    --color-border: #E0E9F7;
    --spacing-unit: 8px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(25, 83, 172, 0.05);
    --shadow-md: 0 4px 12px rgba(25, 83, 172, 0.08);
    --shadow-lg: 0 8px 24px rgba(25, 83, 172, 0.12);
    --shadow-xl: 0 16px 48px rgba(25, 83, 172, 0.16);
}

/* Base Styles */
* {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    box-sizing: border-box;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-secondary);
}

/* Button Styles */
.btn-primary {
    background: var(--color-accent);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(25, 83, 172, 0.35);
}

.btn-secondary {
    background: var(--color-secondary);
    border: 2px solid var(--color-border);
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: var(--color-accent);
    color: white;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* Gradient Backgrounds */
.gradient-hero {
    background: linear-gradient(135deg, #0F3C8A 0%, #1953AC 50%, #2F6FE0 100%);
}

.gradient-accent {
    background: linear-gradient(135deg, #1953AC 0%, #2F6FE0 100%);
}

/* Pulse Animation */
.pulse-dot {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Float Animation */
.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Server Node Styles */
.server-node {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #E0E9F7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    animation: float 4s ease-in-out infinite;
}

.server-node::before {
    content: '';
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1953AC 0%, #2F6FE0 100%);
    border-radius: 8px;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2'%3E%3C/path%3E%3C/svg%3E") center/contain no-repeat;
}

/* Mobile Menu Animation */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu.active {
    transform: translateX(0);
}

/* Accordion Animation */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-content.active {
    max-height: 500px;
}

/* Pricing Card Highlight */
.pricing-highlight {
    position: relative;
    border: 2px solid var(--color-accent);
    transform: scale(1.02);
}

.pricing-highlight::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg, var(--color-accent), #0EA5E9);
    border-radius: var(--radius-lg);
    z-index: -1;
    opacity: 0.1;
}

/* Feature Icon Container */
.icon-container {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(25, 83, 172, 0.1) 0%, rgba(47, 111, 224, 0.1) 100%);
    border-radius: var(--radius-md);
}

/* Data Flow Animations */
@keyframes dataFlow1 {
    0% { transform: translate(0, 0); opacity: 0; }
    50% { opacity: 0.7; }
    100% { transform: translate(180px, 180px); opacity: 0; }
}

@keyframes dataFlow2 {
    0% { transform: translate(0, 0); opacity: 0; }
    50% { opacity: 0.7; }
    100% { transform: translate(-180px, 180px); opacity: 0; }
}

@keyframes dataFlow3 {
    0% { transform: translate(0, 0); opacity: 0; }
    50% { opacity: 0.7; }
    100% { transform: translate(180px, -180px); opacity: 0; }
}

/* Sticky Mobile CTA */
.sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: white;
    padding: 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.sticky-cta.visible {
    transform: translateY(0);
}

/* Pricing Scroll for Mobile */
.pricing-scroll {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.pricing-scroll > * {
    scroll-snap-align: center;
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Typography */
@media (max-width: 640px) {
    :root {
        --spacing-unit: 6px;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .server-node {
        width: 60px;
        height: 60px;
    }
    
    .pricing-highlight {
        transform: scale(1);
    }
}

/* Tablet Optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .card-hover:hover {
        transform: translateY(-4px);
    }
}

/* Desktop Optimizations */
@media (min-width: 1024px) {
    .container-custom {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .gradient-hero,
    .gradient-accent {
        background-attachment: fixed;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Can be implemented later if needed */
}

/* Print Styles */
@media print {
    .mobile-menu,
    .sticky-cta,
    nav,
    footer {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-accent);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* 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;
        scroll-behavior: auto !important;
    }
}

/* Custom Selection Color */
::selection {
    background-color: var(--color-accent);
    color: white;
}

::-moz-selection {
    background-color: var(--color-accent);
    color: white;
}

/* Smooth Transitions for Theme Changes */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Override for animations */
*[class*="animate-"],
*[class*="transition-"] {
    transition-property: all;
}

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Form Styles */
input[type="email"],
input[type="text"],
input[type="tel"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="email"]:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(25, 83, 172, 0.1);
}

/* Table Responsive */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--color-accent) 0%, #2F6FE0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(25, 83, 172, 0.3);
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Grid System Enhancement */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-auto-fill {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Spacing Utilities */
.section-padding {
    padding: 4rem 0;
}

@media (min-width: 1024px) {
    .section-padding {
        padding: 6rem 0;
    }
}

/* Container Queries Support (Future-proofing) */
@supports (container-type: inline-size) {
    .container-query {
        container-type: inline-size;
    }
}

/* Aspect Ratio Utilities */
.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-square {
    aspect-ratio: 1 / 1;
}

/* Clamp for Responsive Typography */
.text-responsive-xl {
    font-size: clamp(2rem, 5vw, 4rem);
}

.text-responsive-lg {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.text-responsive-md {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
}
