body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Ensure navbar doesn't get affected by body styles */
.navbar {
    position: relative;
    z-index: 1000;
}

.content-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    min-height: 70vh; /* Ensure container has minimum height */
}

/* Ensure proper spacing after navigation */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.page-header h1 {
    color: #4CAF50;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

/* Connected state: Compact header */
.page-header-connected {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.title-section h1 {
    color: #4CAF50;
    font-size: 2rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.title-section .subtitle {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(76, 175, 80, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    flex-shrink: 0;
}

.status-indicator {
    font-size: 1.2rem;
}

.status-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4CAF50;
    display: block;
    margin-bottom: 0.25rem;
}

.status-actions-mini {
    display: flex;
    gap: 0.25rem;
}

.btn-mini {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-refresh {
    background: #4CAF50;
    color: white;
}

.btn-refresh:hover:not(:disabled) {
    background: #45a049;
    transform: scale(1.1);
}

.btn-disconnect {
    background: #6c757d;
    color: white;
}

.btn-disconnect:hover {
    background: #5a6268;
    transform: scale(1.1);
}

.btn-mini:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Disconnected state: Prominent prompt */
.connection-prompt {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.prompt-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.connection-prompt h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.connection-prompt p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    background: white;
    color: #667eea;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Features grid for disconnected state */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.feature-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Table improvements - fix the styling */
.health-data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.health-data-table th {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.health-data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.health-data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.health-data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Alternating row colors */
.health-data-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.health-data-table tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

/* Style the data container */
.data-container {
    margin-top: 2rem;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.data-container h2 {
    color: #4CAF50;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    margin-top: 0;
    font-size: 1.5rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .page-header-connected {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    
    .connection-prompt {
        padding: 2rem 1rem;
    }
    
    .prompt-icon {
        font-size: 3rem;
    }
    
    .connection-prompt h2 {
        font-size: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-card {
        padding: 1rem;
    }
    
    .health-data-table {
        font-size: 0.8rem;
    }
    
    .health-data-table th, 
    .health-data-table td {
        padding: 0.5rem;
    }
}

/* Responsive table for very small screens */
@media (max-width: 600px) {
    .health-data-table, 
    .health-data-table thead, 
    .health-data-table tbody, 
    .health-data-table th, 
    .health-data-table td, 
    .health-data-table tr {
        display: block;
    }
    
    .health-data-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .health-data-table tr {
        border: 1px solid #ddd;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 8px;
        background: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .health-data-table td {
        border: none;
        position: relative;
        padding-left: 50% !important;
        text-align: right;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .health-data-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        text-align: left;
        font-weight: bold;
        color: #4CAF50;
    }
    
    .health-data-table td:first-child {
        background: #f8f9fa;
        font-weight: bold;
        color: #4CAF50;
        text-align: center;
        padding-left: 1rem !important;
    }
    
    .health-data-table td:first-child:before {
        display: none;
    }
}

/* Loading state improvements */
.loading-state {
    text-align: center;
    padding: 2rem;
    color: #666;
    background: white;
    border-radius: 8px;
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error message styling */
.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    margin-top: 1rem;
}
