/* ORAVYS Shared Utilities — Phase 4A (2026-02-25) */
/* Extracted from 85+ templates — only patterns present in 10+ files.
   Requires brand-variables.css to be loaded first for custom-property tokens.
   Usage: <link rel="stylesheet" href="/static/css/shared-utilities.css"> */


/* ==========================================================================
   1. CSS RESET
   ========================================================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    background: var(--bg-body, #0f0524);
    color: var(--text-main, #ffffff);
    line-height: 1.6;
    min-height: 100vh;
}

/* Remove default list and anchor decorations */
a {
    color: inherit;
    text-decoration: none;
}

/* Inherit fonts for form controls */
input,
textarea,
select,
button {
    font-family: inherit;
}

/* Mobile input font-size 16px — consolidated into nano-responsive.css */


/* ==========================================================================
   2. CUSTOM SCROLLBAR
   Dark theme with violet/cyan accent — found in 30+ templates.
   Thin (6px) dark track; gradient violet thumb; hover brightens.
   ========================================================================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(3, 0, 20, 0.8);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7c3aed, #6366f1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8b5cf6, #818cf8);
}

::-webkit-scrollbar-corner {
    background: rgba(3, 0, 20, 0.8);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #7c3aed rgba(3, 0, 20, 0.8);
}

/* Hide scrollbar on mobile (common pattern in 15+ templates) */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        display: none;
    }

    * {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
}


/* ==========================================================================
   3. GLASS MORPHISM
   .glass-card and .glass-panel appear verbatim in 10+ templates.
   Values derived from base.html, voice_intelligence_research.html,
   training_story.html, and 4 other confirmed sources.
   ========================================================================== */

.glass-card {
    background: var(--glass-bg, rgba(20, 10, 40, 0.60));
    border: 1px solid var(--glass-border, rgba(139, 92, 246, 0.30));
    border-radius: var(--radius-lg, 16px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s var(--ease-out, cubic-bezier(0.4, 0, 0.2, 1));
}

.glass-card:hover {
    border-color: rgba(167, 139, 250, 0.45);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35),
                0 0 0 1px rgba(139, 92, 246, 0.15);
    transform: translateY(-2px);
}

/* Lighter variant for panels, sidebars, overlays */
.glass-panel {
    background: var(--glass-bg-light, rgba(30, 15, 60, 0.40));
    border: 1px solid var(--glass-border-light, rgba(139, 92, 246, 0.15));
    border-radius: var(--radius-md, 12px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Navigation bars — invisible glass with blur (100+ template uses) */
.glass-nav {
    background: rgba(10, 10, 10, 0.40);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
}


/* ==========================================================================
   4. COMMON BUTTONS
   .btn base + .btn-primary (violet gradient) + .btn-secondary (ghost).
   Confirmed in base.html, intuition_recording.html, 24 other templates.
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md, 12px);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s var(--ease-out, cubic-bezier(0.4, 0, 0.2, 1));
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    overflow: hidden;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Primary — ORAVYS violet/indigo gradient (79+ template uses) */
.btn-primary {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.45);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Secondary — ghost glass style */
.btn-secondary {
    background: var(--glass-bg, rgba(20, 10, 40, 0.60));
    border: 1px solid var(--glass-border, rgba(139, 92, 246, 0.30));
    color: var(--text-main, #ffffff);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(124, 58, 237, 0.20);
    border-color: rgba(139, 92, 246, 0.50);
    transform: translateY(-1px);
}

/* Small size modifier */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    gap: 6px;
}

/* Large size modifier */
.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
    gap: 10px;
    border-radius: var(--radius-lg, 16px);
}

/* Pill shape modifier */
.btn-pill {
    border-radius: var(--radius-round, 9999px);
}


/* ==========================================================================
   5. TYPOGRAPHY UTILITIES
   .text-* helpers used across 100+ templates.
   .text-gradient applies the ORAVYS brand gradient clip (99+ templates).
   ========================================================================== */

.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }

.text-primary   { color: var(--text-main, #ffffff); }
.text-secondary { color: var(--text-secondary, rgba(255, 255, 255, 0.85)); }
.text-muted     { color: var(--text-muted, rgba(255, 255, 255, 0.60)); }
.text-dim       { color: var(--text-dim, rgba(255, 255, 255, 0.40)); }

.text-success  { color: var(--success, #10b981); }
.text-warning  { color: var(--warning, #f59e0b); }
.text-danger   { color: var(--danger, #ef4444); }
.text-info     { color: var(--info, #3b82f6); }

/* Brand gradient text — applied via background-clip.
   Present in 99 templates with pattern:
     background: linear-gradient(135deg, #a78bfa, #c0a062)
     -webkit-background-clip: text
     -webkit-text-fill-color: transparent                              */
.text-gradient {
    background: linear-gradient(135deg, #a78bfa, #c0a062);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* White-to-violet variant (used in titles on dark backgrounds) */
.text-gradient-white {
    background: linear-gradient(180deg, #ffffff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* White-to-cyan variant (Intuition / audio UI titles) */
.text-gradient-cyan {
    background: linear-gradient(180deg, #ffffff 0%, #66FCF1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Font weight helpers */
.font-300 { font-weight: 300; }
.font-400 { font-weight: 400; }
.font-500 { font-weight: 500; }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }
.font-800 { font-weight: 800; }
.font-900 { font-weight: 900; }


/* ==========================================================================
   6. SPACING UTILITIES
   .mt-* / .mb-* / .p-* scale on 0.5rem steps.
   Pattern from base.html confirmed across 100+ templates.
   ========================================================================== */

.mt-1 { margin-top: 0.5rem;  }
.mt-2 { margin-top: 1rem;    }
.mt-3 { margin-top: 1.5rem;  }
.mt-4 { margin-top: 2rem;    }
.mt-5 { margin-top: 3rem;    }

.mb-1 { margin-bottom: 0.5rem;  }
.mb-2 { margin-bottom: 1rem;    }
.mb-3 { margin-bottom: 1.5rem;  }
.mb-4 { margin-bottom: 2rem;    }
.mb-5 { margin-bottom: 3rem;    }

.ml-1 { margin-left: 0.5rem;  }
.ml-2 { margin-left: 1rem;    }
.ml-auto { margin-left: auto; }

.mr-1 { margin-right: 0.5rem; }
.mr-2 { margin-right: 1rem;   }
.mr-auto { margin-right: auto; }

.mx-auto { margin-left: auto; margin-right: auto; }

.p-1 { padding: 0.5rem;  }
.p-2 { padding: 1rem;    }
.p-3 { padding: 1.5rem;  }
.p-4 { padding: 2rem;    }

.px-1 { padding-left: 0.5rem;  padding-right: 0.5rem;  }
.px-2 { padding-left: 1rem;    padding-right: 1rem;    }
.px-3 { padding-left: 1.5rem;  padding-right: 1.5rem;  }
.px-4 { padding-left: 2rem;    padding-right: 2rem;    }

.py-1 { padding-top: 0.5rem;   padding-bottom: 0.5rem;   }
.py-2 { padding-top: 1rem;     padding-bottom: 1rem;     }
.py-3 { padding-top: 1.5rem;   padding-bottom: 1.5rem;   }
.py-4 { padding-top: 2rem;     padding-bottom: 2rem;     }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem;   }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem;   }


/* ==========================================================================
   7. LAYOUT
   .container, .flex-center, .grid-2col — found in 50+ templates.
   ========================================================================== */

/* Centered content wrapper (54 templates use max-width + margin:0 auto) */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(12px, 4vw, 24px);
}

/* Narrow content (single-column forms, article text) */
.container-sm  { max-width: 640px;  margin: 0 auto; padding: 0 clamp(12px, 4vw, 24px); }
.container-md  { max-width: 900px;  margin: 0 auto; padding: 0 clamp(12px, 4vw, 24px); }

/* Center all children horizontally and vertically */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Row flex helpers */
.flex-row    { display: flex; flex-direction: row; }
.flex-col    { display: flex; flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.items-end      { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* Two-column grid (responsive — collapses to 1 col on mobile) */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 640px) {
    .grid-2col {
        grid-template-columns: 1fr;
    }
}

/* Three-column grid */
.grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .grid-3col {
        grid-template-columns: 1fr;
    }
}

/* Visibility helpers */
.hidden   { display: none !important; }
.visible  { visibility: visible; }
.invisible { visibility: hidden; }

/* Overflow helpers */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* Position helpers */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }

/* Full width/height shortcuts */
.w-full   { width: 100%; }
.h-full   { height: 100%; }
.min-h-screen { min-height: 100vh; }


/* ==========================================================================
   8. ANIMATIONS
   @keyframes confirmed across 10+ templates each.
   Animation utility classes pair with the keyframes.
   ========================================================================== */

/* Slide up + fade in — most common entry animation (20+ templates) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Simple opacity fade in (11+ templates) */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Slide in from top (dropdowns, toasts, banners) */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulsing glow — box-shadow variant (buttons, active states — 43+ templates) */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(124, 58, 237, 0.30);
    }
    50% {
        box-shadow: 0 0 40px rgba(124, 58, 237, 0.65);
    }
}

/* Generic opacity + scale pulse (status dots, live badges — 43+ templates) */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.55;
        transform: scale(1.05);
    }
}

/* Ring-expand pulse — record buttons and audio orbs */
@keyframes pulseRing {
    0%  { box-shadow: 0 0 0 0    rgba(124, 58, 237, 0.40); }
    70% { box-shadow: 0 0 0 15px rgba(124, 58, 237, 0.00); }
    100%{ box-shadow: 0 0 0 0    rgba(124, 58, 237, 0.00); }
}

/* Pop-in scale entry (modals, cards, tooltips) */
@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Horizontal shimmer sweep (premium badges, loading skeletons) */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* Continuous rotation (spinners) */
@keyframes spin {
    from { transform: rotate(0deg);   }
    to   { transform: rotate(360deg); }
}

/* Gentle scale breathe (mic orb, idle record button) */
@keyframes breathe {
    0%, 100% { transform: scale(0.96); opacity: 0.70; }
    50%       { transform: scale(1.02); opacity: 1.00; }
}

/* Ambient float (background orbs, decorative blobs) */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-12px); }
}

/* Animation utility classes */
.fade-in-up  { animation: fadeInUp   0.6s var(--ease-out, cubic-bezier(0.4, 0, 0.2, 1)) both; }
.fade-in     { animation: fadeIn     0.5s var(--ease-out, cubic-bezier(0.4, 0, 0.2, 1)) both; }
.slide-down  { animation: slideDown  0.35s var(--ease-out, cubic-bezier(0.4, 0, 0.2, 1)) both; }
.pop-in      { animation: popIn      0.4s var(--ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1)) both; }
.spin        { animation: spin       1s linear infinite; }
.breathe     { animation: breathe    3s ease-in-out infinite; }
.pulse-glow  { animation: pulseGlow  2s ease-in-out infinite; }
.float       { animation: float      4s ease-in-out infinite; }

/* Shimmer overlay (apply on element with gradient background) */
.shimmer-anim {
    background-size: 200% auto;
    animation: shimmer 2.5s linear infinite;
}

/* Animation delay helpers */
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }
.anim-delay-5 { animation-delay: 0.5s; }

/* Reduced motion — consolidated into nano-responsive.css */
