/* Custom styles for KitControl application */

/* Ensure proper theme switching support */
:root {
    color-scheme: dark light;
}

[data-theme="dark"] {
    color-scheme: dark;
}

/* Custom layout styles */
@layer base {
    *,:after,:before,::backdrop {
        box-sizing: border-box;
        border: 0 solid;
        margin: 0;
        padding: 0
    }

    ::file-selector-button {
        box-sizing: border-box;
        border: 0 solid;
        margin: 0;
        padding: 0
    }

    html {
        -webkit-text-size-adjust:100%;
        -moz-tab-size: 4;
        tab-size: 4;
        line-height: 1.5;
        font-family: var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");
        font-feature-settings: var(--default-font-feature-settings,normal);
        font-variation-settings: var(--default-font-variation-settings,normal);
        -webkit-tap-highlight-color: transparent
    }
    
    body { 
        display: flex; 
        transition: background-color 0.3s ease, color 0.3s ease;
    }
    footer {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        width: 100%;
    } 
    .logo-txt {
        font-family: 'Bruno Ace SC', sans-serif;
        font-size: 1.5em;
    }
    .sidebar { 
        font-family: var(--default-font-family);
        width: 250px; 
        height: 100vh; 
        padding: 20px; 
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        background-color: hsl(var(--b1));
        color: hsl(var(--bc));
        border-right: 1px solid hsl(var(--b2));
        transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    }
    
    .content { 
        flex-grow: 1; 
        padding: 20px; 
        overflow-y: auto; 
        height: 100vh;
        background-color: hsl(var(--b2));
        color: hsl(var(--bc));
        transition: background-color 0.3s ease, color 0.3s ease;
    }
    
    h1, h2 {           
        font-size: larger;
        font-weight: bold;
        font-family: var(--font-sans);
        color: hsl(var(--bc));
    }
    
    /* Flash messages with theme-aware colors */
    .flash-messages { 
        list-style: none; 
        padding: 0; 
        margin-bottom: 1em; 
    }
    
    .flash-messages li { 
        padding: 0.75em; 
        margin-bottom: 0.5em; 
        border-radius: 0.25em; 
        transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    }
    
    .flash-messages .success { 
        background-color: hsl(var(--su) / 0.1); 
        color: hsl(var(--suc)); 
        border: 1px solid hsl(var(--su) / 0.3); 
    }
    
    .flash-messages .danger { 
        background-color: hsl(var(--er) / 0.1); 
        color: hsl(var(--erc)); 
        border: 1px solid hsl(var(--er) / 0.3); 
    }
    
    .flash-messages .info { 
        background-color: hsl(var(--in) / 0.1); 
        color: hsl(var(--inc)); 
        border: 1px solid hsl(var(--in) / 0.3); 
    }
}

/* Theme toggle styling */
.theme-controller {
    transition: all 0.3s ease;
}

/* Card and component theme support */
.card {
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* Button theme transitions */
.btn {
    transition: all 0.3s ease;
}

/* Input and form element transitions */
.input, .textarea, .select {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Table theme support */
.table {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navbar theme support */
.navbar {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Modal theme support */
.modal {
    transition: background-color 0.3s ease;
}

/* Drawer theme support */
.drawer-side {
    transition: background-color 0.3s ease;
}

/* Equipment Image Styles */
.equipment-image {
    width: auto;
    height: auto;
    display: none;
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.equipment-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.equipment-image.visible {
    display: block;
}

/* Logo Image Styles */
.client-logo {
    width: 150px;
    height: auto;
    max-height: 66px;
    margin: 10px 0 20px 10px;
    object-fit: contain;
}

/* Enhanced Flexible Equipment Viewer Styles */
.data-fresh {
    color: #22c55e !important; /* green for fresh data */
}

.data-stale {
    color: #f59e0b !important; /* amber for stale data */
    opacity: 0.8;
}

.data-value.data-stale {
    opacity: 0.7;
    font-style: italic;
}

.data-timestamp.data-fresh::before {
    content: "🟢 ";
    font-size: 0.8em;
}

.data-timestamp.data-stale::before {
    content: "🟡 ";
    font-size: 0.8em;
}

.alarm-timestamp.data-fresh::before {
    content: "🟢 ";
    font-size: 0.8em;
}

.alarm-timestamp.data-stale::before {
    content: "🟡 ";
    font-size: 0.8em;
}

/* Equipment health status indicator */
.equipment-health-indicator {
    padding: 0.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.equipment-health-indicator.health-good {
    background-color: rgba(34, 197, 94, 0.1);
    border-left-color: #22c55e;
    color: #166534;
}

.equipment-health-indicator.health-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
    color: #92400e;
}

.equipment-health-indicator.health-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-left-color: #ef4444;
    color: #991b1b;
}

/* Dark theme support */
[data-theme="dark"] .equipment-health-indicator.health-good {
    color: #bbf7d0;
}

[data-theme="dark"] .equipment-health-indicator.health-warning {
    color: #fef3c7;
}

[data-theme="dark"] .equipment-health-indicator.health-error {
    color: #fecaca;
}