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

body {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background: #0a0a0f;
    color: #e0e0e0;
    min-height: 100vh;
    overflow: hidden;
}

#container { position: relative; width: 100vw; height: 100vh; }

/* ========== CANVAS ========== */
#garden-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    z-index: 1;
}

/* ========== TRACKER PANEL ========== */
#ui-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 360px;
    height: 100vh;
    z-index: 50;
    background: linear-gradient(90deg, rgba(10,10,15,0.98) 0%, rgba(10,10,15,0.90) 100%);
    border-right: 2px solid #2a2a3a;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

#ui-overlay.hidden {
    transform: translateX(-360px);
}

/* ========== TAB BUTTON ========== */
#toggle-tab {
    position: fixed;
    top: 25%;
    left: 360px;
    transform: translateY(-50%);
    width: 50px;
    height: 62px;
    background: rgba(10,10,15,0.95);
    border: 2px solid #2a2a3a;
    border-left: none;
    border-radius: 0 14px 14px 0;
    color: #4ade80;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 16px rgba(0,0,0,0.5);
    z-index: 200;
}

#toggle-tab.panel-hidden {
    left: 0px;
}

#toggle-tab:hover {
    background: #4ade80;
    color: #000;
}

/* ========== CONTENT ========== */
.tracker-content {
    padding: 15px 20px 15px 20px;
    height: 100%;
    max-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

header { text-align: center; padding: 5px 0; }

h1 {
    font-size: 1.4em;
    background: linear-gradient(135deg, #4ade80, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 3px;
}

.tagline { color: #888; font-size: 0.9em; font-style: italic; }

/* ========== COUNTER ========== */
.water-counter { text-align: center; }

.glasses-display {
    font-size: 3em;
    font-weight: bold;
    color: #4ade80;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
}

.separator { color: #888; font-size: 0.5em; }
.percentage { font-size: 1.2em; color: #00ff88; margin-top: 8px; }

/* ========== PROGRESS BAR ========== */
.progress-container {
    width: 100%; height: 16px;
    background: #2a2a3a;
    border-radius: 8px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #00ff88);
    border-radius: 8px;
    width: 0%;
    transition: width 0.5s ease;
}

/* ========== PANEL BOX ========== */
#tracker-panel {
    background: rgba(18, 18, 26, 0.6);
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 12px;
    margin: 8px 0;
}

/* ========== PLANT STAGE ========== */
.plant-stage {
    text-align: center;
    padding: 8px;
    background: rgba(18, 18, 26, 0.6);
    border-radius: 12px;
    margin: 8px 0;
}

.stage-emoji {
    font-size: 3.5em;
    animation: grow 0.5s ease;
}

@keyframes grow {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.stage-label { font-size: 1em; color: #888; margin-top: 8px; font-style: italic; }

/* ========== CONTROLS ========== */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 8px;
    margin: 8px 0;
}

.btn {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.btn:hover { transform: scale(1.1); }
.btn:active { transform: scale(0.95); }
.btn-remove { background: #2a2a3a; color: #e0e0e0; }
.btn-add {
    background: linear-gradient(135deg, #4ade80, #00ff88);
    color: #000;
    width: 160px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: bold;
}
.btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ========== STATS ========== */
.stats {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: rgba(18, 18, 26, 0.6);
    border-radius: 12px;
    margin: 8px 0;
}

.stat { text-align: center; }
.stat-value { font-size: 1.5em; font-weight: bold; color: #ffaa00; }
.stat-label { font-size: 0.75em; color: #888; margin-top: 4px; }

/* ========== INFO ========== */
.info {
    text-align: center;
    padding: 10px;
    background: rgba(0,255,136,0.05);
    border-left: 3px solid #4ade80;
    border-radius: 8px;
    margin: 8px 0;
}
.info p { color: #888; font-size: 0.85em; margin: 4px 0; }

/* ========== AUTH ========== */
#auth-container { padding: 0 5px; }
footer { text-align: center; padding: 15px; color: #666; font-size: 0.8em; margin-top: auto; }

/* ========== MOBILE ========== */
@media (max-width: 768px) {
    #ui-overlay { width: 85vw; max-width: 340px; }
    #ui-overlay.hidden { transform: translateX(-85vw); }
    #toggle-tab { right: -46px; width: 46px; height: 56px; font-size: 1.3em; }
    h1 { font-size: 1.5em; }
    .glasses-display { font-size: 2.5em; }
    .stage-emoji { font-size: 4em; }
    .btn { width: 50px; height: 50px; font-size: 1.5em; }
    .btn-add { width: 140px; font-size: 1em; }
}

/* ========== MOBILE PORTRAIT: Fullscreen Tracker, no desert ========== */
@media (max-width: 768px) and (orientation: portrait) {
    #ui-overlay { width: 100vw; max-width: 100vw; }
    #ui-overlay.hidden { transform: translateX(-100vw); }
    #toggle-tab { display: none; }
    #garden-canvas { display: none; }
}

/* ========== MOBILE LANDSCAPE: Only desert, no tracker ========== */
@media (max-width: 900px) and (orientation: landscape) {
    #ui-overlay { display: none; }
    #toggle-tab { display: none; }
    #garden-canvas { display: block; }
}
