/* ================================================
   INLAND POS - COMPREHENSIVE THEME SYSTEM
   Dynamic color system that works throughout the entire application
   ================================================ */

:root {
    /* Theme Colors - These are overridden by inline styles from the ViewComposer */
    --theme-primary: #667eea;
    --theme-accent: #764ba2;
    --theme-text: #1a202c;
    --theme-muted: #718096;

    /* Derived colors for UI consistency */
    --theme-primary-light: rgba(102, 126, 234, 0.1);
    --theme-primary-lighter: rgba(102, 126, 234, 0.05);
    --theme-accent-light: rgba(118, 75, 162, 0.1);
    
    /* System colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Neutral colors */
    --white: #ffffff;
    --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;
}

/* ================================================
   BUTTONS - Theme Integration
   ================================================ */

.btn-primary {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--theme-accent);
    border-color: var(--theme-accent);
    color: white;
}

.btn-primary:active, .btn-primary.active {
    background-color: var(--theme-accent);
    border-color: var(--theme-accent);
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.25rem var(--theme-primary-light);
}

.btn-outline-primary {
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.btn-outline-primary:hover {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
}

/* ================================================
   LINKS & TEXT
   ================================================ */

a {
    color: var(--theme-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--theme-accent);
    text-decoration: underline;
}

.link-primary {
    color: var(--theme-primary) !important;
}

.link-primary:hover {
    color: var(--theme-accent) !important;
}

.text-primary {
    color: var(--theme-primary) !important;
}

.text-accent {
    color: var(--theme-accent) !important;
}

/* ================================================
   FORM ELEMENTS
   ================================================ */

.form-control:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 0.2rem var(--theme-primary-light);
}

.form-check-input:checked {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.form-check-input:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 0.25rem var(--theme-primary-light);
}

.form-select:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 0.25rem var(--theme-primary-light);
}

/* ================================================
   NAVIGATION & HEADER
   ================================================ */

.navbar-brand {
    color: var(--theme-text) !important;
    font-weight: 700;
}

.navbar {
    background-color: white;
    border-bottom: 1px solid var(--gray-200);
}

/* Sidebar Theme */
.app-sidebar {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%);
    color: white;
}

.app-sidebar-header {
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-sidebar-menu .menu-item a:hover,
.app-sidebar-menu .menu-item a.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left: 3px solid white;
}

.app-sidebar-menu .menu-item a {
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.app-sidebar-menu .menu-item a.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
}

/* ================================================
   CARDS & PANELS
   ================================================ */

.card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.card-header h5 {
    color: var(--theme-text);
    margin: 0;
}

.card-title {
    color: var(--theme-primary);
    font-weight: 700;
}

/* ================================================
   BADGES
   ================================================ */

.badge-primary {
    background-color: var(--theme-primary);
}

.badge-accent {
    background-color: var(--theme-accent);
    color: white;
}

/* ================================================
   ALERTS
   ================================================ */

.alert-primary {
    background-color: var(--theme-primary-lighter);
    border-color: var(--theme-primary);
    color: var(--theme-text);
}

.alert-primary .alert-link {
    color: var(--theme-primary);
    font-weight: 600;
}

/* ================================================
   TABLES
   ================================================ */

.table thead th {
    background-color: var(--gray-50);
    color: var(--theme-text);
    font-weight: 600;
    border-bottom: 2px solid var(--gray-200);
}

.table tbody tr:hover {
    background-color: var(--theme-primary-lighter);
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--gray-50);
}

/* ================================================
   MODALS
   ================================================ */

.modal-header {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%);
    color: white;
    border: none;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-title {
    font-weight: 700;
}

/* ================================================
   PAGINATION
   ================================================ */

.pagination .page-link {
    color: var(--theme-primary);
    border-color: var(--gray-200);
}

.pagination .page-link:hover {
    background-color: var(--theme-primary-light);
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}

.pagination .page-item.active .page-link {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

/* ================================================
   DROPDOWNS
   ================================================ */

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--theme-primary-light);
    color: var(--theme-primary);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--theme-primary);
    color: white;
}

/* ================================================
   PROGRESS BARS
   ================================================ */

.progress-bar {
    background-color: var(--theme-primary);
}

/* ================================================
   SPINNERS & LOADERS
   ================================================ */

.spinner-border {
    color: var(--theme-primary);
}

.spinner-grow {
    background-color: var(--theme-primary);
}

/* ================================================
   NAVIGATION TABS
   ================================================ */

.nav-tabs .nav-link {
    color: var(--theme-text);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: var(--theme-primary);
    color: var(--theme-primary);
}

.nav-tabs .nav-link.active {
    background-color: transparent;
    border-bottom-color: var(--theme-primary);
    color: var(--theme-primary);
    font-weight: 600;
}

/* ================================================
   BREADCRUMBS
   ================================================ */

.breadcrumb .breadcrumb-item.active {
    color: var(--theme-text);
}

.breadcrumb a {
    color: var(--theme-primary);
}

/* ================================================
   SPECIAL DASHBOARD ELEMENTS
   ================================================ */

.stat-card {
    border-left: 4px solid var(--theme-primary);
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.stat-card .stat-label {
    color: var(--theme-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-card .stat-value {
    color: var(--theme-primary);
    font-size: 1.875rem;
    font-weight: 700;
}

.stat-card .stat-change {
    color: var(--success);
}

/* ================================================
   REGISTER/POS ELEMENTS
   ================================================ */

.register-container {
    background: linear-gradient(135deg, var(--theme-primary-lighter) 0%, var(--theme-accent-light) 100%);
}

.register-header {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%);
    color: white;
}

.pos-button {
    background-color: var(--theme-primary);
    color: white;
    border: none;
    transition: all 0.2s ease;
}

.pos-button:hover {
    background-color: var(--theme-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pos-button.success {
    background-color: var(--success);
}

.pos-button.danger {
    background-color: var(--danger);
}

/* ================================================
   INPUT GROUPS
   ================================================ */

.input-group-text {
    background-color: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--theme-text);
}

.input-group .form-control:focus ~ .input-group-text {
    border-color: var(--theme-primary);
}

/* ================================================
   LABELS & HEADINGS
   ================================================ */

h1, h2, h3, h4, h5, h6 {
    color: var(--theme-text);
}

.label-primary {
    background-color: var(--theme-primary);
}

/* ================================================
   TOOLTIPS & POPOVERS
   ================================================ */

.tooltip-inner {
    background-color: var(--theme-primary);
}

.popover-header {
    background-color: var(--theme-primary);
    color: white;
}

/* ================================================
   CUSTOM SCROLLBAR
   ================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--theme-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--theme-accent);
}

/* ================================================
   FOCUS STATES
   ================================================ */

*:focus-visible {
    outline: 2px solid var(--theme-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline-color: var(--theme-primary);
}

/* ================================================
   UTILITY CLASSES
   ================================================ */

.bg-primary-light {
    background-color: var(--theme-primary-light);
}

.border-primary {
    border-color: var(--theme-primary) !important;
}

.text-theme-primary {
    color: var(--theme-primary);
}

.text-theme-accent {
    color: var(--theme-accent);
}

.text-theme-muted {
    color: var(--theme-muted);
}

.bg-theme-light {
    background-color: var(--theme-primary-light);
}

.shadow-theme {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

/* ================================================
   RESPONSIVE ADJUSTMENTS
   ================================================ */

@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        width: 250px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .app-sidebar.open {
        left: 0;
    }
}

/* ================================================
   ANIMATION & TRANSITIONS
   ================================================ */

.btn, a, .form-control, .form-check-input {
    transition: all 0.2s ease;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ================================================
   PRINT STYLES
   ================================================ */

@media print {
    .btn, .navbar, .app-sidebar {
        display: none;
    }

    body {
        background: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
