:root {
    --primary-color: #4facfe;
    --primary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --secondary-color: #a6c0fe;
    --background-color: #f0f8ff;
    --glass-bg: #e1f5fe;
    --glass-border: #81d4fa;
    --text-main: #2c3e50;
    --text-secondary: #546e7a;
    --white: #ffffff;
    --shadow-soft: 0 10px 30px -10px rgba(79, 172, 254, 0.4);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background-color);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
    /* App-like feel */
}

#app {
    width: 100%;
    max-width: 480px;
    /* Mobile constraints */
    height: 100%;
    background: var(--white);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-card);
}

/* Header */
.app-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    z-index: 10;
}

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

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: var(--glass-bg);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    /* Distribute vertical space */
    padding: 20px;
}

/* Water Glass Visualization */
.water-progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.water-glass {
    width: 140px;
    height: 200px;
    background: var(--glass-bg);
    border: 3px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
    /* Glass effect */
    box-shadow: inset 0 -10px 20px rgba(79, 172, 254, 0.2), 0 10px 20px rgba(79, 172, 254, 0.1);
}

.water-level {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    /* Dynamic */
    background: var(--primary-gradient);
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bubbles/Wave effect (Optional simplified CSS for performance) */
.water-level::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 200%;
    height: 20px;
    background: inherit;
    border-radius: 50%;
    opacity: 0.5;
    animation: wave 4s linear infinite;
}

@keyframes wave {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.progress-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.glass-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: #f1f5f9;
    padding: 6px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.status-arrow.up {
    color: #22c55e;
    /* Green */
}

.status-arrow.down {
    color: #ef4444;
    /* Red */
}

/* Drink Button */
.drink-btn {
    position: relative;
    width: 100%;
    max-width: 280px;
    padding: 18px;
    border: none;
    border-radius: 16px;
    background: var(--primary-gradient);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s, box-shadow 0.2s;
}

.drink-btn:active {
    transform: scale(0.98);
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

/* Modal */
.modal {
    margin: auto;
    padding: 0;
    border: none;
    background: transparent;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    backdrop-filter: blur(5px);
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background: var(--white);
    width: 90%;
    max-width: 400px;
    margin: 100px auto;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.icon-btn-small {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.time-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-input {
    flex: 1;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-group input {
    width: 20px;
    height: 20px;
}

.checkbox-group label {
    margin: 0;
    font-weight: 400;
}

.text-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: auto;
    /* Push to right */
    padding: 4px 8px;
    border-radius: 4px;
}

.text-btn:hover {
    background: var(--glass-bg);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.save-btn {
    flex: 2;
    padding: 14px;
    background: var(--text-main);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.reset-btn {
    flex: 1;
    padding: 14px;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.reset-btn:hover {
    background: #fecaca;
}