/* ApiSense Custom Styles */

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --success-color: #4CAF50;
    --info-color: #2196F3;
}

/* Login page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    width: 400px;
}

.login-logo {
    font-size: 35px;
    font-weight: 300;
    margin-bottom: 25px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-logo b {
    font-weight: 600;
}

.login-card-body {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* Dashboard cards */
.info-box {
    min-height: 90px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.info-box-icon {
    border-radius: 8px 0 0 8px;
    width: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-box-icon i {
    font-size: 40px;
}

.small-box {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.small-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Device cards */
.device-card {
    border-radius: 8px;
    transition: all 0.3s;
    border: 1px solid #ddd;
}

.device-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.device-status-online {
    color: #4CAF50;
}

.device-status-offline {
    color: #f44336;
}

.device-battery {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.device-battery i {
    font-size: 18px;
}

.battery-high { color: #4CAF50; }
.battery-medium { color: #ff9800; }
.battery-low { color: #f44336; }

/* Hive cards */
.hive-card {
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.hive-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.hive-weight {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-color);
}

.hive-trend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.hive-trend.up { color: #4CAF50; }
.hive-trend.down { color: #f44336; }

/* Charts */
.chart-container {
    position: relative;
    height: 400px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chart-legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alerts */
.alert {
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success { border-left-color: var(--success-color); }
.alert-danger { border-left-color: var(--danger-color); }
.alert-warning { border-left-color: var(--warning-color); }
.alert-info { border-left-color: var(--info-color); }

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #45a049;
    border-color: #45a049;
}

/* Tables */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

/* Status badges */
.badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.badge-online {
    background-color: #4CAF50;
    color: white;
}

.badge-offline {
    background-color: #f44336;
    color: white;
}

/* Time ago */
.time-ago {
    font-size: 12px;
    color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .login-box {
        width: 90%;
        margin: 7.5% auto;
    }

    .chart-container {
        height: 300px;
    }

    .info-box {
        margin-bottom: 15px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .table {
        color: #e2e8f0;
    }
}

/* Utility classes */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }

.text-muted-light { color: #a0aec0; }
.cursor-pointer { cursor: pointer; }
.transition-all { transition: all 0.2s; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h4 {
    color: #6c757d;
    margin-bottom: 10px;
}

.empty-state p {
    color: #a0aec0;
}
