/**
 * File: /assets/css/fusion-core.css
 * Description: The Volumetric UI Toolkit. 
 * Connects the Skeuomorphic variables from style.css to reusable structural classes.
 * Focus: GPU Acceleration, Deep Shadows, and Physical Textures.
 */

/* ========================================================
   1. GLASSMORPHISM 2.0 (The Frosted System)
   ======================================================== */
.glass-panel {
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur-desktop);
    -webkit-backdrop-filter: var(--glass-blur-desktop);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    position: relative;
    /* Required to contain the noise pseudo-element */
    z-index: 1; 
}

/* The Physical Noise Grain */
.glass-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: var(--noise-pattern);
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
}

.glass-panel-dark {
    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-blur-desktop);
    -webkit-backdrop-filter: var(--glass-blur-desktop);
    border: var(--glass-border-dark);
    color: #ffffff;
}

/* ========================================================
   2. VOLUMETRIC CARDS (Deep Clay)
   ======================================================== */
.clay-card {
    background: var(--bg-base);
    border-radius: var(--radius-lg);
    box-shadow: var(--skeuo-shadow-rest);
    position: relative;
    transition: transform 0.4s var(--spring-bounce), box-shadow 0.4s ease;
}

.clay-card-hoverable:hover {
    transform: translateY(-6px);
    box-shadow: var(--skeuo-shadow-hover);
}

/* ========================================================
   3. MECHANICAL BUTTONS (Haptic UI)
   ======================================================== */
/* Base button reset applied globally */
.btn-clay-base {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s var(--snap-fast);
    text-align: center;
    user-select: none;
}

/* Primary Form/Action Button */
.btn-clay-primary {
    @extend .btn-clay-base; /* Conceptual, realized via standard CSS below */
    padding: 16px 32px;
    font-size: 1rem;
    color: var(--text-main);
    background: var(--bg-base);
    box-shadow: var(--skeuo-shadow-rest);
}

.btn-clay-primary:hover {
    box-shadow: var(--skeuo-shadow-hover);
    color: var(--accent-red);
}

.btn-clay-primary:active, 
.btn-clay-press {
    box-shadow: var(--skeuo-inset-press) !important;
    transform: scale(0.96) translateY(2px);
}

/* Small Utility Button (Used in Header & CRM Dashboard) */
.btn-clay-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    background: var(--bg-base);
    border-radius: var(--radius-md);
    box-shadow: 
        4px 4px 8px var(--shadow-source),
        -4px -4px 8px var(--light-source);
    transition: all 0.2s var(--snap-fast);
    cursor: pointer;
}

.btn-clay-sm:hover {
    color: var(--accent-red);
    box-shadow: 
        6px 6px 12px var(--shadow-source),
        -6px -6px 12px var(--light-source);
}

.btn-clay-sm:active {
    box-shadow: var(--skeuo-inset-press);
    transform: scale(0.96);
}

/* High-Contrast Accent Button (Track Order, Save, etc) */
.btn-clay-accent {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--accent-red);
    border-radius: var(--radius-md);
    /* Unique shadow for colored buttons to maintain depth */
    box-shadow: 
        6px 6px 14px rgba(139, 0, 0, 0.25),
        -4px -4px 10px rgba(255, 255, 255, 0.7),
        inset 1px 1px 2px rgba(255, 255, 255, 0.3);
    transition: all 0.2s var(--snap-fast);
    cursor: pointer;
}

.btn-clay-accent:active {
    box-shadow: inset 4px 4px 10px rgba(0,0,0,0.3);
    transform: scale(0.96);
}

/* ========================================================
   4. DATA STATUS PILLS (CRM & Logistics)
   ======================================================== */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius-pill);
    /* Inset style to look embedded in the card */
    box-shadow: var(--skeuo-inset-press);
}

.status-grey   { background: #e2e8f0; color: #475569; }
.status-yellow { background: #fef08a; color: #854d0e; }
.status-blue   { background: #bae6fd; color: #0369a1; }
.status-green  { background: #bbf7d0; color: #15803d; }
.status-red    { background: #fecaca; color: #b91c1c; }

/* ========================================================
   5. STRUCTURAL UTILITIES (Zero-Bloat Layouts)
   ======================================================== */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.text-muted      { color: var(--text-muted); }
.text-accent-red { color: var(--accent-red); }
.text-success    { color: #15803d; }
.text-warning    { color: #b45309; }

.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: -0.5px;
}

.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }

.mb-xs { margin-bottom: 0.5rem; }
.mb-sm { margin-bottom: 1rem; }
.mb-md { margin-bottom: 2rem; }
.mb-lg { margin-bottom: 4rem; }

.mt-xs { margin-top: 0.5rem; }
.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 2rem; }

/* Mobile Blur Overrides */
@media (max-width: 768px) {
    .glass-panel, .glass-panel-dark {
        backdrop-filter: var(--glass-blur-mobile);
        -webkit-backdrop-filter: var(--glass-blur-mobile);
    }
}