html {
    background-color: #764ba2;
}
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;  /* NEW - makes sidebar and content sit side-by-side */
    padding-bottom: env(safe-area-insert-bottom);
}

/* Sidebar Navigation */
.sidebar {
    width: 120px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;  /* ADD THIS - vertically centers items */
    padding: 20px 0;
    gap: 10px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.nav-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-left: 3px solid white;
}

.nav-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.nav-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

/* Main Content Area */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* View Switching */
.view {
    display: none;
}

.view.active {
    display: block;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 10px;
}

.tagline {
    color: #666;
    font-size: 1.1rem;
}

/* Mobile Responsive Fixes */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    .nav-item {
        width: 29%;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .nav-item.active {
        border-left: none;
        border-bottom: 3px solid white;
    }

    .habit-input-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    /* Make Clock canvas scale down on mobile */
    #clockCanvas {
        width: 85vw !important;  /* 85% of viewport width */
        height: 85vw !important;  /* Square aspect ratio */
    }
    
    /* Make containers fit mobile screens */
    .container {
        max-width: 95vw;
        padding: 20px;
    }
    
    /* Stack data controls vertically on mobile */
    #dataControls {
        left: 10px;
        flex-direction: column;
        width: auto;
    }
    
    /* Make settings panel full width on mobile */
    #settingsPanel {
        width: 100vw;
        right: -100vw;
    }
    
    #settingsPanel.open {
        right: 0;
    }
}