/* ===================================
   NeggAutomate - Dark Theme Styles
   Inspired by Majoli.io
   =================================== */

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

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

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

::-webkit-scrollbar-thumb {
    background: #2d2d2d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #FF6B35;
}

/* Selection color */
::selection {
    background-color: #FF6B35;
    color: white;
}

/* ===================================
   Text Gradient Effect
   =================================== */

.text-gradient {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8A5B 50%, #FF6B35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===================================
   Animations
   =================================== */

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-fade-in-delay {
    animation: fadeIn 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.animate-fade-in-delay-2 {
    animation: fadeIn 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

.animate-fade-in-delay-3 {
    animation: fadeIn 0.8s ease-out 0.6s forwards;
    opacity: 0;
}

/* Glow animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 107, 53, 0.5);
    }
}

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

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

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

/* ===================================
   Scroll Animations (JS triggered)
   =================================== */

.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delay for cards */
.scroll-animate:nth-child(1) { transition-delay: 0.1s; }
.scroll-animate:nth-child(2) { transition-delay: 0.15s; }
.scroll-animate:nth-child(3) { transition-delay: 0.2s; }
.scroll-animate:nth-child(4) { transition-delay: 0.25s; }
.scroll-animate:nth-child(5) { transition-delay: 0.3s; }
.scroll-animate:nth-child(6) { transition-delay: 0.35s; }

/* ===================================
   Header styles
   =================================== */

#header {
    transition: all 0.3s ease;
    background: transparent;
}

#header.scrolled {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(45, 45, 45, 0.5);
}

/* ===================================
   Service cards
   =================================== */

.service-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-5px);
}

/* ===================================
   Use case cards
   =================================== */

.use-case {
    transition: all 0.3s ease;
}

.use-case:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 107, 53, 0.3);
}

/* ===================================
   Process steps
   =================================== */

.process-step {
    transition: all 0.3s ease;
}

.process-step:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 107, 53, 0.3);
}

/* ===================================
   Stat cards
   =================================== */

.stat-card {
    position: relative;
    transition: all 0.3s ease;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #FF6B35, #FF8A5B);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.stat-card:hover::after {
    width: 60%;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 107, 53, 0.3);
}

/* ===================================
   Form styles - Dark theme
   =================================== */

#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.15);
}

#contact-form input.error,
#contact-form select.error {
    border-color: #ef4444;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* Loading state for submit button */
#submit-btn {
    position: relative;
}

#submit-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

#submit-btn.loading span {
    visibility: hidden;
}

#submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Select dropdown styling for dark theme */
#contact-form select option {
    background: #111111;
    color: white;
}

/* ===================================
   Mobile menu
   =================================== */

#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

#mobile-menu.open {
    max-height: 400px;
    padding-bottom: 1rem;
}

/* ===================================
   CTA button effects
   =================================== */

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 107, 53, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
    }
}

.cta-pulse {
    animation: pulse 2s infinite;
}

/* ===================================
   Background effects
   =================================== */

.bg-grid {
    background-image:
        linear-gradient(rgba(255, 107, 53, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 107, 53, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ===================================
   Hero Background - Wave Dots
   =================================== */

.hero-bg {
    position: absolute;
    top: 40%;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

#hero {
    position: relative;
    overflow: hidden;
}

/* Canvas for wave dots */
#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Gradient orbs */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 8s ease-in-out infinite;
}

/* ===================================
   Contact CTA Cards
   =================================== */

.contact-cta-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.contact-cta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.05) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.contact-cta-card:hover::before {
    opacity: 1;
}

.contact-cta-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 107, 53, 0.5);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 107, 53, 0.1);
}

.contact-cta-card .icon-wrapper {
    transition: all 0.4s ease;
}

.contact-cta-card:hover .icon-wrapper {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.4);
}

/* Calendly button special style */
.calendly-btn {
    background: linear-gradient(135deg, #FF6B35 0%, #E85A24 100%);
    position: relative;
    overflow: hidden;
}

.calendly-btn::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 ease;
}

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

.calendly-btn:hover {
    box-shadow: 0 10px 40px rgba(255, 107, 53, 0.4);
    transform: translateY(-2px);
}

/* Contact form button */
.contact-form-btn {
    border: 2px solid rgba(255, 107, 53, 0.5);
    background: transparent;
    transition: all 0.3s ease;
}

.contact-form-btn:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: #FF6B35;
}

/* AI Animation for contact section */
.ai-visual {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.ai-visual-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid rgba(255, 107, 53, 0.3);
}

.ai-visual-ring:nth-child(1) {
    width: 60px;
    height: 60px;
    animation: ringPulse 2s ease-in-out infinite;
}

.ai-visual-ring:nth-child(2) {
    width: 90px;
    height: 90px;
    animation: ringPulse 2s ease-in-out infinite 0.3s;
}

.ai-visual-ring:nth-child(3) {
    width: 120px;
    height: 120px;
    animation: ringPulse 2s ease-in-out infinite 0.6s;
}

.ai-visual-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #FF6B35, #FF8A5B);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.6);
    animation: corePulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
}

@keyframes corePulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(255, 107, 53, 0.6);
    }
    50% {
        box-shadow: 0 0 50px rgba(255, 107, 53, 0.9);
    }
}

/* ===================================
   Calendar Picker
   =================================== */

.calendar-widget {
    min-height: 120px;
}

/* Spinner */
.cal-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #2d2d2d;
    border-top-color: #FF6B35;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Grid layout: 5 columns (lun-ven) */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
}

/* Day header */
.cal-day-header {
    text-align: center;
    padding: 6px 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9CA3AF;
    border-bottom: 1px solid #2d2d2d;
    margin-bottom: 4px;
}

.cal-day-header .cal-day-date {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    color: #6B7280;
    margin-top: 1px;
}

/* Day column */
.cal-day-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Slot button */
.cal-slot {
    padding: 6px 4px;
    font-size: 0.75rem;
    text-align: center;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #1a1a1a;
    color: #9CA3AF;
}

.cal-slot:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: rgba(255, 107, 53, 0.3);
    color: white;
}

.cal-slot.selected {
    background: #FF6B35;
    color: white;
    border-color: #FF6B35;
    font-weight: 600;
}

.cal-slot.unavailable {
    background: #111111;
    color: #4B5563;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.4;
}

.cal-slot.unavailable:hover {
    background: #111111;
    border-color: transparent;
    color: #4B5563;
}

/* Navigation buttons */
.cal-nav-btn {
    color: #9CA3AF;
}

.cal-nav-btn:hover:not(:disabled) {
    color: white;
}

/* Calendar error for form validation */
.calendar-picker.has-error .calendar-widget {
    border-color: #ef4444;
    animation: shake 0.5s ease;
}

/* ===================================
   Responsive adjustments
   =================================== */

@media (max-width: 768px) {
    /* Reduce animation intensity on mobile */
    .animate-float {
        animation-duration: 6s;
    }

    .scroll-animate {
        transform: translateY(20px);
    }

    /* Adjust hero text size */
    .font-heading {
        letter-spacing: -0.02em;
    }

    /* Contact cards stack nicely */
    .contact-cta-card {
        padding: 1.5rem;
    }

    /* Calendar compact on mobile */
    .cal-slot {
        padding: 4px 2px;
        font-size: 0.65rem;
    }

    .cal-day-header {
        font-size: 0.65rem;
    }

    .cal-day-header .cal-day-date {
        font-size: 0.6rem;
    }
}

@media (max-width: 640px) {
    /* Further mobile adjustments */
    .text-gradient {
        background-size: 200% auto;
    }
}

/* ===================================
   Print styles
   =================================== */

@media print {
    #header,
    #mobile-menu-btn {
        display: none;
    }

    .animate-float,
    .animate-glow {
        animation: none;
    }

    body {
        background: white;
        color: black;
    }

    footer {
        page-break-inside: avoid;
    }
}

/* ===================================
   Accessibility
   =================================== */

/* Focus visible styles for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #FF6B35;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@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;
    }

    .scroll-animate {
        opacity: 1;
        transform: none;
    }

    .bubble {
        animation: none !important;
        opacity: 0.3 !important;
    }
}

/* ===================================
   Glass effect utilities
   =================================== */

.glass {
    background: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(45, 45, 45, 0.5);
}

.glass-light {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===================================
   Hover effects
   =================================== */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.3);
}

/* ===================================
   Modal styles
   =================================== */

#contact-form-modal {
    animation: fadeIn 0.3s ease;
}

#contact-form-modal > div:last-child {
    animation: slideUp 0.3s ease;
}

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

/* Custom scrollbar for modal */
#contact-form-modal > div:last-child::-webkit-scrollbar {
    width: 6px;
}

#contact-form-modal > div:last-child::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 3px;
}

#contact-form-modal > div:last-child::-webkit-scrollbar-thumb {
    background: #FF6B35;
    border-radius: 3px;
}

/* ===================================
   Border gradient effect
   =================================== */

.border-gradient {
    position: relative;
    background: #111111;
}

.border-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, #FF6B35, transparent, #FF6B35);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.border-gradient:hover::before {
    opacity: 1;
}
