/**
 * index.html specific styles
 * MQTT Control Center Main Page
 */

body {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #f0f0f0;
}
h1 { color: #333; margin-bottom: 5px; }
h3 { margin-top: 0; color: #666; }

.status {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: bold;
}
.status.connected { background: #d4edda; color: #155724; }
.status.disconnected { background: #f8d7da; color: #721c24; }

.container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.panel {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

button {
    padding: 15px 30px;
    font-size: 16px;
    margin: 5px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background: #007bff;
    color: white;
    transition: background 0.3s;
}
button:hover { background: #0056b3; }
button:active { transform: scale(0.98); }

.log {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.log-entry {
    padding: 5px;
    margin: 2px 0;
    border-left: 3px solid #007bff;
    padding-left: 10px;
}
.log-entry.sent { border-left-color: #28a745; background: #d4edda; }
.log-entry.received { border-left-color: #17a2b8; background: #d1ecf1; }
.log-entry.error { border-left-color: #dc3545; background: #f8d7da; }

.timestamp { color: #666; font-size: 11px; }
.topic { color: #007bff; font-weight: bold; }
.message { color: #333; }

.filter-panel {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.filter-panel h3 {
    margin-top: 0;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-section {
    margin-bottom: 15px;
}

.filter-section h4 {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 600;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-checkbox:hover {
    background: #e9ecef;
}

.filter-checkbox input[type="checkbox"] {
    cursor: pointer;
}

.filter-checkbox label {
    cursor: pointer;
    margin: 0;
    font-size: 13px;
}

.filter-badge {
    background: #007bff;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

.toggle-filters-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.toggle-filters-btn:hover {
    background: #5a6268;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 10px;
    }

    h3 {
        font-size: 1.1em;
        margin-bottom: 15px;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .toggle-filters-btn {
        padding: 14px 20px;
        font-size: 15px;
        width: 100%;
        min-height: 50px;
    }

    /* Filter panel mobile optimization */
    .filter-panel {
        padding: 15px;
    }

    .filter-panel h3 {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .filter-panel h3 > div {
        width: 100%;
        flex-direction: column;
    }

    .filter-panel button {
        width: 100%;
        min-height: 44px;
        padding: 12px 15px;
        font-size: 14px;
    }

    .filter-section {
        margin-bottom: 15px;
    }

    .filter-section label {
        margin: 10px 0 5px 0;
    }

    /* Checkboxes easier to tap */
    input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }

    /* Log sections */
    .log-section {
        padding: 15px;
    }

    .log-section h3 {
        font-size: 1.2em;
    }

    #logReceived,
    #logSent {
        font-size: 13px;
        max-height: 300px;
    }

    /* Command inputs */
    .command-inputs {
        flex-direction: column;
        gap: 10px;
    }

    .command-inputs input {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
    }

    .command-inputs button {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
    }
}
