/**
 * NivoSync Design Tokens
 *
 * CSS custom properties, minimal reset, and shared utility classes.
 * This is the ONLY file loaded on every NivoSync page — everything else
 * is template-specific.
 *
 * Sources (merged & deduplicated):
 *   - ns-frontend.css   :root variables + base reset
 *   - ns-theme-variables.css  semantic aliases
 *
 * @package NivoSync
 * @since   2.1.0
 */

/* ==========================================================================
   1. CSS Custom Properties — :root
   ========================================================================== */

:root {
    /* ---- Brand Colors ---- */
    --ns-primary: #1a1a2e;
    --ns-primary-hover: #2563eb;
    --ns-primary-light: #2d2d44;
    --ns-primary-dark: #1d4ed8;
    --ns-secondary: #c9a961;
    --ns-secondary-hover: #4b5563;
    --ns-secondary-light: #d4bc82;
    --ns-accent: #4a90d9;
    --ns-accent-hover: #059669;

    /* ---- Diamond Type Colors ---- */
    --ns-natural: #2c5282;
    --ns-natural-light: #3182ce;
    --ns-labgrown: #276749;
    --ns-labgrown-light: #38a169;

    /* ---- Neutrals ---- */
    --ns-white: #ffffff;
    --ns-gray-50: #f9fafb;
    --ns-gray-100: #f3f4f6;
    --ns-gray-200: #e5e7eb;
    --ns-gray-300: #d1d5db;
    --ns-gray-400: #9ca3af;
    --ns-gray-500: #6b7280;
    --ns-gray-600: #4b5563;
    --ns-gray-700: #374151;
    --ns-gray-800: #1f2937;
    --ns-gray-900: #111827;

    /* ---- Semantic / Text / Background / Border ---- */
    --ns-text-primary: #111827;
    --ns-text-secondary: #6b7280;
    --ns-text-muted: #9ca3af;
    --ns-text-light: #ffffff;
    --ns-bg-primary: #ffffff;
    --ns-bg-secondary: #f9fafb;
    --ns-bg-tertiary: #f3f4f6;
    --ns-bg-dark: #1f2937;
    --ns-border-light: #e5e7eb;
    --ns-border-medium: #d1d5db;
    --ns-border-dark: #9ca3af;
    --ns-success: #10b981;
    --ns-warning: #f59e0b;
    --ns-error: #ef4444;
    --ns-info: #3b82f6;

    /* ---- Typography ---- */
    --ns-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --ns-font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
    --ns-font-family: var(--ns-font-sans);
    --ns-font-family-heading: var(--ns-font-family);
    --ns-font-family-mono: "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    --ns-font-size-xs: 0.75rem;
    --ns-font-size-sm: 0.875rem;
    --ns-font-size-base: 1rem;
    --ns-font-size-lg: 1.125rem;
    --ns-font-size-xl: 1.25rem;
    --ns-font-size-2xl: 1.5rem;
    --ns-font-size-3xl: 1.875rem;
    --ns-font-size-4xl: 2.25rem;
    --ns-font-weight-normal: 400;
    --ns-font-weight-medium: 500;
    --ns-font-weight-semibold: 600;
    --ns-font-weight-bold: 700;
    --ns-line-height-tight: 1.25;
    --ns-line-height-normal: 1.5;
    --ns-line-height-relaxed: 1.75;
    --ns-letter-spacing-tight: -0.025em;
    --ns-letter-spacing-normal: 0;
    --ns-letter-spacing-wide: 0.025em;
    --ns-letter-spacing-wider: 0.05em;

    /* ---- Spacing ---- */
    --ns-spacing-xs: 0.25rem;
    --ns-spacing-sm: 0.5rem;
    --ns-spacing-md: 1rem;
    --ns-spacing-lg: 1.5rem;
    --ns-spacing-xl: 2rem;
    --ns-spacing-2xl: 3rem;

    /* ---- Layout ---- */
    --ns-container-max-width: 1400px;
    --ns-sidebar-width: 280px;
    --ns-grid-gap: 20px;

    /* ---- Borders & Radius ---- */
    --ns-radius-sm: 0.25rem;
    --ns-radius-md: 0.5rem;
    --ns-radius-lg: 0.75rem;
    --ns-radius-xl: 1rem;
    --ns-radius-full: 9999px;
    --ns-border-radius-sm: 4px;
    --ns-border-radius-md: 6px;
    --ns-border-radius-lg: 8px;
    --ns-border-radius-xl: 12px;
    --ns-border-radius-full: 9999px;
    --ns-border-width: 1px;

    /* ---- Shadows ---- */
    --ns-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ns-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --ns-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --ns-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --ns-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* ---- Transitions ---- */
    --ns-transition-fast: 150ms ease;
    --ns-transition: 200ms ease;
    --ns-transition-normal: 200ms ease;
    --ns-transition-slow: 300ms ease;

    /* ---- Z-Index Scale ---- */
    --ns-z-dropdown: 100;
    --ns-z-sticky: 200;
    --ns-z-fixed: 300;
    --ns-z-modal-backdrop: 400;
    --ns-z-modal: 500;
    --ns-z-popover: 600;
    --ns-z-tooltip: 700;
}

/* ==========================================================================
   2. Minimal Reset (scoped to .nivosync-wrapper)
   ========================================================================== */

.nivosync-wrapper,
.nivosync-wrapper *,
.nivosync-wrapper *::before,
.nivosync-wrapper *::after {
    box-sizing: border-box;
}

.nivosync-wrapper {
    font-family: var(--ns-font-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ns-gray-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.nivosync-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
}

.nivosync-wrapper a {
    color: inherit;
    text-decoration: none;
    transition: color var(--ns-transition);
}

.nivosync-wrapper button {
    font-family: inherit;
    cursor: pointer;
}

/* ==========================================================================
   3. SVG Utilities
   ========================================================================== */

.stroke-current {
    stroke: currentColor;
}

.fill-current {
    fill: currentColor;
}

/* ==========================================================================
   4. Screen-Reader Only
   ========================================================================== */

.nivosync-wrapper .ns-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;
}

/* ==========================================================================
   5. Loading States
   ========================================================================== */

.ns-loading {
    position: relative;
    pointer-events: none;
}

.ns-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

.ns-loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--ns-gray-200);
    border-top-color: var(--ns-primary);
    border-radius: 50%;
    animation: ns-spin 0.8s linear infinite;
    z-index: 11;
}

@keyframes ns-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   6. Skeleton Loading
   ========================================================================== */

.ns-skeleton {
    background: linear-gradient(90deg, var(--ns-gray-200) 25%, var(--ns-gray-100) 50%, var(--ns-gray-200) 75%);
    background-size: 200% 100%;
    animation: ns-skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--ns-radius-md);
}

@keyframes ns-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ns-skeleton-card {
    height: 380px;
}

.ns-skeleton-line {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.ns-skeleton-line--short {
    width: 60%;
}

/* ==========================================================================
   7. No Results State
   ========================================================================== */

.ns-no-results {
    text-align: center;
    padding: var(--ns-spacing-2xl);
    background: var(--ns-gray-50);
    border-radius: var(--ns-radius-lg);
}

.ns-no-results-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--ns-spacing-lg);
    color: var(--ns-gray-400);
}

.ns-no-results-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ns-gray-800);
    margin: 0 0 var(--ns-spacing-sm);
}

.ns-no-results-text {
    color: var(--ns-gray-600);
    margin: 0 0 var(--ns-spacing-lg);
}

.ns-no-results-actions {
    display: flex;
    justify-content: center;
    gap: var(--ns-spacing-md);
}
