/* JacksonMesh Map Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

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

.header-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-stat {
    flex: 0 0 auto;
    text-align: center;
    min-width: 120px;
}

.header-stat .stat-number {
    font-size: 2.5em;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 5px;
}

.header-stat .stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-center {
    flex: 1;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Map Banner */
.map-banner {
    width: 100%;
    background: #f0f0f0;
}

#map {
    width: 100%;
    height: 300px;
}

/* Map Legend */
.map-legend {
    background: white;
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
}

.legend-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.legend-items {
    display: flex;
    flex-direction: row;
    gap: 20px;
    flex-wrap: wrap;
}

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

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-label {
    font-size: 0.9em;
    color: #666;
    white-space: nowrap;
}

.no-map-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
    color: #667eea;
    font-size: 1.2em;
    font-weight: 600;
}

.node-popup {
    font-family: Arial, sans-serif;
    min-width: 200px;
}

.node-popup h3 {
    margin: 0 0 10px 0;
    color: #667eea;
}

.node-popup p {
    margin: 5px 0;
    font-size: 0.9em;
}

main {
    padding: 40px;
}

/* Time Filter Section */
.time-filter-section {
    background: white;
    padding: 20px 40px;
    border-bottom: 1px solid #e0e0e0;
}

.time-filter-container {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

.filter-label {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

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

.filter-btn {
    padding: 8px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #e0e7ff;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.filter-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Message History Section */
.messages-section {
    margin-bottom: 40px;
}

.messages-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.messages-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.message-item {
    background: white;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-item:last-child {
    margin-bottom: 0;
}

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

.message-from {
    font-weight: 600;
    color: #667eea;
    font-size: 0.95em;
}

.message-time {
    font-size: 0.85em;
    color: #888;
}

.message-text {
    color: #333;
    line-height: 1.5;
    font-size: 0.95em;
}

.nodes-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

/* Node Cards Grid */
.nodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.node-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

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

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

.node-card-body {
    padding: 16px 20px;
}

.node-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.node-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.85em;
    color: #666;
    font-weight: 600;
}

.detail-value {
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
    text-align: right;
}

.node-id {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    opacity: 0.9;
}

.node-name {
    font-weight: 700;
    font-size: 1.2em;
    margin-bottom: 4px;
}

.node-time {
    color: #888;
    font-size: 0.9em;
}

/* Badges */
.node-short-badge,
.hops-badge,
.gps-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.node-short-badge {
    background: #e0e7ff;
    color: #667eea;
}

.hops-badge {
    background: #667eea;
    color: white;
}

.gps-badge {
    background: #d1fae5;
    color: #059669;
}

.map-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.map-link:hover {
    text-decoration: underline;
}

.no-nodes {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-nodes p {
    font-size: 1.2em;
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

/* Network Statistics Cards */
.stats-section {
    padding: 30px 40px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.stat-icon {
    font-size: 2em;
    line-height: 1;
}

.stat-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.stat-current {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 20px;
}

.stat-current .stat-number {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    line-height: 1;
}

.stat-current .stat-unit {
    font-size: 1.1em;
    color: #666;
    font-weight: 500;
}

.stat-chart-container {
    height: 180px;
    margin-bottom: 12px;
}

.stat-subtitle {
    text-align: center;
    color: #999;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 20px 15px;
    }

    .header-layout {
        flex-direction: column;
        gap: 15px;
    }

    .header-stat {
        min-width: auto;
    }

    .header-stat .stat-number {
        font-size: 2em;
    }

    .header-stat .stat-label {
        font-size: 0.85em;
    }

    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.95em;
    }

    #map {
        height: 250px;
    }

    .map-legend {
        padding: 12px 15px;
    }

    .legend-items {
        flex-direction: column;
        gap: 10px;
    }

    main {
        padding: 20px 15px;
    }

    .time-filter-section {
        padding: 15px 15px;
    }

    .time-filter-container {
        flex-direction: column;
        gap: 12px;
    }

    .filter-buttons {
        gap: 8px;
        justify-content: center;
    }

    .filter-btn {
        padding: 6px 16px;
        font-size: 0.85em;
    }

    .messages-container {
        max-height: 240px;
        padding: 15px;
    }

    .message-item {
        padding: 10px 14px;
    }

    .nodes-section h2 {
        font-size: 1.4em;
        margin-bottom: 15px;
    }

    .nodes-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .node-card-header {
        padding: 14px 16px;
    }

    .node-card-body {
        padding: 14px 16px;
    }

    .node-name {
        font-size: 1.1em;
    }

    .node-id {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    header {
        padding: 15px 10px;
    }

    .header-stat .stat-number {
        font-size: 1.6em;
    }

    .header-stat .stat-label {
        font-size: 0.75em;
    }

    header h1 {
        font-size: 1.4em;
        margin-bottom: 5px;
    }

    .subtitle {
        font-size: 0.85em;
    }

    #map {
        height: 200px;
    }

    .map-legend {
        padding: 10px 12px;
    }

    .legend-title {
        font-size: 0.9em;
    }

    .legend-label {
        font-size: 0.85em;
    }

    main {
        padding: 15px 10px;
    }

    .messages-section h2 {
        font-size: 1.3em;
    }

    .messages-container {
        max-height: 200px;
        padding: 12px;
    }

    .message-item {
        padding: 8px 12px;
        margin-bottom: 10px;
    }

    .message-from {
        font-size: 0.9em;
    }

    .message-time {
        font-size: 0.8em;
    }

    .message-text {
        font-size: 0.9em;
    }

    .nodes-section h2 {
        font-size: 1.2em;
    }

    .nodes-grid {
        gap: 10px;
    }

    .node-card-header {
        padding: 12px 14px;
    }

    .node-card-body {
        padding: 12px 14px;
    }

    .node-name {
        font-size: 1em;
    }

    .node-id {
        font-size: 0.75em;
    }

    .node-short-badge,
    .hops-badge,
    .gps-badge {
        font-size: 0.75em;
        padding: 3px 8px;
    }

    .detail-label {
        font-size: 0.8em;
    }

    .detail-value {
        font-size: 0.85em;
    }

    /* Stats cards responsive */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .stat-icon {
        font-size: 1.5em;
    }

    .stat-current {
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-current .stat-number {
        font-size: 2em;
    }

    footer {
        padding: 15px 10px;
        font-size: 0.8em;
    }
}
