/* Color Themes */
:root {
    /* Dark Mode (Default) */
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-primary: #e0e0e0;
    --accent: #189AD6;
    --secondary: #189AD6;
    --border: #333;
    --input-bg: #333;
}

[data-theme="light"] {
    --bg-color: #f4f4f9;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --accent: #189AD6;
    --secondary: #189AD6;
    --border: #ddd;
    --input-bg: #fff;
}

body { 
    background-color: var(--bg-color); 
    color: var(--text-primary); 
    font-family: sans-serif; 
    padding: 20px; 
    transition: 0.3s;
}

.card { 
    border: 1px solid var(--border); 
    background-color: var(--card-bg); 
    padding: 20px; 
    margin: 20px 0; 
    border-radius: 8px; 
}

h1, h2, h3 { color: var(--accent); }
span { font-weight: bold; color: var(--secondary); }

/* Buttons & Inputs */
input, select, textarea { 
    padding: 8px; 
    border-radius: 4px; 
    border: 1px solid var(--border); 
    background: var(--input-bg); 
    color: var(--text-primary); 
    margin-bottom: 10px; 
}

button, .btn-nav {
    /* 1. Force identical typography */
    font-family: inherit; 
    font-size: 1rem; 
    line-height: 1.5;
    text-align: center;

    /* 2. Ensure padding and borders calculate the same way */
    box-sizing: border-box;
    vertical-align: middle;
    
    /* 3. Your existing styling */
    display: inline-block;
    padding: 10px 20px;
    border: none; /* Removes default button bevel */
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    background: var(--accent);
    color: var(--bg-color);
    text-decoration: none;
    transition: background 0.3s, transform 0.1s;
}


/* Device List Specifics */
.device-item { padding: 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.device-item:hover, .selected { background-color: rgba(187, 134, 252, 0.1); border-left: 4px solid var(--accent); }

.status-dot { height: 10px; width: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.online { background-color: var(--secondary); box-shadow: 0 0 8px var(--secondary); }
.offline { background-color: #777; }

/* Theme Toggle Button */
#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--secondary);
    color: var(--bg-color);
    border: 1px solid var(--border);
    padding: 5px 10px;
}

/* Container for the whole card */
.product-card {
    display: flex;
    flex-direction: column; /* Stack header over body */
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: var(--card-bg);
    overflow: hidden;
}

/* Make inputs inside the form card blend in */
.product-card input[type="text"], 
.product-card textarea {
    background-color: rgba(0,0,0,0.2); /* Slightly darker than card */
    border: 1px solid var(--border);
    color: var(--text-primary);
}

/* Highlight the active field */
.product-card input:focus, 
.product-card textarea:focus {
    border-color: var(--accent);
    outline: none;
}

/* The top border bar for SKU : RFID */
.product-header {
    background-color: var(--border);
    padding: 8px 15px;
    font-size: 0.9em;
    font-weight: bold;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
}

/* The main content area of the card */
.product-body {
    display: flex;
    align-items: stretch; /* Makes thumbnail and details same height */
    padding: 10px;
}

/* Left-justified fixed thumbnail */
.thumbnail {
    width: 100px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #2c2c2c;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Middle section for Name/Description */
.product-info {
    flex-grow: 1;
    padding: 0 20px;
}

.product-info h3 { margin: 0 0 5px 0; }
.product-info p { margin: 0; font-size: 0.9em; color: var(--text-primary); opacity: 0.8; }

/* Right section for Edit/Delete buttons */
.product-actions {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    justify-content: center;
    gap: 10px;
    min-width: 80px;
    text-align: right;
    border-left: 1px solid var(--border);
    padding-left: 15px;
}

.file-upload-btn {
    display: inline-block;
    width: 100%;
    margin-top: 8px;
    padding: 5px 8px;
    background-color: var(--secondary);
    color: var(--bg-color);
    font-size: 0.7em;
    font-weight: bold;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
}

.file-upload-btn:hover {
    opacity: 0.9;
}