/**
 * StallWise VetPro - Main CSS Variables & Global Styles
 * Central CSS Architecture
 *
 * Purpose: Centralized CSS custom properties for consistent theming
 * Location: /public/css/main.css
 *
 * @package StallWise VetPro
 * @version 2.0.0 - Professional CSS Architecture
 * @date October 27, 2025
 * @author StallWise VetPro Development Team
 */

/* ==========================================================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ========================================================================== */

:root {
    /* ==========================================================================
       BRAND COLORS - VetPro Primary Palette
       ========================================================================== */

    /* Primary Colors */
    --vetpro-primary: #2c5aa0;
    --vetpro-primary-light: #4a7bc8;
    --vetpro-primary-dark: #1e3f71;
    --vetpro-primary-rgb: 44, 90, 160;

    /* Secondary Colors */
    --vetpro-secondary: #34495e;
    --vetpro-secondary-light: #4e6885;
    --vetpro-secondary-dark: #1e2a38;
    --vetpro-secondary-rgb: 52, 73, 94;

    /* Semantic Colors */
    --vetpro-success: #27ae60;
    --vetpro-success-light: #4abe7d;
    --vetpro-success-dark: #1e8449;

    --vetpro-warning: #f39c12;
    --vetpro-warning-light: #f5b041;
    --vetpro-warning-dark: #d68910;

    --vetpro-danger: #e74c3c;
    --vetpro-danger-light: #ec7063;
    --vetpro-danger-dark: #c0392b;

    --vetpro-info: #3498db;
    --vetpro-info-light: #5dade2;
    --vetpro-info-dark: #2874a6;

    /* Neutral Colors */
    --vetpro-light: #ecf0f1;
    --vetpro-dark: #2c3e50;
    --vetpro-white: #ffffff;
    --vetpro-black: #000000;

    /* ==========================================================================
       BOOTSTRAP 5.3 COMPATIBLE COLORS
       ========================================================================== */

    --bs-primary: #0d6efd;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-danger: #dc3545;
    --bs-warning: #ffc107;
    --bs-info: #0dcaf0;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;

    /* ==========================================================================
       GRAYSCALE PALETTE
       ========================================================================== */

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* ==========================================================================
       TYPOGRAPHY
       ========================================================================== */

    /* Font Families */
    --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

    /* Font Sizes */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    --font-size-4xl: 2.25rem;     /* 36px */
    --font-size-5xl: 3rem;        /* 48px */

    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    --line-height-loose: 2;

    /* ==========================================================================
       SPACING SCALE (Based on 0.25rem = 4px)
       ========================================================================== */

    --spacing-0: 0;
    --spacing-1: 0.25rem;   /* 4px */
    --spacing-2: 0.5rem;    /* 8px */
    --spacing-3: 0.75rem;   /* 12px */
    --spacing-4: 1rem;      /* 16px */
    --spacing-5: 1.25rem;   /* 20px */
    --spacing-6: 1.5rem;    /* 24px */
    --spacing-8: 2rem;      /* 32px */
    --spacing-10: 2.5rem;   /* 40px */
    --spacing-12: 3rem;     /* 48px */
    --spacing-16: 4rem;     /* 64px */
    --spacing-20: 5rem;     /* 80px */
    --spacing-24: 6rem;     /* 96px */

    /* ==========================================================================
       BORDER RADIUS
       ========================================================================== */

    --radius-none: 0;
    --radius-sm: 0.125rem;   /* 2px */
    --radius-base: 0.25rem;  /* 4px */
    --radius-md: 0.375rem;   /* 6px */
    --radius-lg: 0.5rem;     /* 8px */
    --radius-xl: 0.75rem;    /* 12px */
    --radius-2xl: 1rem;      /* 16px */
    --radius-3xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;   /* Circular */

    /* ==========================================================================
       SHADOWS
       ========================================================================== */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --shadow-none: none;

    /* ==========================================================================
       BREAKPOINTS (for reference in JS)
       ========================================================================== */

    --breakpoint-xs: 0;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;

    /* ==========================================================================
       Z-INDEX SCALE
       ========================================================================== */

    --z-index-dropdown: 1000;
    --z-index-sticky: 1020;
    --z-index-fixed: 1030;
    --z-index-modal-backdrop: 1040;
    --z-index-modal: 1050;
    --z-index-popover: 1060;
    --z-index-tooltip: 1070;
    --z-index-toast: 1080;

    /* ==========================================================================
       TRANSITIONS
       ========================================================================== */

    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    --transition-slower: 500ms ease-in-out;

    /* ==========================================================================
       COMPONENT-SPECIFIC VARIABLES
       ========================================================================== */

    /* Cards */
    --card-bg: var(--vetpro-white);
    --card-border-radius: var(--radius-lg);
    --card-shadow: var(--shadow-md);
    --card-padding: var(--spacing-6);

    /* Buttons */
    --button-border-radius: var(--radius-base);
    --button-padding-x: var(--spacing-4);
    --button-padding-y: var(--spacing-2);
    --button-font-weight: var(--font-weight-medium);

    /* Inputs */
    --input-bg: var(--vetpro-white);
    --input-border-color: var(--gray-300);
    --input-border-radius: var(--radius-base);
    --input-padding-x: var(--spacing-3);
    --input-padding-y: var(--spacing-2);
    --input-focus-border-color: var(--vetpro-primary);
    --input-focus-shadow: 0 0 0 3px rgba(var(--vetpro-primary-rgb), 0.1);

    /* Navbar */
    --navbar-height: 64px;
    --navbar-bg: var(--vetpro-white);
    --navbar-shadow: var(--shadow-sm);

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-bg: var(--vetpro-dark);
    --sidebar-color: var(--gray-300);

    /* ==========================================================================
       DARK MODE SUPPORT (Optional - for future implementation)
       ========================================================================== */

    /* These would be activated via [data-theme="dark"] */
}

/* Dark mode color scheme (commented out for now) */
/*
[data-theme="dark"] {
    --vetpro-light: #2c3e50;
    --vetpro-dark: #ecf0f1;
    --gray-50: #111827;
    --gray-100: #1f2937;
    --card-bg: #1f2937;
}
*/

/* ==========================================================================
   GLOBAL UTILITY CLASSES
   ========================================================================== */

/* Container Utilities */
.container-fluid {
    width: 100%;
    padding-right: var(--spacing-4);
    padding-left: var(--spacing-4);
    margin-right: auto;
    margin-left: auto;
}

/* Spacing Utilities (complement Bootstrap) */
.m-auto {
    margin: auto !important;
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

.my-auto {
    margin-top: auto !important;
    margin-bottom: auto !important;
}

/* Text Utilities */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-wrap {
    white-space: normal !important;
}

.text-nowrap {
    white-space: nowrap !important;
}

/* Display Utilities */
.d-contents {
    display: contents !important;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ==========================================================================
   PROFESSIONAL ANIMATIONS
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Animation utility classes */
.animate-fade-in {
    animation: fadeIn var(--transition-base);
}

.animate-slide-up {
    animation: slideUp var(--transition-base);
}

.animate-slide-down {
    animation: slideDown var(--transition-base);
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    :root {
        --vetpro-primary: #000000;
        --vetpro-secondary: #000000;
        --card-shadow: none;
    }

    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a, a:visited {
        text-decoration: underline;
    }

    abbr[title]::after {
        content: " (" attr(title) ")";
    }

    pre, blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }

    tr, img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }

    h2, h3 {
        page-break-after: avoid;
    }
}

/* ==========================================================================
   NAVIGATION - PORTAL SWITCHER
   ========================================================================== */

.nav-section {
    padding: 1rem 1.5rem 0.5rem;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 1rem;
}

.nav-section:first-child {
    margin-top: 0;
}

.nav-item {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: var(--bg-hover);
    border-left-color: var(--vetpro-primary);
}

.nav-link.active {
    background-color: var(--vetpro-primary-alpha-10);
    border-left-color: var(--vetpro-primary);
    color: var(--vetpro-primary);
    font-weight: var(--font-weight-medium);
}

.nav-link i {
    margin-right: 0.75rem;
    font-size: 1.25rem;
    min-width: 1.5rem;
}

.nav-badge {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-muted);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: var(--border-radius-sm);
}

.nav-badge.badge-primary {
    background-color: var(--vetpro-primary);
    color: white;
}

.nav-badge.badge-success {
    background-color: var(--vetpro-success);
    color: white;
}

.nav-badge.badge-info {
    background-color: var(--vetpro-info);
    color: white;
}

.nav-badge.badge-warning {
    background-color: var(--vetpro-warning);
    color: white;
}

/* Portal-specific icon colors */
.nav-link[href*="/admin"] i {
    color: var(--vetpro-primary);
}

.nav-link[href*="/vet"] i {
    color: var(--vetpro-success);
}

.nav-link[href*="/corporate"] i {
    color: var(--vetpro-info);
}

.nav-link[href*="/client"] i {
    color: var(--vetpro-warning);
}

/* Icon class mappings (Bootstrap Icons compatibility) */
.icon-shield::before { content: "\F552"; font-family: 'bootstrap-icons'; }
.icon-heart-pulse::before { content: "\F42C"; font-family: 'bootstrap-icons'; }
.icon-briefcase::before { content: "\F1F9"; font-family: 'bootstrap-icons'; }
.icon-user::before { content: "\F5F7"; font-family: 'bootstrap-icons'; }
.icon-dashboard::before { content: "\F2B7"; font-family: 'bootstrap-icons'; }
.icon-users::before { content: "\F607"; font-family: 'bootstrap-icons'; }
.icon-calendar::before { content: "\F1E8"; font-family: 'bootstrap-icons'; }
.icon-clipboard::before { content: "\F234"; font-family: 'bootstrap-icons'; }
.icon-prescription::before { content: "\F4E9"; font-family: 'bootstrap-icons'; }
.icon-flask::before { content: "\F373"; font-family: 'bootstrap-icons'; }
.icon-package::before { content: "\F4B1"; font-family: 'bootstrap-icons'; }
.icon-shopping-cart::before { content: "\F530"; font-family: 'bootstrap-icons'; }
.icon-credit-card::before { content: "\F285"; font-family: 'bootstrap-icons'; }
.icon-dollar-sign::before { content: "\F2E2"; font-family: 'bootstrap-icons'; }
.icon-bar-chart::before { content: "\F1C9"; font-family: 'bootstrap-icons'; }
.icon-user-cog::before { content: "\F5F4"; font-family: 'bootstrap-icons'; }
.icon-building::before { content: "\F1F7"; font-family: 'bootstrap-icons'; }

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* GPU acceleration for transforms and animations */
.gpu-accelerate {
    transform: translateZ(0);
    will-change: transform;
}

/* Prevent layout shift */
img[width][height] {
    height: auto;
}

/* ==========================================================================
   END OF MAIN.CSS
   ========================================================================== */
