/*
Theme Name: PineX Front
Author: Babar Dogar
Author URI: https://pinex.co.uk
Version: 1.0
*/

:root {
    /* Core Identity Variables */
    --px-primary: #0066ff;
    --px-primary-hover: #0052cc;
    --px-primary-light: rgba(0, 102, 255, 0.1);
    
    /* Background Matrices */
    --px-bg-base: #f8fafc;
    --px-bg-surface: #ffffff;
    --px-bg-surface-hover: #f1f5f9;
    --px-bg-surface-dark: #0f172a;
    
    /* Typography Colors */
    --px-text-heading: #0f172a;
    --px-text-base: #334155;
    --px-text-muted: #64748b;
    --px-text-inverse: #ffffff;
    
    /* Borders & UI Lines */
    --px-border: #e2e8f0;
    --px-border-focus: #cbd5e1;
    
    /* State & Status Colors */
    --px-status-success: #10b981;
    --px-status-success-bg: rgba(16, 185, 129, 0.1);
    --px-status-warning: #f59e0b;
    --px-status-danger: #ef4444;
    --px-status-danger-bg: rgba(239, 68, 68, 0.1);

    /* Spatial System */
    --px-space-2: 8px;
    --px-space-3: 12px;
    --px-space-4: 16px;
    --px-space-6: 24px;
    --px-space-8: 32px;
    --px-space-10: 40px;
    --px-space-12: 48px;
    --px-space-16: 64px;
    --px-space-24: 96px;

    /* Interface Mechanics */
    --px-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --px-radius-md: 8px;
    --px-radius-lg: 16px;
    --px-radius-full: 9999px;
    --px-transition: all 0.2s ease-in-out;
    
    /* Depth Rendering */
    --px-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --px-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --px-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* =========================================
   BASE RESET & TYPOGRAPHY
   ========================================= */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: 'Inter', sans-serif; 
    color: var(--px-text-base); 
    background-color: var(--px-bg-base); 
    line-height: 1.5; 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   SPA STATE CONTROLLERS
   ========================================= */
/* This specific class is critical for the Portal Vanilla JS router to function */
.px-hidden { 
    display: none !important; 
}

/* =========================================
   FLUID FULL-WIDTH LAYOUT SYSTEM 
   ========================================= */
.px-container {
    width: 100%;
    max-width: 100% !important;
    padding-left: 4vw !important;
    padding-right: 4vw !important;
    margin: 0 auto;
}

/* Master Grid Matrix */
.px-grid { 
    display: grid; 
    gap: var(--px-space-6); 
    width: 100%; 
}

.px-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.px-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.px-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Responsive Grid Down-scaling */
@media screen and (max-width: 1024px) {
    .px-grid-cols-3, 
    .px-grid-cols-4 { 
        grid-template-columns: repeat(2, 1fr); 
    }
}

@media screen and (max-width: 768px) {
    .px-grid-cols-2, 
    .px-grid-cols-3, 
    .px-grid-cols-4 { 
        grid-template-columns: 1fr; 
    }
}

/* =========================================
   UI COMPONENT LIBRARY
   ========================================= */

/* Elevation Cards */
.px-card {
    background-color: var(--px-bg-surface);
    border: 1px solid var(--px-border);
    border-radius: var(--px-radius-lg);
    box-shadow: var(--px-shadow-sm);
    transition: var(--px-transition);
}

/* Master Button Architecture */
.px-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: var(--px-radius-md);
    transition: var(--px-transition);
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
    text-align: center;
}

.px-btn:disabled { 
    opacity: 0.7; 
    cursor: not-allowed; 
}

.px-btn-primary {
    background-color: var(--px-primary);
    color: var(--px-text-inverse);
}

.px-btn-primary:hover:not(:disabled) {
    background-color: var(--px-primary-hover);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.px-btn-outline {
    background-color: transparent;
    color: var(--px-text-heading);
    border-color: var(--px-border);
}

.px-btn-outline:hover:not(:disabled) {
    border-color: var(--px-primary);
    color: var(--px-primary);
}

/* Form Inputs & Textareas */
.px-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--px-border);
    border-radius: var(--px-radius-md);
    font-family: inherit;
    font-size: 14px;
    color: var(--px-text-heading);
    background-color: var(--px-bg-surface);
    transition: var(--px-transition);
}

.px-input:focus {
    outline: none;
    border-color: var(--px-primary);
    box-shadow: 0 0 0 3px var(--px-primary-light);
}

/* Status Badges */
.px-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--px-radius-full);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.px-badge-success { 
    background-color: var(--px-status-success-bg); 
    color: var(--px-status-success); 
    border: 1px solid var(--px-status-success); 
}

.px-badge-warning { 
    background-color: rgba(245, 158, 11, 0.1); 
    color: var(--px-status-warning); 
    border: 1px solid var(--px-status-warning); 
}

.px-badge-danger { 
    background-color: var(--px-status-danger-bg); 
    color: var(--px-status-danger); 
    border: 1px solid var(--px-status-danger); 
}

/* =========================================
   ASYNC LOADER ANIMATION
   ========================================= */
.px-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--px-primary-light);
    border-top-color: var(--px-primary);
    border-radius: 50%;
    animation: px-spin 1s linear infinite;
}

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