/* Granova Custom Styles - Enhanced Animations & Interactions */
:root {
    --granova-blue: #2563eb;
    --granova-light: #e0f2fe;
    --granova-dark: #1e40af;
    --granova-gray: #64748b;
    --granova-success: #10b981;
    --granova-warning: #f59e0b;
    --granova-danger: #ef4444;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-large: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

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

@keyframes pulseSoft {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

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

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(37, 99, 235, 0.3), 0 0 10px rgba(37, 99, 235, 0.2);
    }
    100% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.6), 0 0 30px rgba(37, 99, 235, 0.4);
    }
}

@keyframes spinSlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-20px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(0);
    }
    70% {
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

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

/* Enhanced Base Styles */
* {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Enhanced Button Styles */
.hero-btn-primary {
    background: linear-gradient(135deg, var(--granova-blue) 0%, var(--granova-dark) 100%);
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
    box-shadow: var(--shadow-large);
    position: relative;
    overflow: hidden;
}

.hero-btn-primary::before {
    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;
}

.hero-btn-primary:hover::before {
    left: 100%;
}

.hero-btn-secondary {
    position: relative;
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-medium);
}

.hero-btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--granova-blue);
    transition: width 0.3s ease;
    z-index: -1;
}

.hero-btn-secondary:hover::before {
    width: 100%;
}

/* Enhanced Card Styles */
.feature-card {
    position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 231, 235, 0.8);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.05), transparent);
    transition: left 0.8s ease;
}

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

.feature-card:hover {
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(145deg, #ffffff 0%, rgba(224, 242, 254, 0.3) 100%);
}

.dashboard-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    animation: spinSlow 10s linear infinite;
    z-index: -1;
}

.dashboard-item {
    position: relative;
    overflow: hidden;
}

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

.dashboard-item:hover::before {
    left: 100%;
}

/* Enhanced Navigation */
.navbar {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--granova-blue);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::before {
    width: 100%;
}

.nav-link.active::before {
    width: 100%;
}

/* Enhanced Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--granova-light) 0%, rgba(255, 255, 255, 0.9) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232563eb' fill-opacity='0.05'%3E%3Ccircle cx='7' cy='7' r='7'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    z-index: -1;
}

.hero-bg-animation {
    background: linear-gradient(-45deg, #2563eb, #1e40af, #3b82f6, #60a5fa);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

.hero-title {
    position: relative;
}

.hero-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--granova-blue), var(--granova-dark));
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    animation: scaleX 1s ease-out 0.5s forwards;
}

@keyframes scaleX {
    to {
        transform: scaleX(1);
    }
}

/* Testimonial cards */
.testimonial-card {
    position: relative;
    overflow: hidden;
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--granova-blue), var(--granova-dark));
}

/* Stats counter animation */
.stat-number {
    font-weight: 800;
    color: var(--granova-blue);
    animation: pulse 2s infinite;
}

/* FAQ improvements */
.faq-item {
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-left-color: var(--granova-blue);
    background-color: rgba(37, 99, 235, 0.02);
}

/* Form enhancements */
.form-input {
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: var(--granova-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .feature-card {
        margin-bottom: 1.5rem;
    }
    
    .mobile-center {
        text-align: center;
    }
    
    .mobile-stack {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .dark-mode-support {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .dark-mode-support .feature-card {
        background-color: #374151;
        border-color: #4b5563;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
    
    .print-optimize {
        page-break-inside: avoid;
    }
}

/* 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: 0;
}

/* Focus indicators */
*:focus {
    outline: 2px solid var(--granova-blue);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .high-contrast {
        border: 2px solid;
        background: white;
        color: black;
    }
}

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

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

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

::-webkit-scrollbar-thumb {
    background: var(--granova-blue);
    border-radius: 4px;
}

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

/* Selection styling */
::selection {
    background-color: var(--granova-blue);
    color: white;
}

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

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Utility classes */
.text-granova-blue { color: var(--granova-blue); }
.bg-granova-blue { background-color: var(--granova-blue); }
.border-granova-blue { border-color: var(--granova-blue); }

.text-granova-dark { color: var(--granova-dark); }
.bg-granova-dark { background-color: var(--granova-dark); }

.text-granova-light { color: var(--granova-light); }
.bg-granova-light { background-color: var(--granova-light); }

/* Enhanced Animation Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}

/* Demo Section Enhancements */
.demo-card {
    position: relative;
    overflow: hidden;
}

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

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

.benefits-card {
    position: relative;
    overflow: hidden;
}

.benefit-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.benefit-item:hover {
    transform: translateX(5px);
}

.cta-card {
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: spinSlow 8s linear infinite;
    z-index: 0;
}

.cta-card > * {
    position: relative;
    z-index: 1;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}

.animate-scale-up {
    animation: scaleUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}

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

.animate-bounce-slow {
    animation: bounceSlow 4s ease-in-out infinite;
}

.animate-float-slow {
    animation: floatSlow 8s ease-in-out infinite;
}

.animate-pulse-soft {
    animation: pulseSoft 3s ease-in-out infinite;
}

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

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

.animate-spin-slow {
    animation: spinSlow 3s linear infinite;
}

/* Counter Animation */
.counter-animate {
    background: linear-gradient(45deg, var(--granova-blue), var(--granova-dark));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradient 2s ease infinite;
}

/* Micro Interactions */
.micro-bounce {
    transition: transform 0.1s ease;
}

.micro-bounce:active {
    transform: scale(0.98);
}

.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-large);
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(37, 99, 235, 0.1);
    z-index: 9999;
}

.scroll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--granova-blue), var(--granova-dark));
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

/* Enhanced Testimonial Cards */
.testimonial-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--granova-blue), var(--granova-dark));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

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

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* Enhanced FAQ Section */
.faq-item {
    border-left: 4px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
    overflow: hidden;
}

.faq-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.05), transparent);
    transition: left 0.5s ease;
}

.faq-item:hover::before {
    left: 100%;
}

.faq-item:hover {
    border-left-color: var(--granova-blue);
    background: linear-gradient(145deg, #ffffff 0%, rgba(224, 242, 254, 0.3) 100%);
    transform: translateX(5px);
}

.faq-active {
    border-left-color: var(--granova-blue);
    background: linear-gradient(145deg, #ffffff 0%, rgba(224, 242, 254, 0.5) 100%);
    box-shadow: var(--shadow-medium);
}

/* Loading and Skeleton States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(37, 99, 235, 0.3);
    border-left-color: var(--granova-blue);
    border-radius: 50%;
    animation: spinSlow 1s linear infinite;
}

/* Glass Morphism Effects */
.glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow-large);
}

/* Interactive Elements */
.interactive-element {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive-element:hover {
    transform: scale(1.05);
}

.interactive-element:active {
    transform: scale(0.95);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(45deg, var(--granova-blue), var(--granova-dark));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .feature-card {
        margin-bottom: 1.5rem;
        transform: none !important;
    }
    
    .feature-card:hover {
        transform: translateY(-3px) !important;
    }
    
    .dashboard-card {
        animation: none;
    }
    
    .mobile-center {
        text-align: center;
    }
    
    .mobile-stack {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Reduce animations on mobile for performance */
    .animate-float {
        animation: none;
    }
    
    .hero-bg-animation {
        animation-duration: 20s;
    }
}

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

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Responsive typography */
@media (max-width: 640px) {
    .responsive-text-4xl { font-size: 2.25rem; }
    .responsive-text-5xl { font-size: 3rem; }
    .responsive-text-6xl { font-size: 3.75rem; }
}

@media (min-width: 640px) {
    .responsive-text-4xl { font-size: 2.25rem; }
    .responsive-text-5xl { font-size: 3rem; }
    .responsive-text-6xl { font-size: 3.75rem; }
}

@media (min-width: 1024px) {
    .responsive-text-4xl { font-size: 2.25rem; }
    .responsive-text-5xl { font-size: 3rem; }
    .responsive-text-6xl { font-size: 4rem; }
}

/* Modal Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

.animate-bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Additional Modal Styles */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

/* Success Modal Specific Styles */
#successModal .animate-bounce-gentle {
    animation: bounce-slow 2s ease-in-out infinite;
}

#successModal .animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}