/* 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: 1200px;
    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: 40px;
    text-align: center;
}

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

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

.map-button {
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

.map-button:hover {
    background: rgba(255,255,255,0.3);
}

main {
    padding: 40px;
}

.stats {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 60px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-number {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 5px;
}

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

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

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

/* Node Card Styles */
.node-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.node-card-header {
    padding: 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.node-main-info {
    flex: 1;
    min-width: 0;
}

.node-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.node-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gps-badge {
    font-size: 1em;
    flex-shrink: 0;
}

.node-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.node-id {
    font-family: 'Courier New', monospace;
    color: #667eea;
    font-weight: 600;
    font-size: 0.9em;
}

.node-short {
    color: #6b7280;
    font-size: 0.9em;
    background: #e5e7eb;
    padding: 2px 8px;
    border-radius: 4px;
}

.node-primary-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.stat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    min-width: 70px;
}

.stat-badge .stat-label {
    font-size: 0.7em;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-badge .stat-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #1f2937;
}

.expand-icon {
    color: #9ca3af;
    font-size: 0.9em;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.node-card.expanded .expand-icon {
    transform: rotate(180deg);
}

/* Card Body (Expandable Details) */
.node-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.node-card.expanded .node-card-body {
    max-height: 600px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    padding: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 0.75em;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-value {
    font-size: 0.95em;
    color: #1f2937;
    font-weight: 500;
}

.location-link {
    color: #667eea;
    text-decoration: none;
}

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

/* Table Styles (for backwards compatibility) */
.nodes-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nodes-table thead {
    background: #f8f9fa;
}

.nodes-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

.nodes-table td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

.nodes-table tbody tr:hover {
    background: #f8f9fa;
}

.nodes-table tbody tr:last-child td {
    border-bottom: none;
}

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

.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;
}

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

    header h1 {
        font-size: 1.8em;
    }

    header {
        padding: 30px 20px;
    }

    main {
        padding: 20px;
    }

    .stat-box {
        padding: 20px 40px;
    }

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

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

    .node-card-header {
        flex-direction: column;
        gap: 12px;
    }

    .node-primary-stats {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }

    .stat-badge {
        min-width: 60px;
    }
}

@media (max-width: 480px) {
    .nodes-grid {
        grid-template-columns: 1fr;
    }

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

    header h1 {
        font-size: 1.5em;
    }

    .stat-number {
        font-size: 1.8em;
    }
}
