/* AEESENSE Admin - Minimalistic Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    font-size: 14px;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.4;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Collapsible Menu Styles */
.menu-section {
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 20px;
}

.menu-header {
    padding: 12px 16px;
    background-color: #d1d3d4;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    user-select: none;
}

.menu-header:hover {
    background-color: #c6c8ca;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.2s;
}

.menu-content {
    padding: 16px;
    display: block;
}

.menu-content.collapsed {
    display: none;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #495057;
}

.form-group input {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    font-size: 14px;
    background-color: #fff;
}

.form-group input:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.form-group input:focus:not(:disabled) {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

button {
    padding: 8px 16px;
    border: 1px solid #6c757d;
    border-radius: 3px;
    background-color: #f8f9fa;
    color: #495057;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover:not(:disabled) {
    background-color: #e9ecef;
    border-color: #5a6268;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:active:not(:disabled) {
    background-color: #dee2e6;
}

/* Table Styles */
.table-section {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 16px;
}

.table-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #495057;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.table-header h3 {
    margin-bottom: 0;
}

#btn-toggle-archive {
    background-color: #6c757d;
    color: #fff;
    border-color: #6c757d;
    font-size: 12px;
    padding: 6px 12px;
}

#btn-toggle-archive:hover:not(:disabled) {
    background-color: #5a6268;
    border-color: #545b62;
}

.table-container {
    height: 320px;
    min-height: 200px;
    max-height: 800px;
    min-width: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    resize: both;
    position: relative;
}

.table-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: linear-gradient(-45deg, transparent 0%, transparent 30%, #ccc 30%, #ccc 40%, transparent 40%, transparent 60%, #ccc 60%, #ccc 70%, transparent 70%);
    cursor: nw-resize;
    pointer-events: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

th {
    background-color: #f8f9fa;
    padding: 8px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

th:hover {
    background-color: #e9ecef;
}

.sort-icon {
    font-size: 10px;
    margin-left: 4px;
    color: #6c757d;
}

td {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
    font-size: 12px;
}

tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

tbody tr.selected {
    background-color: #e3f2fd;
}

tbody tr:nth-child(even) {
    background-color: #fafafa;
}

tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

/* Status Messages */
.status-message {
    margin-top: 16px;
    padding: 8px 12px;
    border-radius: 3px;
    font-size: 12px;
    display: block;
    min-height: 20px;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    .table-container {
        height: 250px;
        resize: vertical;
    }
}

/* Device Management Styles */
.device-section {
    margin-bottom: 20px;
    padding: 16px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.device-section h4 {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #495057;
}

.input-button-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-button-group input {
    flex: 1;
}

.input-button-group button {
    flex-shrink: 0;
    font-size: 11px;
    padding: 6px 8px;
    white-space: nowrap;
}

/* ============================================
   EVENT LOG PANEL STYLES
   ============================================ */

   .event-log-container {
    height: 300px;
    background-color: #000;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 12px;
    overflow-y: auto;
    border: 1px solid #333;
    border-radius: 3px;
    line-height: 1.6;
}

.event-log-entry {
    margin-bottom: 4px;
    padding: 2px 0;
    border-bottom: 1px solid #111;
}

.event-log-entry:last-child {
    border-bottom: none;
}

.log-timestamp {
    color: #888;
    margin-right: 8px;
}

.log-device {
    color: #0ff;
    font-weight: bold;
    margin-right: 8px;
}

.log-event {
    color: #ff0;
    font-weight: bold;
}

.event-log-success {
    color: #0f0;
}

.event-log-error {
    color: #f00;
}

.event-log-info {
    color: #0ff;
}

.event-log-info {
    color: #0ff;
}

.log-debug {
    color: #0099ff;
    font-weight: bold;
}

.log-success {
    color: #0f0;
}

.log-error {
    color: #f00;
}


/* Reset Button Styles */
.btn-reset-hub, .btn-reset-sensor {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
}

.btn-reset-hub {
    background-color: #ff9800;
    color: white;
}

.btn-reset-hub:hover {
    background-color: #f57c00;
}

.btn-reset-sensor {
    background-color: #2196F3;
    color: white;
}

.btn-reset-sensor:hover {
    background-color: #1976D2;
}

#btn-refresh-logs {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
    font-size: 12px;
    padding: 6px 12px;
}

#btn-refresh-logs:hover:not(:disabled) {
    background-color: #45a049;
    border-color: #45a049;
}

#btn-toggle-device-archive {
    background-color: #6c757d;
    color: #fff;
    border-color: #6c757d;
    font-size: 12px;
    padding: 6px 12px;
}

#btn-toggle-device-archive:hover:not(:disabled) {
    background-color: #5a6268;
    border-color: #545b62;
}
