/**
 * Gilba Hub Sensor Import Styles
 * Version 1.0.0
 */

/* Sensor Upload Area */
.gaip-sensor-upload {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.2s ease;
    cursor: pointer;
}

.gaip-sensor-upload:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

.gaip-sensor-upload.dragging {
    border-color: #10b981;
    background: #ecfdf5;
    border-style: solid;
}

.gaip-sensor-upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.gaip-sensor-upload-text {
    color: #6b7280;
    font-size: 13px;
}

.gaip-sensor-upload-text strong {
    color: #10b981;
}

.gaip-sensor-upload-hint {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 6px;
}

/* Sensor Summary Panel */
.gaip-sensor-summary {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 12px;
}

.gaip-sensor-empty {
    padding: 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.gaip-sensor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #bbf7d0;
}

.gaip-sensor-device {
    font-weight: 600;
    color: #166534;
    font-size: 13px;
}

.gaip-sensor-age {
    font-size: 11px;
    color: #6b7280;
    background: white;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Metrics Grid */
.gaip-sensor-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.gaip-sensor-metric {
    background: white;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.gaip-sensor-metric.gaip-status-ok {
    border-color: #86efac;
}

.gaip-sensor-metric.gaip-status-low {
    border-color: #fbbf24;
    background: #fffbeb;
}

.gaip-sensor-metric.gaip-status-high {
    border-color: #f87171;
    background: #fef2f2;
}

.gaip-sensor-metric.gaip-status-warning {
    border-color: #fbbf24;
    background: #fffbeb;
}

.gaip-sensor-value {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.gaip-sensor-label {
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gaip-sensor-range {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Problem Alerts */
.gaip-sensor-problems {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 8px;
    margin-top: 8px;
}

.gaip-sensor-problems-header {
    font-size: 11px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 6px;
}

.gaip-sensor-problem {
    font-size: 11px;
    color: #78350f;
    padding: 4px 0;
    border-bottom: 1px solid #fde68a;
}

.gaip-sensor-problem:last-child {
    border-bottom: none;
}

.gaip-sensor-problem.gaip-severity-critical {
    color: #dc2626;
}

.gaip-sensor-problem.gaip-severity-warning {
    color: #d97706;
}

.gaip-sensor-problem.gaip-severity-info {
    color: #0369a1;
}

/* Zone Table */
.gaip-sensor-zones-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 12px;
}

.gaip-sensor-zones-table th {
    background: #f3f4f6;
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.gaip-sensor-zones-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
}

.gaip-sensor-zones-table tr:hover td {
    background: #f9fafb;
}

/* Import Result */
.gaip-sensor-import-result {
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
}

.gaip-sensor-import-result.success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.gaip-sensor-import-result.error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #dc2626;
}

.gaip-sensor-import-stats {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 12px;
}

.gaip-sensor-import-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Clear Button */
.gaip-sensor-clear-btn {
    font-size: 11px;
    color: #dc2626;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    margin-top: 8px;
}

.gaip-sensor-clear-btn:hover {
    text-decoration: underline;
}

/* Integration Badge */
.gaip-sensor-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    background: #ecfdf5;
    color: #059669;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid #a7f3d0;
}

/* Override indicator in irrigation module */
.gaip-irrigation-sensor-override {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #86efac;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 12px;
}

.gaip-irrigation-sensor-override strong {
    color: #166534;
}

/* ================================================
   Golf Zone Labelling UI (v2.0)
   ================================================ */

.gaip-sensor-labelling {
    margin-top: 16px;
}

.gaip-sensor-bulk-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 4px;
}

.gaip-bulk-zone-select {
    min-width: 160px;
    padding: 6px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 13px;
}

.gaip-sensor-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.gaip-sensor-readings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.gaip-sensor-readings-table th {
    position: sticky;
    top: 0;
    background: #f5f5f5;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    font-size: 12px;
}

.gaip-sensor-readings-table td {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.gaip-sensor-readings-table tr:hover td {
    background: #fafafa;
}

.gaip-sensor-readings-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.gaip-zone-select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
}

.gaip-sensor-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.gaip-sensor-zone-results {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.gaip-sensor-zone-results .gaip-table {
    margin-top: 12px;
}

/* Button styles for labelling UI */
.gaip-sensor-bulk-controls .gaip-btn-secondary {
    padding: 6px 12px;
    font-size: 12px;
}

/* ================================================
   Zone Selector Panel (v2.1)
   ================================================ */

.gaip-zone-selector-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #86efac;
    border-radius: 6px;
    margin-bottom: 16px;
}

.gaip-zone-selector-panel label {
    font-size: 13px;
    color: #166534;
    white-space: nowrap;
}

.gaip-analyse-zone-select {
    flex: 1;
    max-width: 280px;
    padding: 8px 12px;
    border: 1px solid #86efac;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    color: #1f2937;
}

.gaip-analyse-zone-select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.gaip-zone-indicator {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.gaip-zone-indicator.gaip-status-good {
    background: #dcfce7;
    color: #166534;
}

.gaip-zone-indicator.gaip-status-warning {
    background: #fef3c7;
    color: #92400e;
}

.gaip-zone-indicator.gaip-status-critical {
    background: #fee2e2;
    color: #dc2626;
}

/* Selected row highlight */
.gaip-zone-selected-row {
    background: #ecfdf5 !important;
}

.gaip-zone-selected-row td {
    font-weight: 600;
}

/* Zone irrigation summary */
.gaip-zone-irrigation-summary {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 4px;
    font-size: 13px;
}

.gaip-zone-irrigation-summary span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Info status color */
.gaip-text-info {
    color: #0369a1;
}

.gaip-status-info {
    background: #e0f2fe;
    color: #0369a1;
}

/* Labelling option prompt */
.gaip-sensor-labelling-prompt {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
}

.gaip-sensor-labelling-prompt p {
    margin: 0 0 12px 0;
    color: #475569;
    font-size: 14px;
}

.gaip-sensor-labelling-prompt .gaip-btn,
.gaip-sensor-labelling-prompt .gaip-btn-secondary {
    margin-right: 8px;
}
