/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #6c757d, #545b62);
    color: white;
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #1e7e34);
    color: white;
}

.btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Status */
.status {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.status.scanning {
    background: rgba(255, 193, 7, 0.9);
    color: #856404;
}

.status.error {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

.status.success {
    background: rgba(40, 167, 69, 0.9);
    color: white;
}

/* Device Count */
.device-count {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* Table Container */
.table-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    overflow-x: auto;
}

.device-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.device-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.device-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.device-table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Column-specific styles with color coding */
.col-name {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    min-width: 150px;
}

.col-id {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    min-width: 200px;
    font-family: monospace;
    font-size: 12px;
}

.col-status {
    background: linear-gradient(135deg, #45b7d1, #96c93d);
    color: white;
    min-width: 100px;
}

.col-rssi {
    background: linear-gradient(135deg, #f9ca24, #f0932b);
    color: white;
    min-width: 120px;
}

.col-services {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    min-width: 200px;
}

.col-manufacturer {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
    min-width: 120px;
}

.col-type {
    background: linear-gradient(135deg, #00b894, #00a085);
    color: white;
    min-width: 120px;
}

.col-battery {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    color: white;
    min-width: 100px;
}

.col-last-seen {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    min-width: 160px;
}

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-connected {
    background: #d4edda;
    color: #155724;
}

.status-available {
    background: #d1ecf1;
    color: #0c5460;
}

.status-unavailable {
    background: #f8d7da;
    color: #721c24;
}

/* Signal strength indicator */
.signal-strength {
    display: flex;
    align-items: center;
    gap: 5px;
}

.signal-bars {
    display: flex;
    gap: 2px;
}

.signal-bar {
    width: 3px;
    height: 10px;
    background: #ddd;
    border-radius: 1px;
}

.signal-bar.active {
    background: #28a745;
}

/* Battery indicator */
.battery-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.battery-icon {
    font-size: 16px;
}

/* Services list */
.services-list {
    max-height: 60px;
    overflow-y: auto;
    font-size: 11px;
}

.service-item {
    display: inline-block;
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    margin: 1px;
    border-radius: 8px;
    font-family: monospace;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
    display: none;
}

.empty-state.show {
    display: block;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.empty-state p {
    opacity: 0.8;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .device-table {
        font-size: 12px;
    }
    
    .device-table th,
    .device-table td {
        padding: 8px 6px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.5);
}
