/**
 * Custom CSS for Integration Hub Admin
 * Modern Google 2026 style - clean, minimalist, soft shadows
 */

/* ============================================================================
   Base Styles & CSS Variables
   ============================================================================ */

:root {
    /* Primary brand colors */
    --color-primary-50: #eff6ff;
    --color-primary-100: #dbeafe;
    --color-primary-200: #bfdbfe;
    --color-primary-300: #93c5fd;
    --color-primary-400: #60a5fa;
    --color-primary-500: #4285f4;
    --color-primary-600: #1a73e8;
    --color-primary-700: #1d4ed8;
    --color-primary-800: #1e40af;
    --color-primary-900: #1e3a8a;
    
    /* Status colors */
    --color-success: #34a853;
    --color-error: #ea4335;
    --color-warning: #fbbc04;
    
    /* Animation timings */
    --transition-fast: 150ms;
    --transition-normal: 200ms;
    --transition-slow: 300ms;
    
    /* Shadows */
    --shadow-soft: 0 2px 15px -3px rgba(0, 0, 0, 0.07), 0 10px 20px -2px rgba(0, 0, 0, 0.04);
    --shadow-soft-lg: 0 10px 40px -10px rgba(0, 0, 0, 0.1), 0 2px 10px -2px rgba(0, 0, 0, 0.04);
}

/* Dark mode variables */
.dark {
    --shadow-soft: 0 2px 15px -3px rgba(0, 0, 0, 0.25), 0 10px 20px -2px rgba(0, 0, 0, 0.15);
    --shadow-soft-lg: 0 10px 40px -10px rgba(0, 0, 0, 0.35), 0 2px 10px -2px rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   Smooth Scrolling & Focus States
   ============================================================================ */

html {
    scroll-behavior: smooth;
}

/* Better focus states for accessibility */
*:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

/* Remove focus outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================================================
   Selection Styles
   ============================================================================ */

::selection {
    background-color: var(--color-primary-200);
    color: var(--color-primary-900);
}

.dark ::selection {
    background-color: var(--color-primary-700);
    color: white;
}

/* ============================================================================
   Scrollbar Styling
   ============================================================================ */

/* Webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.5);
    border-radius: 9999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(148, 163, 184, 0.7);
}

.dark ::-webkit-scrollbar-thumb {
    background-color: rgba(71, 85, 105, 0.5);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(71, 85, 105, 0.7);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
}

.dark * {
    scrollbar-color: rgba(71, 85, 105, 0.5) transparent;
}

/* ============================================================================
   Animation Classes
   ============================================================================ */

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

.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease-out;
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slideInRight var(--transition-normal) ease-out;
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scaleIn var(--transition-fast) ease-out;
}

/* Pulse animation for live indicators */
@keyframes pulse-soft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse-soft {
    animation: pulse-soft 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Spin animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* ============================================================================
   Loading States
   ============================================================================ */

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(148, 163, 184, 0.1) 25%,
        rgba(148, 163, 184, 0.2) 50%,
        rgba(148, 163, 184, 0.1) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.dark .skeleton {
    background: linear-gradient(
        90deg,
        rgba(71, 85, 105, 0.1) 25%,
        rgba(71, 85, 105, 0.3) 50%,
        rgba(71, 85, 105, 0.1) 75%
    );
    background-size: 200% 100%;
}

/* ============================================================================
   Button Styles
   ============================================================================ */

/* Primary button hover effect */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
}

.btn-primary:hover::after {
    transform: translateX(100%);
}

/* ============================================================================
   Card Hover Effects
   ============================================================================ */

.card-hover {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft-lg);
}

/* ============================================================================
   Form Input Enhancements
   ============================================================================ */

/* Input floating label animation */
.input-group {
    position: relative;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    transform: translateY(-100%) scale(0.85);
    color: var(--color-primary-600);
}

.input-group label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform var(--transition-normal), color var(--transition-normal);
    pointer-events: none;
}

/* Input validation states */
.input-error {
    border-color: var(--color-error) !important;
    box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.1);
}

.input-success {
    border-color: var(--color-success) !important;
    box-shadow: 0 0 0 3px rgba(52, 168, 83, 0.1);
}

/* ============================================================================
   Table Styles
   ============================================================================ */

/* Zebra striping enhancement */
.table-zebra tbody tr:nth-child(even) {
    background-color: rgba(248, 250, 252, 0.5);
}

.dark .table-zebra tbody tr:nth-child(even) {
    background-color: rgba(30, 41, 59, 0.3);
}

/* Table row selection */
.table-row-selected {
    background-color: rgba(66, 133, 244, 0.1) !important;
}

.dark .table-row-selected {
    background-color: rgba(66, 133, 244, 0.2) !important;
}

/* ============================================================================
   Badge & Status Styles
   ============================================================================ */

/* Pulsing status indicator */
.status-online {
    position: relative;
}

.status-online::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 9999px;
    background: currentColor;
    opacity: 0.4;
    animation: pulse-soft 2s ease-in-out infinite;
}

/* ============================================================================
   Dropdown & Popover Styles
   ============================================================================ */

/* Dropdown arrow */
.dropdown-arrow::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 1rem;
    width: 12px;
    height: 12px;
    background: inherit;
    border: inherit;
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
}

/* ============================================================================
   Code & Monospace Styles
   ============================================================================ */

/* Code block styling */
pre code {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Menlo', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    tab-size: 4;
}

/* Inline code */
code:not(pre code) {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Menlo', monospace;
    font-size: 0.875em;
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
    background-color: rgba(148, 163, 184, 0.1);
}

.dark code:not(pre code) {
    background-color: rgba(71, 85, 105, 0.3);
}

/* ============================================================================
   Tooltip Styles
   ============================================================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    color: white;
    background-color: #1e293b;
    border-radius: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
    z-index: 50;
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ============================================================================
   Sidebar Styles
   ============================================================================ */

/* Sidebar item active indicator */
.sidebar-item-active {
    position: relative;
}

.sidebar-item-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--color-primary-600);
    border-radius: 0 3px 3px 0;
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
    /* Hide navigation and decorative elements */
    nav,
    aside,
    .no-print {
        display: none !important;
    }
    
    /* Ensure content is visible */
    main {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Remove shadows and backgrounds */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    /* Ensure links are visible */
    a[href]::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
        color: #666;
    }
}

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

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    padding: 0.5rem 1rem;
    background: var(--color-primary-600);
    color: white;
    text-decoration: none;
    z-index: 9999;
}

.skip-link:focus {
    top: 0;
}

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

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    :root {
        --shadow-soft: 0 0 0 2px currentColor;
        --shadow-soft-lg: 0 0 0 2px currentColor;
    }
    
    .border-slate-200\/50 {
        border-color: currentColor !important;
    }
}
