@tailwind base;
@tailwind components;
@tailwind utilities;

/* Filament base styles are included via TailwindCSS v4 */

/* ==========================================================================
   Liberu Maintenance CMMS - Custom Filament Admin Styles
   ========================================================================== */

/* Root Variables for Consistent Theming */
:root {
    --liberu-primary: #1e40af;
    --liberu-primary-dark: #1e3a8a;
    --liberu-secondary: #059669;
    --liberu-accent: #dc2626;
    --liberu-warning: #d97706;
    --liberu-success: #16a34a;
    --liberu-info: #0284c7;
    --liberu-gray-50: #f9fafb;
    --liberu-gray-100: #f3f4f6;
    --liberu-gray-200: #e5e7eb;
    --liberu-gray-700: #374151;
    --liberu-gray-800: #1f2937;
    --liberu-gray-900: #111827;
}

/* ==========================================================================
   Main Layout & Body
   ========================================================================== */

.fi-body {
    background: linear-gradient(135deg, var(--liberu-gray-50) 0%, #ffffff 100%) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* ==========================================================================
   Sidebar Styling
   ========================================================================== */

.fi-sidebar {
    background: linear-gradient(180deg, var(--liberu-gray-900) 0%, var(--liberu-gray-800) 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1) !important;
}

.fi-sidebar-nav {
    padding: 1rem !important;
}

/* Sidebar Logo Area */
.fi-sidebar-header {
    padding: 1.5rem 1rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    margin-bottom: 1rem !important;
}

.fi-sidebar-header .fi-logo {
    filter: brightness(0) invert(1) !important;
}

/* Navigation Items */
.fi-sidebar-nav-item {
    margin-bottom: 0.25rem !important;
    border-radius: 0.75rem !important;
    transition: all 0.2s ease-in-out !important;
}

.fi-sidebar-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(4px) !important;
}

.fi-sidebar-nav-item.fi-active {
    background: linear-gradient(135deg, var(--liberu-primary) 0%, var(--liberu-primary-dark) 100%) !important;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3) !important;
}

.fi-sidebar-nav-item-label {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500 !important;
}

.fi-sidebar-nav-item.fi-active .fi-sidebar-nav-item-label {
    color: white !important;
    font-weight: 600 !important;
}

.fi-sidebar-nav-item-icon {
    color: rgba(255, 255, 255, 0.7) !important;
}

.fi-sidebar-nav-item.fi-active .fi-sidebar-nav-item-icon {
    color: white !important;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.fi-topbar {
    background: white !important;
    border-bottom: 1px solid var(--liberu-gray-100) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.fi-topbar-item {
    transition: all 0.2s ease-in-out !important;
}

.fi-topbar-item:hover {
    background-color: var(--liberu-gray-50) !important;
    border-radius: 0.5rem !important;
}

/* User Menu */
.fi-user-menu-trigger {
    border-radius: 0.75rem !important;
    transition: all 0.2s ease-in-out !important;
}

.fi-user-menu-trigger:hover {
    background-color: var(--liberu-gray-50) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* ==========================================================================
   Page Content & Cards
   ========================================================================== */

.fi-main {
    padding: 2rem !important;
}

.fi-page {
    max-width: none !important;
}

.fi-page-header {
    margin-bottom: 2rem !important;
}

.fi-page-heading {
    color: var(--liberu-gray-900) !important;
    font-weight: 700 !important;
    font-size: 2rem !important;
    background: linear-gradient(135deg, var(--liberu-primary) 0%, var(--liberu-secondary) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Cards & Panels */
.fi-section,
.fi-card {
    background: white !important;
    border: 1px solid var(--liberu-gray-100) !important;
    border-radius: 1rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.2s ease-in-out !important;
}

.fi-section:hover,
.fi-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    transform: translateY(-2px) !important;
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */

.fi-input,
.fi-select,
.fi-textarea {
    border-radius: 0.75rem !important;
    border: 2px solid var(--liberu-gray-100) !important;
    transition: all 0.2s ease-in-out !important;
}

.fi-input:focus,
.fi-select:focus,
.fi-textarea:focus {
    border-color: var(--liberu-primary) !important;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1) !important;
}

.fi-fo-field-wrp-label {
    font-weight: 600 !important;
    color: var(--liberu-gray-800) !important;
}

/* ==========================================================================
   Buttons & Actions
   ========================================================================== */

.fi-btn {
    border-radius: 0.75rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease-in-out !important;
    text-transform: none !important;
}

.fi-btn-primary {
    background: linear-gradient(135deg, var(--liberu-primary) 0%, var(--liberu-primary-dark) 100%) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3) !important;
}

.fi-btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.4) !important;
}

.fi-btn-secondary {
    background: white !important;
    border: 2px solid var(--liberu-gray-200) !important;
    color: var(--liberu-gray-700) !important;
}

.fi-btn-secondary:hover {
    background: var(--liberu-gray-50) !important;
    border-color: var(--liberu-primary) !important;
    color: var(--liberu-primary) !important;
}

.fi-btn-success {
    background: linear-gradient(135deg, var(--liberu-success) 0%, #15803d 100%) !important;
}

.fi-btn-danger {
    background: linear-gradient(135deg, var(--liberu-accent) 0%, #b91c1c 100%) !important;
}

.fi-btn-warning {
    background: linear-gradient(135deg, var(--liberu-warning) 0%, #c2410c 100%) !important;
}

/* ==========================================================================
   Tables & Data Display
   ========================================================================== */

.fi-ta {
    border-radius: 1rem !important;
    overflow: hidden !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

.fi-ta-header {
    background: linear-gradient(135deg, var(--liberu-gray-50) 0%, white 100%) !important;
    border-bottom: 2px solid var(--liberu-gray-100) !important;
}

.fi-ta-header-cell {
    font-weight: 700 !important;
    color: var(--liberu-gray-800) !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.05em !important;
}

.fi-ta-row:hover {
    background-color: var(--liberu-gray-50) !important;
}

.fi-ta-cell {
    border-bottom: 1px solid var(--liberu-gray-100) !important;
}

/* ==========================================================================
   Badges & Status Indicators
   ========================================================================== */

.fi-badge {
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    padding: 0.375rem 0.75rem !important;
}

.fi-badge-success {
    background: linear-gradient(135deg, var(--liberu-success) 0%, #15803d 100%) !important;
    color: white !important;
}

.fi-badge-warning {
    background: linear-gradient(135deg, var(--liberu-warning) 0%, #c2410c 100%) !important;
    color: white !important;
}

.fi-badge-danger {
    background: linear-gradient(135deg, var(--liberu-accent) 0%, #b91c1c 100%) !important;
    color: white !important;
}

.fi-badge-info {
    background: linear-gradient(135deg, var(--liberu-info) 0%, #0369a1 100%) !important;
    color: white !important;
}

/* ==========================================================================
   Modals & Overlays
   ========================================================================== */

.fi-modal {
    border-radius: 1rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.fi-modal-header {
    border-bottom: 1px solid var(--liberu-gray-100) !important;
    padding: 1.5rem !important;
}

.fi-modal-heading {
    font-weight: 700 !important;
    color: var(--liberu-gray-900) !important;
}

/* ==========================================================================
   Notifications & Alerts
   ========================================================================== */

.fi-no {
    border-radius: 0.75rem !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.fi-no-success {
    background: linear-gradient(135deg, var(--liberu-success) 0%, #15803d 100%) !important;
    border: none !important;
}

.fi-no-warning {
    background: linear-gradient(135deg, var(--liberu-warning) 0%, #c2410c 100%) !important;
    border: none !important;
}

.fi-no-danger {
    background: linear-gradient(135deg, var(--liberu-accent) 0%, #b91c1c 100%) !important;
    border: none !important;
}

/* ==========================================================================
   Dashboard Widgets
   ========================================================================== */

.fi-wi {
    border-radius: 1rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease-in-out !important;
}

.fi-wi:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.fi-wi-header {
    background: linear-gradient(135deg, var(--liberu-primary) 0%, var(--liberu-primary-dark) 100%) !important;
    color: white !important;
    border-radius: 1rem 1rem 0 0 !important;
}

/* ==========================================================================
   Custom Maintenance CMMS Specific Styles
   ========================================================================== */

/* Equipment Status Indicators */
.equipment-status-operational {
    background: linear-gradient(135deg, var(--liberu-success) 0%, #15803d 100%) !important;
    color: white !important;
}

.equipment-status-maintenance {
    background: linear-gradient(135deg, var(--liberu-warning) 0%, #c2410c 100%) !important;
    color: white !important;
}

.equipment-status-broken {
    background: linear-gradient(135deg, var(--liberu-accent) 0%, #b91c1c 100%) !important;
    color: white !important;
}

/* Work Order Priority Indicators */
.priority-critical {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%) !important;
    color: white !important;
    animation: pulse 2s infinite !important;
}

.priority-high {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important;
    color: white !important;
}

.priority-medium {
    background: linear-gradient(135deg, #d97706 0%, #a16207 100%) !important;
    color: white !important;
}

.priority-low {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    color: white !important;
}

/* Maintenance Schedule Status */
.schedule-overdue {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%) !important;
    color: white !important;
    animation: pulse 2s infinite !important;
}

.schedule-due-soon {
    background: linear-gradient(135deg, #d97706 0%, #a16207 100%) !important;
    color: white !important;
}

.schedule-completed {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    color: white !important;
}

/* ==========================================================================
   Animations & Transitions
   ========================================================================== */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out !important;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .fi-main {
        padding: 1rem !important;
    }

    .fi-page-heading {
        font-size: 1.5rem !important;
    }

    .fi-sidebar {
        transform: translateX(-100%) !important;
    }

    .fi-sidebar.fi-sidebar-open {
        transform: translateX(0) !important;
    }
}

/* ==========================================================================
   Dark Mode Support (Optional)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .fi-body {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
    }

    .fi-section,
    .fi-card {
        background: #374151 !important;
        border-color: #4b5563 !important;
    }

    .fi-topbar {
        background: #374151 !important;
        border-color: #4b5563 !important;
    }
}