/* ================================================
   CloyAI Modern UI - Main Stylesheet
   Dark Interface + Neon Highlights Design System
   ================================================ */

/* ================================================
   Base Styles & Custom Properties
   ================================================ */
:root {
    --cloy-dark: #0a0a0f;
    --cloy-darker: #050508;
    --cloy-card: #12121a;
    --cloy-border: #1f1f2e;
    --cloy-muted: #6b7280;
    --cloy-neon: #a7f300;
    --cloy-neon-cyan: #00d4ff;
    --cloy-neon-purple: #a855f7;
    --cloy-neon-pink: #ec4899;

    --transition-fast: 150ms;
    --transition-normal: 300ms;
    --transition-slow: 500ms;
}

/* Smooth scrolling & Prevent horizontal overflow */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Selection styling */
::selection {
    background: rgba(167, 243, 0, 0.3);
    color: white;
}

/* ================================================
   Navigation Styles
   ================================================ */
.nav-link {
    position: relative;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
    transition: color var(--transition-normal) ease;
}

.nav-link:hover,
.nav-link.active {
    color: white;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cloy-neon), var(--cloy-neon-cyan));
    border-radius: 2px;
    transition: width var(--transition-normal) ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ================================================
   Button Styles
   ================================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, var(--cloy-neon), var(--cloy-neon-cyan));
    color: var(--cloy-dark);
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all var(--transition-normal) ease;
    box-shadow: 0 0 20px rgba(167, 243, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(167, 243, 0, 0.5);
}

.btn-primary-lg {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--cloy-neon), var(--cloy-neon-cyan));
    color: var(--cloy-dark);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 1rem;
    transition: all var(--transition-normal) ease;
    box-shadow: 0 0 30px rgba(167, 243, 0, 0.3);
}

.btn-primary-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(167, 243, 0, 0.5);
}

.btn-secondary-lg {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 1rem;
    transition: all var(--transition-normal) ease;
}

.btn-secondary-lg:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--cloy-border);
    color: white;
    font-weight: 500;
    border-radius: 0.75rem;
    transition: all var(--transition-normal) ease;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost-lg {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: transparent;
    border: 1px solid var(--cloy-border);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 1rem;
    transition: all var(--transition-normal) ease;
}

.btn-ghost-lg:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ================================================
   Feature Cards
   ================================================ */
.feature-card {
    position: relative;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.8), rgba(18, 18, 26, 0.4));
    border: 1px solid var(--cloy-border);
    border-radius: 1.5rem;
    transition: all var(--transition-normal) ease;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(167, 243, 0, 0.05), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal) ease;
}

.feature-card:hover {
    border-color: rgba(167, 243, 0, 0.3);
    transform: translateY(-4px);
}

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

.feature-icon {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    transition: transform var(--transition-normal) ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

/* ================================================
   Step Cards
   ================================================ */
.step-card {
    position: relative;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.6), rgba(18, 18, 26, 0.3));
    border: 1px solid var(--cloy-border);
    border-radius: 1.5rem;
    text-align: center;
    transition: all var(--transition-normal) ease;
}

.step-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-4px);
}

.step-number {
    position: absolute;
    top: -1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 1rem;
    background: linear-gradient(135deg, var(--cloy-neon-cyan), var(--cloy-neon-purple));
    color: var(--cloy-dark);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 2rem;
}

.step-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(168, 85, 247, 0.1));
    border-radius: 1.25rem;
    color: var(--cloy-neon-cyan);
}

/* ================================================
   CTA Card
   ================================================ */
.cta-card {
    position: relative;
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.8), rgba(18, 18, 26, 0.4));
    border: 1px solid var(--cloy-border);
    border-radius: 2rem;
    overflow: hidden;
}

/* ================================================
   Pricing Cards
   ================================================ */
.pricing-card {
    position: relative;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.8), rgba(18, 18, 26, 0.4));
    border: 1px solid var(--cloy-border);
    border-radius: 1.5rem;
    transition: all var(--transition-normal) ease;
}

.pricing-card:hover {
    border-color: rgba(167, 243, 0, 0.3);
    transform: translateY(-4px);
}

.pricing-card.popular {
    border-color: var(--cloy-neon);
    box-shadow: 0 0 40px rgba(167, 243, 0, 0.2);
}

.pricing-card.popular::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(167, 243, 0, 0.08), transparent);
    border-radius: 1.5rem;
    pointer-events: none;
}

.pricing-badge {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 1.25rem;
    background: linear-gradient(135deg, var(--cloy-neon), var(--cloy-neon-cyan));
    color: var(--cloy-dark);
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
    pointer-events: none;
}

/* Pricing card buttons - ensure clickable */
.pricing-card button {
    position: relative;
    z-index: 5;
    cursor: pointer;
}

/* ================================================
   Social Icons
   ================================================ */
.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--cloy-border);
    border-radius: 0.75rem;
    color: #9ca3af;
    transition: all var(--transition-normal) ease;
}

.social-icon:hover {
    background: rgba(167, 243, 0, 0.1);
    border-color: var(--cloy-neon);
    color: var(--cloy-neon);
    transform: translateY(-2px);
}

/* ================================================
   Form Styles
   ================================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--cloy-border);
    border-radius: 0.75rem;
    color: white;
    font-size: 1rem;
    transition: all var(--transition-normal) ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--cloy-neon);
    box-shadow: 0 0 0 3px rgba(167, 243, 0, 0.1);
}

.form-input::placeholder {
    color: #6b7280;
}

/* ================================================
   Gallery Grid
   ================================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--cloy-card);
    border: 1px solid var(--cloy-border);
    transition: all var(--transition-normal) ease;
}

.gallery-item:hover {
    border-color: rgba(167, 243, 0, 0.3);
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow) ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal) ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* ================================================
   FAQ Accordion
   ================================================ */
.faq-item {
    background: rgba(18, 18, 26, 0.6);
    border: 1px solid var(--cloy-border);
    border-radius: 1rem;
    overflow: hidden;
    transition: all var(--transition-normal) ease;
}

.faq-item:hover {
    border-color: rgba(167, 243, 0, 0.2);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-normal) ease;
}

.faq-question:hover {
    color: var(--cloy-neon);
}

.faq-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(167, 243, 0, 0.1);
    color: var(--cloy-neon);
    transition: transform var(--transition-normal) ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal) ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer-content {
    padding: 0 1.5rem 1.25rem;
    color: #9ca3af;
    line-height: 1.7;
}

/* ================================================
   Dashboard Styles
   ================================================ */
.dashboard-card {
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.8), rgba(18, 18, 26, 0.4));
    border: 1px solid var(--cloy-border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    transition: all var(--transition-normal) ease;
}

.dashboard-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.8), rgba(18, 18, 26, 0.4));
    border: 1px solid var(--cloy-border);
    border-radius: 1rem;
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: white;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ================================================
   User Menu (Navbar)
   ================================================ */
.user-menu {
    position: relative;
}

.user-menu .user-menu-toggle {
    cursor: pointer;
}

.user-menu .user-menu-toggle:hover {
    border-color: rgba(167, 243, 0, 0.5);
    box-shadow: 0 0 20px rgba(167, 243, 0, 0.2);
}

.user-menu .dropdown-icon {
    transition: transform var(--transition-normal) ease;
}

.user-menu .dropdown-icon.rotate-180 {
    transform: rotate(180deg);
}

.user-dropdown a:hover {
    padding-left: 1.25rem;
}

/* Responsive user menu */
@media (max-width: 640px) {
    .user-menu .user-menu-toggle span {
        display: none;
    }

    .user-menu .user-menu-toggle {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* ================================================
   Auth Pages
   ================================================ */
.auth-card {
    max-width: 28rem;
    margin: 0 auto;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.9), rgba(18, 18, 26, 0.6));
    border: 1px solid var(--cloy-border);
    border-radius: 2rem;
    backdrop-filter: blur(20px);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--cloy-border);
}

.social-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--cloy-border);
    border-radius: 0.75rem;
    color: white;
    font-weight: 500;
    transition: all var(--transition-normal) ease;
}

.social-auth-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ================================================
   Animations & Effects
   ================================================ */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

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

.shimmer {
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Glow effect on hover */
.glow-hover {
    transition: all var(--transition-normal) ease;
}

.glow-hover:hover {
    box-shadow: 0 0 30px rgba(167, 243, 0, 0.3);
}

/* ================================================
   Responsive Utilities
   ================================================ */
@media (max-width: 768px) {
    .hero-slider {
        max-width: 100%;
    }

    .auth-card {
        padding: 2rem;
        border-radius: 1.5rem;
    }

    .feature-card,
    .step-card,
    .pricing-card {
        padding: 1.5rem;
    }
}

/* ================================================
   Scrollbar Styling
   ================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--cloy-darker);
}

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

::-webkit-scrollbar-thumb:hover {
    background: #2a2a3a;
}

/* ================================================
   Loading States
   ================================================ */
.skeleton {
    background: linear-gradient(90deg,
            var(--cloy-card) 25%,
            rgba(255, 255, 255, 0.05) 50%,
            var(--cloy-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

/* ================================================
   Counter Section Styles
   ================================================ */
.counter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--cloy-border);
    border-radius: 1rem;
}

.counter-btn {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(167, 243, 0, 0.1);
    border: 1px solid rgba(167, 243, 0, 0.3);
    border-radius: 0.75rem;
    color: var(--cloy-neon);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-normal) ease;
}

.counter-btn:hover {
    background: rgba(167, 243, 0, 0.2);
    transform: scale(1.05);
}

.counter-display {
    flex: 1;
    text-align: center;
}

.counter-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: white;
}

.counter-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ================================================
   Hero Slider Enhancement
   ================================================ */
.hero-slider {
    position: relative;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--cloy-card), var(--cloy-darker));
}

/* ================================================
   Before/After Slider
   ================================================ */
.before-after-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.before-after-slider .before-image,
.before-after-slider .after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.before-after-slider .before-image img,
.before-after-slider .after-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.before-after-slider .slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: col-resize;
    z-index: 20;
    transform: translateX(-50%);
    transition: left 0.05s ease-out;
}

/* Smooth transition when not dragging */
.before-after-slider:not(.is-dragging) .slider-handle {
    transition: left 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* After image smooth transition */
.before-after-slider:not(.is-dragging) .after-image {
    transition: clip-path 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.before-after-slider .slider-handle::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 50px;
    transform: translateX(-50%);
    cursor: col-resize;
}

/* Slider handle button - neon styling */
.before-after-slider .slider-button {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.before-after-slider.is-dragging .slider-button {
    transform: translate(-50%, -50%) scale(1.15) !important;
    box-shadow: 0 0 40px rgba(167, 243, 0, 0.8) !important;
}

/* Pulsing glow animation on handle */
.before-after-slider .slider-handle>div:first-child {
    animation: handle-glow 2s ease-in-out infinite;
}

@keyframes handle-glow {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(167, 243, 0, 0.6);
    }

    50% {
        box-shadow: 0 0 25px rgba(167, 243, 0, 0.9);
    }
}

/* Hint text animation */
.before-after-slider .slider-hint {
    animation: pulse-hint 2s ease-in-out infinite;
}

.before-after-slider.has-interacted .slider-hint {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

@keyframes pulse-hint {

    0%,
    100% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.05);
    }
}

/* ================================================
   Page Transitions
   ================================================ */
.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--transition-slow) ease, transform var(--transition-slow) ease;
}

/* ================================================
   Tooltip Styles
   ================================================ */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: var(--cloy-card);
    border: 1px solid var(--cloy-border);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal) ease;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}