:root {
    --primary-color: #3498db;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --background-color: #f5f6fa;
    --card-background: #ffffff;
    --text-color: #2c3e50;
    --border-color: #dcdde1;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

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

.btn.danger {
    background-color: var(--danger-color);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.simulation-speed {
    display: flex;
    align-items: center;
    gap: 10px;
}

select {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.device-panel {
    background-color: var(--card-background);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.label {
    color: #7f8c8d;
    font-size: 0.9em;
}

.value {
    font-weight: bold;
    font-size: 1.1em;
}

.sensor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sensor-card {
    background-color: var(--card-background);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h3 {
    margin: 0;
}

.card-header i {
    font-size: 1.5em;
    color: var(--primary-color);
}

.sensor-value {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.chart-container {
    height: 200px;
    position: relative;
}

.data-log {
    background-color: var(--card-background);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.log-container {
    margin-top: 15px;
    overflow-x: auto;
}

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

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f8f9fa;
    font-weight: bold;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
    }

    .controls {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .simulation-speed {
        width: 100%;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Network Topology Styles */
.network-topology {
    background-color: var(--card-background);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.topology-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    position: relative;
    min-height: 200px;
}

.device-node,
.gateway-node,
.server-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.node-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.node-icon i {
    font-size: 24px;
    color: white;
}

.node-label {
    font-weight: bold;
    margin-top: 5px;
}

/* Connection Line Animation */
.connection-line {
    position: absolute;
    height: 2px;
    background-color: var(--border-color);
    transition: all 0.3s ease;
    overflow: hidden;
}

#loraConnection {
    width: 30%;
    left: 15%;
    top: 50%;
    transform: translateY(-50%);
}

#loraConnection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--primary-color) 50%, 
        transparent 100%);
    animation: wireFlow 2s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.connecting #loraConnection::before {
    opacity: 1;
}

.connected #loraConnection {
    background-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
}

.connected #loraConnection::before {
    opacity: 0;
}

@keyframes wireFlow {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Node States */
.connecting .node-icon {
    background-color: var(--warning-color);
    animation: nodePulse 1.5s infinite;
}

.connected .node-icon {
    background-color: var(--success-color);
    box-shadow: 0 0 15px var(--success-color);
}

.disconnected .node-icon {
    background-color: var(--danger-color);
}

@keyframes nodePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(243, 156, 18, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0);
    }
}

/* Connection Status */
.connection-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.status-label {
    color: #7f8c8d;
    font-size: 0.9em;
}

.status-value {
    font-weight: bold;
    font-size: 1.1em;
}

/* 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-color: var(--border-color);
    transition: all 0.3s ease;
}

.signal-bar.active {
    background-color: var(--success-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .topology-container {
        flex-direction: column;
        gap: 30px;
    }

    .connection-line {
        display: none;
    }

    .connection-status {
        grid-template-columns: 1fr;
    }
} 