   /* Main App Styles */
:root {
    --primary-color: #2AABEE;
    --secondary-color: #229ED9;
    --text-color: #333;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --header-height: 60px;
    --footer-height: 60px;
    --screen-padding: 15px;
    --anim-speed: 0.3s;
    --energy-color: #4CAF50;
    --error-color: #f44336;
}

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

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Container */
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    overflow-x: hidden;
    height: 100vh;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity var(--anim-speed) ease;
}

.spinner {
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-status {
    text-align: center;
    margin-top: 15px;
    color: var(--text-color);
    font-size: 14px;
    max-width: 80%;
}

.loading-error {
    margin-top: 20px;
    padding: 10px 15px;
    background-color: var(--error-color);
    color: white;
    border-radius: 4px;
    font-size: 14px;
    max-width: 80%;
    text-align: center;
    display: none;
}

.loading-button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.loading-button:hover {
    background-color: var(--secondary-color);
}

/* Application Container */
#app {
    display: none;
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Screens */
.screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - var(--footer-height));
    padding: var(--screen-padding);
    overflow-y: auto;
    transition: transform var(--anim-speed) ease;
    transform: translateX(100%);
    background-color: var(--bg-color);
}

.screen.active {
    display: block;
    transform: translateX(0);
}

/* Navigation */
.nav-container {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: var(--footer-height);
    background-color: var(--card-bg);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.nav-tabs {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    color: var(--text-color);
    height: 100%;
    transition: all 0.2s;
    font-size: 12px;
}

.nav-tab.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

/* Energy Bar */
.energy-container {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.energy-title {
    font-weight: bold;
}

.energy-bar {
    height: 15px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.energy-fill {
    height: 100%;
    background-color: var(--energy-color);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Tap Button */
.tap-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
}

.tap-button {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tap-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-value {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #777;
}

/* Debug Panel */
#debug-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 10000;
    font-weight: bold;
    cursor: pointer;
}

#debug-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    z-index: 9999;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    overflow-y: auto;
    display: none;
}

#debug-content {
    max-height: calc(100% - 40px);
    overflow-y: auto;
}

.debug-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.debug-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    margin-left: 5px;
    cursor: pointer;
    font-size: 12px;
}

/* Emergency App (When main app fails) */
#emergency-app {
    padding: 20px;
    text-align: center;
    display: none;
}

#emergency-app h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

#emergency-app p {
    margin-bottom: 15px;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tap-button {
        width: 130px;
        height: 130px;
        font-size: 20px;
    }
}

/* Common Elements */
.btn {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: var(--secondary-color);
}

.card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Login Screen */
#login-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--bg-color);
    padding: 20px;
    text-align: center;
}

.login-container {
    max-width: 400px;
    width: 100%;
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
}

.login-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.login-button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 20px;
}

.login-button:hover {
    background-color: var(--secondary-color);
}

.login-help {
    margin-top: 20px;
    font-size: 14px;
    color: #777;
} 