/* Custom styles for EntityNext Technology Consulting Landing Page */

/* Modern Typography Foundation */
:root {
    --font-sans: 'Inter', 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Poppins', 'Inter', system-ui, sans-serif;
    --font-heading: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', monospace;
}

/* Enhanced font rendering and typography */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    font-variant-ligatures: common-ligatures;
    letter-spacing: -0.01em;
    line-height: 1.6;
}

/* Modern heading styles */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-rendering: optimizeLegibility;
}

h1 {
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

h2 {
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Display text styles */
.display-text {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

/* Enhanced button typography */
button, .btn {
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: -0.01em;
    text-rendering: optimizeLegibility;
}

/* Form input typography */
input, textarea, select {
    font-family: var(--font-sans);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.5;
}

/* Code and monospace elements */
code, pre, .font-mono {
    font-family: var(--font-mono);
    font-feature-settings: 'liga' 0;
    letter-spacing: 0;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

/* Contact Form Enhancements */
.contact-form-container {
    position: relative;
    overflow: hidden;
}

.contact-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(118, 109, 244, 0.05));
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.contact-form-container:hover::before {
    opacity: 1;
}

/* Form field animations */
.form-field {
    position: relative;
    transition: all 0.3s ease;
}

.form-field:hover {
    transform: translateY(-2px);
}

.form-field input:focus,
.form-field textarea:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

/* Floating label effect */
.floating-label {
    position: relative;
    overflow: hidden;
}

.floating-label label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    pointer-events: none;
    color: rgba(156, 163, 175, 0.7);
    font-size: 1rem;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label,
.floating-label textarea:focus + label,
.floating-label textarea:not(:placeholder-shown) + label {
    top: 0;
    left: 0.75rem;
    transform: translateY(-50%) scale(0.85);
    color: #8b5cf6;
    background: rgba(15, 23, 42, 0.8);
    padding: 0 0.5rem;
}

/* Button loading animation */
.btn-loading {
    position: relative;
    overflow: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-loading:hover::after {
    left: 100%;
}

/* Success/Error states */
.form-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.form-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Pulse animation for required fields */
.required-field::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ef4444, #f97316, #eab308, #22c55e, #3b82f6, #8b5cf6, #ef4444);
    border-radius: inherit;
    z-index: -1;
    animation: pulse-border 2s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.required-field:focus::before {
    opacity: 0.3;
}

@keyframes pulse-border {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Glassmorphism 2.0 Effects */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Gradient Text Effects */
.gradient-text {
    background: linear-gradient(135deg, #8b5cf6, #766df4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Custom animations for glassmorphism elements */
.glass-float {
    animation: glassFloat 6s ease-in-out infinite;
}

@keyframes glassFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    50% { 
        transform: translateY(-20px) rotate(1deg); 
    }
}

/* Neon glow effects */
.neon-glow {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    animation: neonPulse 2s ease-in-out infinite alternate;
}

@keyframes neonPulse {
    0% { 
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }
    100% { 
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.6);
    }
}

/* Custom backdrop blur utilities */
.backdrop-blur-glass {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Gradient borders */
.gradient-border {
    position: relative;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(118, 109, 244, 0.2));
    border-radius: 16px;
    padding: 1px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: linear-gradient(135deg, #8b5cf6, #766df4);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
}

/* Floating particles effect */
.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: floatParticle 8s infinite linear;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
    backdrop-filter: blur(10px);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

/* Loading state for buttons */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Focus styles for accessibility */
button:focus,
a:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-600: #0284c7;
        --gray-600: #374151;
        --gray-800: #1f2937;
    }
}

/* 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;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Print styles */
@media print {
    .fixed {
        position: static !important;
    }
    
    .shadow-lg,
    .shadow-xl,
    .shadow-2xl {
        box-shadow: none !important;
    }
    
    .backdrop-blur-xl,
    .backdrop-blur-sm {
        backdrop-filter: none !important;
    }
}

/* Custom gradient utilities */
.bg-gradient-radial {
    background: radial-gradient(circle, var(--tw-gradient-stops));
}

/* Enhanced glassmorphism for mobile */
@media (max-width: 768px) {
    .glass-card {
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
    
    /* Contact form mobile optimizations */
    .contact-form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .form-field {
        margin-bottom: 1rem;
    }
    
    .form-field input,
    .form-field textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem 1rem;
    }
    
    /* Improve button touch targets */
    button[type="submit"] {
        min-height: 48px;
        font-size: 1rem;
    }
    
    /* Better spacing for mobile */
    .space-y-5 > * + * {
        margin-top: 1rem;
    }
    
    .space-y-6 > * + * {
        margin-top: 1.25rem;
    }
    
    /* Mobile-specific hero improvements */
    .hero-section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    /* Additional mobile hero spacing */
    section.min-h-screen {
        padding-top: 5rem !important;
    }
    
    /* Reduce floating elements on mobile for performance */
    .animate-float {
        animation-duration: 8s;
    }
    
    /* Better mobile navigation */
    .mobile-menu {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    /* Mobile menu styling */
    #mobileMenu {
        margin: 0.5rem;
        border-radius: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    #mobileMenu > div {
        margin: 0;
        border-radius: 1rem;
        border-top: none;
        padding: 1rem;
    }
    
    /* Mobile menu links */
    #mobileMenu a {
        border-radius: 0.75rem;
        margin: 0.25rem 0;
        padding: 0.75rem 1rem;
    }
    
    /* Mobile menu close button spacing */
    #mobileMenu .close-btn {
        margin-right: 1rem;
        padding: 0.75rem;
    }
    
    /* Mobile navbar styling */
    #mainNavbar {
        margin: 0.5rem 0.25rem 0.5rem 0.5rem;
        width: calc(100% - 0.75rem);
        left: 0.5rem;
        right: 0.25rem;
        border-radius: 1rem;
        border-bottom: none;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        padding-right: 1rem;
    }
    
    /* Mobile navbar container padding */
    #mainNavbar .max-w-7xl {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    /* Mobile menu button spacing */
    #mobileMenuButton {
        margin-right: 1rem;
        padding: 0.75rem;
    }
    
    /* Mobile navbar scroll effect */
    #mainNavbar.scrolled {
        margin: 0;
        width: 100%;
        left: 0;
        right: 0;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        padding-right: 1rem;
    }
    
    /* Improve mobile card spacing */
    .bg-white\/10 {
        margin-bottom: 1rem;
    }
    
    /* Mobile-optimized text sizes */
    .text-hero {
        font-size: clamp(2rem, 8vw, 3rem);
        line-height: 1.2;
    }
    
    .text-subtitle {
        font-size: clamp(1rem, 4vw, 1.125rem);
        line-height: 1.5;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .contact-form-container {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .grid.grid-cols-1.sm\\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Stack buttons vertically on very small screens */
    .flex.flex-col.sm\\:flex-row {
        flex-direction: column;
    }
    
    .flex.flex-col.sm\\:flex-row > * + * {
        margin-top: 0.75rem;
        margin-left: 0;
    }
    
    /* Extra small mobile navbar adjustments */
    #mainNavbar .max-w-7xl {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    #mobileMenuButton {
        margin-right: 0.75rem;
        padding: 0.75rem;
    }
}

/* Logo responsive styles */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-container:hover img {
    transform: scale(1.05);
}

/* Ensure logo displays properly on all devices */
@media (max-width: 768px) {
    .logo-container {
        min-width: 24px;
        min-height: 24px;
    }
}

@media (max-width: 480px) {
    .logo-container {
        min-width: 20px;
        min-height: 20px;
    }
}

/* Modern Typography Utilities */
.text-balance {
    text-wrap: balance;
}

.text-pretty {
    text-wrap: pretty;
}

.font-display {
    font-family: var(--font-display);
}

.font-heading {
    font-family: var(--font-heading);
}

.font-mono {
    font-family: var(--font-mono);
}

/* Enhanced text styles for better readability */
.text-hero {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.text-subtitle {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: clamp(1.125rem, 2.5vw, 1.25rem);
    letter-spacing: -0.01em;
    line-height: 1.6;
}

.text-body {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 1rem;
    letter-spacing: -0.01em;
    line-height: 1.6;
}

.text-caption {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0;
    line-height: 1.5;
}

/* Improved gradient text with better font rendering */
.gradient-text {
    background: linear-gradient(135deg, #8b5cf6, #766df4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.02em;
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

/* Smooth gradient backgrounds to prevent banding */
.smooth-gradient {
    background: linear-gradient(135deg, #1e293b, #334155, #1e293b, #0f172a);
    background-size: 400% 400%;
    animation: smoothGradient 15s ease infinite;
}

@keyframes smoothGradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 100% 50%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 0% 100%;
    }
}

/* Enhanced background gradients with dithering */
.bg-gradient-smooth {
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 109, 244, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #334155 50%, #1e293b 75%, #0f172a 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
}

/* Purple Glass Button Effect */
.purple-glass-button {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(118, 109, 244, 0.15));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 
        0 8px 32px rgba(139, 92, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(139, 92, 246, 0.1);
    position: relative;
    overflow: hidden;
}

.purple-glass-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    transition: left 0.6s ease;
}

.purple-glass-button:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(118, 109, 244, 0.2));
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 
        0 12px 40px rgba(139, 92, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(139, 92, 246, 0.15);
    transform: translateY(-2px);
}

.purple-glass-button:hover::before {
    left: 100%;
}

.purple-glass-button:active {
    transform: translateY(0);
    box-shadow: 
        0 4px 20px rgba(139, 92, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(139, 92, 246, 0.1);
}

.purple-glass-button:focus {
    outline: 2px solid rgba(139, 92, 246, 0.5);
    outline-offset: 2px;
}

.purple-glass-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.purple-glass-button:disabled:hover {
    transform: none;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(118, 109, 244, 0.15));
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 
        0 8px 32px rgba(139, 92, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(139, 92, 246, 0.1);
}

/* Enhanced focus states for better accessibility */
:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Dark theme enhancements */
@media (prefers-color-scheme: dark) {
    .glass-card {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .glass-card:hover {
        background: rgba(255, 255, 255, 0.08);
    }
}