/* Parameters page styles */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-color: #212529;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    border: none;
    transition: transform 0.3s ease;
    background: white;
}

.header-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header-card h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.navbar-custom {
    background: white;
    border-radius: 15px;
    padding: 15px 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.navbar-custom .nav-link {
    color: #495057;
    font-weight: 600;
    padding: 8px 15px;
    margin: 0 5px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.navbar-custom .nav-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.navbar-custom .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-test {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-test:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-outline-light {
    border-radius: 25px;
    font-weight: 600;
    border: 2px solid #667eea;
    color: #667eea;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    transform: scale(1.05);
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.status-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    padding: 15px 20px;
    border: none;
}

.card-header h5 {
    margin: 0;
    font-size: 1.2rem;
}

.card-body {
    padding: 20px;
}

.stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.stat-box.modified {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-box h3 {
    font-size: 2rem;
    margin: 0;
    font-weight: bold;
}

.stat-box p {
    margin: 5px 0 0 0;
    opacity: 0.9;
}

.filter-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.filter-section input {
    border-radius: 25px;
    border: 2px solid #e9ecef;
    padding: 10px 20px;
}

.filter-section input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

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

.filter-buttons .btn {
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.85rem;
}

.filter-buttons .btn-outline-primary {
    border-color: #667eea;
    color: #667eea;
}

.filter-buttons .btn-outline-primary:hover,
.filter-buttons .btn-outline-primary.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.filter-buttons .btn-outline-warning {
    border-color: #f5576c;
    color: #f5576c;
}

.filter-buttons .btn-outline-warning:hover,
.filter-buttons .btn-outline-warning.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: #f5576c;
    color: white;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
}

.params-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    position: sticky;
    top: 0;
}

.params-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
    font-family: 'Courier New', monospace;
}

.params-table tr:hover {
    background: #f8f9fa;
}

.params-table tr.modified {
    background: rgba(245, 87, 108, 0.1);
}

.params-table tr.modified:hover {
    background: rgba(245, 87, 108, 0.2);
}

.param-name {
    font-weight: 600;
    color: #495057;
}

.param-description {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 400;
    margin-top: 2px;
    line-height: 1.3;
}

.param-value {
    color: #198754;
}

.param-default {
    color: #6c757d;
}

.param-modified {
    color: #f5576c;
    font-weight: 600;
}

.badge-modified {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
}

.table-container {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.group-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    font-weight: 600;
    color: #495057;
    cursor: pointer;
}

.group-header:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.group-header td {
    padding: 15px;
}

.group-header i {
    transition: transform 0.3s ease;
}

.group-header.collapsed i {
    transform: rotate(-90deg);
}

/* Telemetry styles */
.telemetry-section {
    margin-bottom: 20px;
}

.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.telemetry-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.telemetry-card h6 {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.telemetry-card h6 i {
    margin-right: 8px;
}

.telemetry-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9rem;
}

.telemetry-item .label {
    color: #6c757d;
}

.telemetry-item .value {
    font-weight: 600;
    color: #495057;
    font-family: 'Courier New', monospace;
}

.telemetry-item .value.good {
    color: #198754;
}

.telemetry-item .value.warning {
    color: #ffc107;
}

.telemetry-item .value.danger {
    color: #dc3545;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.connection-status.connected {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(25, 135, 84, 0.2) 100%);
    color: #198754;
}

.connection-status.disconnected {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.2) 100%);
    color: #dc3545;
}

.connection-status i {
    font-size: 1.2rem;
}

.attitude-display {
    display: flex;
    justify-content: space-around;
    text-align: center;
    padding: 10px 0;
}

.attitude-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.attitude-label {
    font-size: 0.8rem;
    color: #6c757d;
}

.battery-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.battery-bar .fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.battery-bar .fill.good {
    background: linear-gradient(90deg, #198754 0%, #20c997 100%);
}

.battery-bar .fill.warning {
    background: linear-gradient(90deg, #ffc107 0%, #fd7e14 100%);
}

.battery-bar .fill.danger {
    background: linear-gradient(90deg, #dc3545 0%, #c82333 100%);
}

.rc-channels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.rc-channel {
    text-align: center;
    padding: 5px;
    background: #f8f9fa;
    border-radius: 8px;
}

.rc-channel .ch-num {
    font-size: 0.7rem;
    color: #6c757d;
}

.rc-channel .ch-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
}

.imu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.imu-axis {
    text-align: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
}

.imu-axis .axis-label {
    font-size: 0.75rem;
    color: #6c757d;
}

.imu-axis .axis-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}

/* ==================== Parameter Editing Styles ==================== */

/* Clickable parameter values */
.param-value-display {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-block;
}

.param-value-display:hover {
    background-color: rgba(102, 126, 234, 0.15);
    color: #667eea;
}

/* Edit icon */
.param-edit-icon {
    font-size: 0.75rem;
    color: #667eea;
    opacity: 0.4;
    margin-left: 6px;
    transition: opacity 0.2s ease;
}

.param-value-display:hover .param-edit-icon {
    opacity: 1;
}

/* Edit input group */
.edit-input-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.param-edit-input {
    width: 120px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 4px 8px;
    border: 2px solid #667eea;
    border-radius: 6px;
}

.param-edit-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.param-edit-input:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

/* Select dropdown for enum parameters */
.param-edit-select {
    width: 220px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    padding: 4px 8px;
    border: 2px solid #667eea;
    border-radius: 6px;
    cursor: pointer;
}

.param-edit-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.param-edit-select:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

/* Enum value display */
.param-enum-value {
    font-weight: 700;
}

.param-enum-label {
    color: #6c757d;
    font-size: 0.85em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.param-save-btn {
    padding: 4px 10px;
    border-radius: 6px;
}

.param-cancel-btn {
    padding: 4px 10px;
    border-radius: 6px;
}

/* Row being edited */
.params-table tr.editing {
    background-color: rgba(102, 126, 234, 0.1) !important;
}

.params-table tr.editing:hover {
    background-color: rgba(102, 126, 234, 0.15) !important;
}

/* Toast notifications */
.param-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    min-width: 280px;
    max-width: 400px;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    display: none;
    font-weight: 500;
}

.param-toast i {
    margin-right: 10px;
}

.param-toast.alert-success {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
    color: white;
    border: none;
}

.param-toast.alert-danger {
    background: linear-gradient(135deg, #dc3545 0%, #f5576c 100%);
    color: white;
    border: none;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .edit-input-group {
        flex-wrap: wrap;
    }

    .param-edit-input,
    .param-edit-select {
        width: 100%;
        margin-bottom: 6px;
    }

    .param-toast {
        left: 20px;
        right: 20px;
        min-width: auto;
    }
}
