/* CSS Variables for Theme System */
:root {
    /* Light Theme Colors - Medical Grade */
    --bg-primary: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    --bg-secondary: rgba(255, 255, 255, 0.98);
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-input: rgba(255, 255, 255, 0.9);
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-light: rgba(226, 232, 240, 0.8);
    --border-subtle: rgba(0, 0, 0, 0.04);
    --shadow-light: rgba(0, 0, 0, 0.06);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, #4299e1, #3182ce);
    --gradient-secondary: linear-gradient(135deg, #48bb78, #38a169);
    --accent-heart: #e53e3e;
    --accent-success: #38a169;
    --accent-warning: #d69e2e;
    --accent-info: #3182ce;
    --backdrop-blur: blur(24px);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
}

/* Dark Theme Colors */
[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    --bg-secondary: rgba(26, 32, 44, 0.98);
    --bg-card: rgba(45, 55, 72, 0.95);
    --bg-card-hover: rgba(54, 65, 84, 1);
    --bg-input: rgba(74, 85, 104, 0.9);
    --text-primary: #f7fafc;
    --text-secondary: #cbd5e0;
    --text-muted: #a0aec0;
    --border-light: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.4);
    --gradient-primary: linear-gradient(135deg, #4299e1, #3182ce);
    --gradient-secondary: linear-gradient(135deg, #48bb78, #38a169);
    --accent-heart: #fc8181;
    --accent-success: #68d391;
    --accent-warning: #f6e05e;
    --accent-info: #63b3ed;
    --backdrop-blur: blur(24px);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: var(--bg-secondary);
    backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px var(--shadow-light);
    transition: all 0.3s ease;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 2rem;
    color: var(--accent-heart);
    animation: pulse 2s infinite;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.refresh-btn, .nav-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.refresh-btn:hover, .nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.refresh-btn:active, .nav-btn:active {
    transform: translateY(0);
}

.nav-btn {
    background: var(--gradient-secondary);
    box-shadow: 0 4px 15px rgba(72, 202, 228, 0.3);
}

.nav-btn:hover {
    box-shadow: 0 6px 20px rgba(72, 202, 228, 0.4);
}

.theme-toggle {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-light);
    padding: 0.75rem;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 45px;
    height: 45px;
    box-shadow: 0 2px 10px var(--shadow-light);
}

.theme-toggle:hover {
    transform: translateY(-2px) rotate(15deg);
    box-shadow: 0 4px 15px var(--shadow-medium);
    border-color: var(--gradient-primary);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 1px solid rgba(46, 204, 113, 0.3);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: var(--backdrop-blur);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 20px var(--shadow-light);
    border: 1px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0.8;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--shadow-medium);
    background: var(--bg-card-hover);
}

.stat-card:hover .stat-icon {
    transform: scale(1.05);
}

.heart-rate-card {
    border-left: 4px solid var(--accent-heart);
}

.heart-rate-card .stat-icon {
    background: linear-gradient(135deg, var(--accent-heart), #c53030);
}

.steps-card {
    border-left: 4px solid var(--accent-success);
}

.steps-card .stat-icon {
    background: linear-gradient(135deg, var(--accent-success), #2f855a);
}

.device-card {
    border-left: 4px solid var(--accent-info);
}

.device-card .stat-icon {
    background: linear-gradient(135deg, var(--accent-info), #2c5282);
}

.readings-card {
    border-left: 4px solid var(--accent-warning);
}

.readings-card .stat-icon {
    background: linear-gradient(135deg, var(--accent-warning), #b7791f);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.6rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stat-value span:first-child {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    font-feature-settings: 'tnum';
}

.unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trend-indicator.positive {
    background: rgba(56, 161, 105, 0.1);
    color: var(--accent-success);
}

.trend-indicator.negative {
    background: rgba(229, 62, 62, 0.1);
    color: var(--accent-heart);
}

.trend-indicator.neutral {
    background: rgba(49, 130, 206, 0.1);
    color: var(--accent-info);
}

.stat-trend {
    display: flex;
    align-items: center;
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-success);
}

.trend-indicator.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.trend-indicator.positive {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-success);
}

.stat-progress {
    margin-top: 0.75rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
    box-shadow: inset 0 1px 2px var(--shadow-light);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-success), #2f855a);
    border-radius: var(--border-radius-sm);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 25%, 
        rgba(255, 255, 255, 0.1) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 50%, 
        transparent 75%, 
        rgba(255, 255, 255, 0.1) 75%);
    background-size: 8px 8px;
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    0% { background-position: 0 0; }
    100% { background-position: 8px 0; }
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.device-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: var(--bg-card);
    backdrop-filter: var(--backdrop-blur);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    box-shadow: 0 4px 20px var(--shadow-light);
    border: 1px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0.6;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow-medium);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
}

.time-filter {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    border-radius: var(--border-radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.time-filter:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-info);
    color: var(--accent-info);
    transform: translateY(-1px);
}

.time-filter.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.3);
}
    color: #667eea;
}

.time-filter.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.activity-data {
    display: flex;
    flex-direction: column;
}

.activity-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activity-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Timeline Section */
.timeline-section {
    background: var(--bg-card);
    backdrop-filter: var(--backdrop-blur);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px var(--shadow-light);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.timeline-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-controls {
    display: flex;
    gap: 0.5rem;
}

.timeline-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-subtle);
    background: transparent;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.timeline-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    color: #667eea;
}

.timeline-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

.timeline-list {
    max-height: 400px;
    overflow-y: auto;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
}

.timeline-item:hover {
    background: var(--bg-input);
    border-radius: 12px;
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.timeline-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.calendar-view {
    display: flex;
    gap: 1.5rem;
    height: 500px;
}

.calendar-container {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.calendar-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.calendar-nav-btn {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.calendar-nav-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    color: #667eea;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    flex: 1;
}

.calendar-day-header {
    background: var(--bg-input);
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    background: var(--bg-card-hover);
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 60px;
    color: var(--text-primary);
}

.calendar-day:hover {
    background: rgba(102, 126, 234, 0.05);
}

.calendar-day.today {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
}

.calendar-day.today:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
}

.calendar-day.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.calendar-day.has-data::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
}

.calendar-day.today.has-data::after {
    background: white;
}

.calendar-day.other-month {
    color: var(--text-muted);
    background: var(--bg-input);
}

.calendar-day.other-month:hover {
    background: var(--bg-input);
    opacity: 0.7;
}

.calendar-day-number {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.calendar-day-indicator {
    font-size: 0.625rem;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    font-weight: 500;
}

.calendar-day.today .calendar-day-indicator {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Day Details Panel */
.day-details-panel {
    flex: 1;
    background: var(--bg-input);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.day-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.day-details-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.close-details-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-details-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.day-details-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.no-data-message {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
}

.day-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-card-hover);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.summary-stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.day-readings-list {
    margin-top: 1rem;
}

.day-readings-list h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reading-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card-hover);
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.reading-time {
    color: var(--text-secondary);
    font-weight: 500;
}

.reading-values {
    display: flex;
    gap: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.hidden {
    display: none !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    backdrop-filter: var(--backdrop-blur);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--accent-heart);
    animation: pulse 1.5s infinite;
}

.loading-spinner span {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Error Overlay */
.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    backdrop-filter: var(--backdrop-blur);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: opacity 0.3s ease;
}

.error-content {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px var(--shadow-medium);
    border: 1px solid var(--border-light);
    text-align: center;
}

.error-content i {
    font-size: 3rem;
    color: var(--accent-heart);
    margin-bottom: 1rem;
}

.error-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.error-content p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.error-solutions {
    text-align: left;
    background: var(--bg-input);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.error-solutions h4 {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.error-solutions ol {
    margin-left: 1rem;
}

.error-solutions li {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.error-solutions pre {
    background: var(--text-primary);
    color: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    overflow-x: auto;
    margin: 0.5rem 0;
    font-family: 'Courier New', monospace;
}

.error-solutions code {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.retry-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin: 0 auto;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.retry-btn:active {
    transform: translateY(0);
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .header-content {
        padding: 0 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .logo {
        flex: 1;
        min-width: 0;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .header-actions {
        gap: 0.75rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    /* Make buttons smaller on mobile */
    .refresh-btn, .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Hide text on mobile, keep only icons */
    .refresh-btn span, .nav-btn span {
        display: none;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
        padding: 0.5rem;
    }
    
    /* Hide status indicator on small screens */
    .status-indicator {
        display: none;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .activity-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    /* Header optimizations for very small screens */
    .header-content {
        gap: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    /* Ultra compact buttons */
    .refresh-btn, .nav-btn {
        padding: 0.375rem;
        min-width: 36px;
        border-radius: 8px;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
        padding: 0.375rem;
    }
    
    /* Ultra compact status indicator */
    .status-indicator {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .status-indicator span:last-child {
        display: none; /* Hide "Connected" text on very small screens */
    }
    
    /* Hide connected widget completely on very small screens */
    .status-indicator {
        display: none;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .stat-content {
        width: 100%;
    }
    
    .chart-wrapper {
        height: 250px;
    }
    
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .calendar-view {
        flex-direction: column;
        height: auto;
    }
    
    .calendar-container {
        flex: none;
    }
    
    .day-details-panel {
        flex: none;
        min-height: 300px;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 0.5rem 0.25rem;
    }
    
    .calendar-day-indicator {
        font-size: 0.5rem;
        padding: 0.125rem 0.25rem;
    }
}

/* About Page Styles */
.about-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.about-hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 0;
}

.hero-icon {
    font-size: 4rem;
    color: var(--accent-heart);
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.about-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

/* Dark theme override for better visibility */
[data-theme="dark"] .about-hero h1 {
    color: #f7fafc;
    background: none;
    -webkit-text-fill-color: initial;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.about-sections {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.about-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px var(--shadow-light);
    backdrop-filter: var(--backdrop-blur);
    transition: all 0.3s ease;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

.section-header i {
    font-size: 1.5rem;
    color: #667eea;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.feature-item h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

.app-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.performance-profiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.profile-card {
    background: var(--bg-card-hover);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-light);
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.profile-card.high-performance {
    border-left-color: #27ae60;
}

.profile-card.normal {
    border-left-color: #3498db;
}

.profile-card.low-power {
    border-left-color: #f39c12;
}

.profile-card.battery-saver {
    border-left-color: #e74c3c;
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.profile-header i {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.profile-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.battery-indicator {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    color: #667eea;
    font-weight: 500;
}

.profile-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.profile-card li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.profile-card li:last-child {
    border-bottom: none;
}

.sensor-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.sensor-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
}

.sensor-item i {
    font-size: 1.5rem;
    color: #667eea;
    width: 30px;
    text-align: center;
}

.sensor-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.sensor-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.app-screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.screenshot-item {
    text-align: center;
    background: var(--bg-card-hover);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-light);
    transition: transform 0.3s ease;
}

.screenshot-item:hover {
    transform: translateY(-5px);
}

.watch-screenshot {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 1rem;
    box-shadow: 0 8px 25px var(--shadow-medium);
    border: 4px solid #667eea;
}

.screenshot-caption h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.screenshot-caption p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.api-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.api-feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
}

.api-feature i {
    font-size: 1.5rem;
    color: #667eea;
    width: 30px;
    text-align: center;
}

.api-feature h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.api-feature p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.workflow-steps {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 2rem;
}

.workflow-step {
    flex: 1;
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 15px;
    position: relative;
}

.workflow-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -1rem;
    width: 2rem;
    height: 2px;
    background: linear-gradient(to right, #667eea, transparent);
    transform: translateY(-50%);
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.step-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

.privacy-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.privacy-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
}

.privacy-item i {
    font-size: 1.5rem;
    color: #27ae60;
    width: 30px;
    text-align: center;
}

.privacy-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.privacy-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.endpoint-list {
    margin-top: 2rem;
}

.endpoint-group {
    margin-bottom: 2rem;
}

.endpoint-group h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.endpoint {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg-input);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.method {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
}

.method.get {
    background: #27ae60;
    color: white;
}

.method.post {
    background: #3498db;
    color: white;
}

.method.delete {
    background: #e74c3c;
    color: white;
}

.path {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--border-subtle);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.architecture-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 15px;
}

.arch-layer {
    text-align: center;
    width: 100%;
    max-width: 500px;
}

.arch-layer h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.arch-components {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.arch-component {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-card-hover);
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow-light);
    min-width: 120px;
}

.arch-component i {
    font-size: 1.5rem;
    color: #667eea;
}

.arch-component span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.arch-arrow {
    font-size: 1.5rem;
    color: #667eea;
    margin: 0.5rem 0;
}

.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tech-category h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.code-block {
    background: var(--text-primary);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    color: var(--bg-card);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card-hover);
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-light);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.link-card i {
    font-size: 2rem;
    color: #667eea;
}

.link-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.link-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Responsive Design for About Page */
@media (max-width: 768px) {
    .about-content {
        padding: 1rem;
    }
    
    .about-hero {
        padding: 2rem 0;
        margin-bottom: 2rem;
    }
    
    .about-hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .about-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        text-align: left;
        margin-bottom: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .app-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .performance-profiles {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sensor-list {
        gap: 0.75rem;
    }
    
    .sensor-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 1rem;
    }
    
    .arch-components {
        flex-direction: column;
        gap: 1rem;
    }
    
    .tech-stack {
        grid-template-columns: 1fr;
    }
    
    .endpoint {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .app-screenshots {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .watch-screenshot {
        width: 150px;
        height: 150px;
    }
    
    .workflow-steps {
        flex-direction: column;
        gap: 1rem;
    }
    
    .workflow-step:not(:last-child)::after {
        display: none;
    }
    
    .privacy-features {
        gap: 1rem;
    }
    
    .privacy-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 1rem;
    }
    
    .api-features {
        gap: 1rem;
    }
    
    .api-feature {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 1rem;
    }
    
    /* About page header optimizations */
    .about-content .header-actions {
        gap: 0.5rem;
    }
    
    .about-content .nav-btn span {
        display: none;
    }
    
    .about-content .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .about-hero {
        padding: 1.5rem 0;
    }
    
    .about-hero h1 {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .about-section {
        padding: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.3rem;
    }
    
    .feature-item {
        padding: 1rem;
    }
    
    .feature-item i {
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .watch-screenshot {
        width: 120px;
        height: 120px;
    }
    
    .code-block {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    .workflow-step {
        padding: 1.5rem 1rem;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    /* About page header ultra-compact */
    .about-content .nav-btn {
        padding: 0.375rem;
        min-width: 36px;
        border-radius: 8px;
    }
}