/**
 * Allyvo Shared Styles
 * Common design patterns used across all pages
 * Includes gradients, buttons, animations, and utilities
 */

/* ============================================
   SMOOTH SCROLLING
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* ============================================
   GRADIENTS
   ============================================ */

.gradient-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-subtle {
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
}

.gradient-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ============================================
   BUTTONS
   ============================================ */

/* Primary button — solid indigo outline (matches btn-secondary pattern) */
.btn-primary {
    background: white;
    border: 2px solid #4f46e5;
    color: #4f46e5;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 200ms ease-in-out;
}

.btn-primary:hover {
    background: #4f46e5;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Secondary button */
.btn-secondary {
    background: white;
    border: 2px solid #6366f1;
    color: #6366f1;
    transition: all 200ms ease-in-out;
}

.btn-secondary:hover {
    background: #eef2ff;
}

/* Ghost button */
.btn-ghost {
    background: transparent;
    color: #6366f1;
    transition: all 200ms ease-in-out;
}

.btn-ghost:hover {
    background: #eef2ff;
}

/* Danger button */
.btn-danger {
    background: #ef4444;
    color: white;
    transition: all 200ms ease-in-out;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ============================================
   CARDS
   ============================================ */

.card-elevated {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 200ms ease-in-out;
}

.card-elevated:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-interactive {
    cursor: pointer;
    transition: all 200ms ease-in-out;
}

.card-interactive:hover {
    border-color: #6366f1;
    background: #faf5ff;
}

/* ============================================
   FEATURE CARDS (for landing page)
   ============================================ */

.feature-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 32px;
    transition: all 300ms ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
    margin-bottom: 16px;
}

/* ============================================
   INPUTS & FORMS
   ============================================ */

.input-primary:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* ============================================
   HEADERS & NAVIGATION
   ============================================ */

.header-sticky {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
}

/* ============================================
   STATUS BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: #eef2ff;
    color: #6366f1;
}

.badge-success {
    background: #d1fae5;
    color: #059669;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

.badge-danger {
    background: #fee2e2;
    color: #dc2626;
}

.badge-info {
    background: #dbeafe;
    color: #2563eb;
}

.badge-neutral {
    background: #f3f4f6;
    color: #6b7280;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

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

.fade-in {
    animation: fadeIn 300ms ease-in-out;
}

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

.slide-up {
    animation: slideUp 300ms ease-out;
}

/* Loading spinner */
.spinner {
    border: 2px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 600ms linear infinite;
}

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

/* ============================================
   UTILITIES
   ============================================ */

/* Focus visible for accessibility */
.focus-primary:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Hover lift effect */
.hover-lift {
    transition: transform 200ms ease-in-out;
}

.hover-lift:hover {
    transform: translateY(-2px);
}

/* Text gradient */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Smooth transitions */
.transition-all {
    transition: all 200ms ease-in-out;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

/* Mobile-first breakpoints match Tailwind */
@media (max-width: 640px) {
    .feature-card {
        padding: 24px;
    }
}

/* ============================================
   DUAL-THUMB RANGE SLIDER (Job Level)
   ============================================ */

.level-slider-track {
    position: relative;
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 9999px;
}

.level-slider-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0.5rem;
    margin: 0;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Webkit (Chrome, Safari, Edge) */
.level-slider-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 1.25rem;
    width: 1.25rem;
    border-radius: 9999px;
    background: #4f46e5;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    pointer-events: auto;
}

.level-slider-thumb::-webkit-slider-thumb:hover {
    background: #4338ca;
    transform: scale(1.15);
}

.level-slider-thumb:focus-visible::-webkit-slider-thumb {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Firefox */
.level-slider-thumb::-moz-range-thumb {
    height: 1.25rem;
    width: 1.25rem;
    border-radius: 9999px;
    background: #4f46e5;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    pointer-events: auto;
}

.level-slider-thumb::-moz-range-thumb:hover {
    background: #4338ca;
}

.level-slider-thumb::-moz-range-track {
    background: transparent;
    border: none;
}

.level-slider-thumb:focus-visible::-moz-range-thumb {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}




/* ============================================
   VIEW TOGGLE
   ============================================ */

.view-toggle-btn {
    color: #9ca3af;
    background: transparent;
}

.view-toggle-btn:hover {
    color: #6366f1;
}

.view-toggle-btn.active {
    background: white;
    color: #4f46e5;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}


/* ============================================
   SLIDE-OUT PANELS (Chat, Search) — Mobile fixes
   ============================================ */

/* Use dynamic viewport height so panels shrink when virtual keyboard opens */
.slideout-panel {
    height: 100dvh;
    height: 100vh; /* fallback for older browsers */
}

@supports (height: 100dvh) {
    .slideout-panel {
        height: 100dvh;
    }
}

/* Mobile close bar — visible drag handle at top of panel on small screens */
.slideout-close-bar {
    display: none;
}

@media (max-width: 639px) {
    .slideout-close-bar {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 0 4px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .slideout-close-bar .close-handle {
        width: 36px;
        height: 4px;
        border-radius: 9999px;
        background: #d1d5db;
    }
}
