* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: #f5f5f5;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #332e94 0%, #5A52D5 100%);
    color: white;
    padding: 30px 20px 20px 20px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.language-selector {
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.language-selector:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.language-selector option {
    background: #6C63FF;
    color: white;
}

.date {
    font-size: 14px;
    opacity: 0.95;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 0;
    padding: 0 20px;
    background: linear-gradient(135deg, #6C63FF 0%, #5A52D5 100%);
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 12px 12px 0 0;
}

.tab-btn.active {
    background: #f5f5f5;
    color: #6C63FF;
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.date-display {
    background: white;
    margin: 20px 20px 0 20px;
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #6C63FF;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.modal-description {
    font-size: 13px;
    color: #666;
    margin: -10px 0 15px 0;
    text-align: center;
}

.frequency-select {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 20px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.frequency-select:focus {
    outline: none;
    border-color: #6C63FF;
}

.progress-section {
    background: white;
    margin: 0 20px 20px 20px;
    padding: 20px;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#todos-tab .progress-section {
    margin: 20px 20px;
    border-radius: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

#progressCount {
    color: #6C63FF;
    font-weight: 700;
}

.progress-bar {
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6C63FF 0%, #5A52D5 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

.habits-list {
    padding: 0 20px;
}

.habit-card {
    background: white;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.habit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.habit-card:active {
    transform: translateY(0);
}

.checkbox {
    width: 32px;
    height: 32px;
    border: 3px solid #ddd;
    border-radius: 50%;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox.checked {
    background: #4CAF50;
    border-color: #4CAF50;
}

.checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.habit-icon {
    width: 36px;
    height: 36px;
    margin-right: 16px;
    flex-shrink: 0;
}

.habit-icon svg {
    width: 100%;
    height: 100%;
}

.habit-info {
    flex: 1;
}

.habit-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.habit-name.completed {
    color: #999;
    text-decoration: line-through;
}

.habit-streak {
    font-size: 13px;
    color: #666;
}

.delete-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.delete-btn:hover {
    color: #f44336;
}

.add-btn {
    background: linear-gradient(135deg, #6C63FF 0%, #5A52D5 100%);
    color: white;
    border: none;
    padding: 18px;
    margin: 20px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: calc(100% - 40px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 99, 255, 0.4);
}

.add-btn:active {
    transform: translateY(0);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

#habitInput {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

#habitInput:focus {
    outline: none;
    border-color: #6C63FF;
}

.icon-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.icon-option {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px;
}

.icon-option svg {
    width: 100%;
    height: 100%;
}

.icon-option:hover {
    border-color: #6C63FF;
    transform: scale(1.1);
}

.icon-option.selected {
    border-color: #6C63FF;
    background: #f0edff;
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-save {
    background: linear-gradient(135deg, #6C63FF 0%, #5A52D5 100%);
    color: white;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.btn-save:active {
    transform: translateY(0);
}

/* Mood Tracker Styles */
.mood-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mood-header h2 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.mood-range-select {
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.mood-range-select:hover {
    border-color: #6C63FF;
}

.mood-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

.mood-btn {
    padding: 20px 10px;
    border: 3px solid #e0e0e0;
    border-radius: 16px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.mood-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.mood-horrible { border-color: #D32F2F; color: #D32F2F; }
.mood-horrible:hover { background: #FFEBEE; }

.mood-bad { border-color: #F57C00; color: #F57C00; }
.mood-bad:hover { background: #FFF3E0; }

.mood-neutral { border-color: #FBC02D; color: #FBC02D; }
.mood-neutral:hover { background: #FFFDE7; }

.mood-good { border-color: #7CB342; color: #7CB342; }
.mood-good:hover { background: #F1F8E9; }

.mood-awesome { border-color: #0288D1; color: #0288D1; }
.mood-awesome:hover { background: #E1F5FE; }

/* Jar Container */
.jar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.jar {
    position: relative;
    width: 280px;
    perspective: 1000px;
}

.jar-neck {
    width: 100px;
    height: 30px;
    margin: 0 auto;
    background: linear-gradient(to bottom, rgba(200, 230, 255, 0.4), rgba(200, 230, 255, 0.6));
    border: 3px solid rgba(100, 150, 200, 0.5);
    border-bottom: none;
    border-radius: 15px 15px 0 0;
    box-shadow: inset 0 -5px 10px rgba(255, 255, 255, 0.5);
}

.jar-body {
    position: relative;
    width: 280px;
    height: 350px;
    background: linear-gradient(135deg, rgba(200, 230, 255, 0.3), rgba(220, 240, 255, 0.5));
    border: 4px solid rgba(100, 150, 200, 0.6);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        inset 10px 10px 30px rgba(255, 255, 255, 0.5),
        inset -10px -10px 30px rgba(0, 0, 0, 0.05),
        0 10px 30px rgba(0, 0, 0, 0.1);
}

.jar-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    width: 40%;
    height: 100%;
    background: linear-gradient(to right, 
        transparent, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent);
    pointer-events: none;
}

.jar-emojis {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-content: flex-end;
    padding: 15px;
    gap: 8px;
    min-height: 100%;
}

.mood-emoji {
    font-size: 32px;
    animation: dropIn 0.6s ease-out;
    cursor: pointer;
    transition: transform 0.2s;
}

.mood-emoji:hover {
    transform: scale(1.3);
}

@keyframes dropIn {
    0% {
        transform: translateY(-400px) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(0) rotate(360deg);
        opacity: 1;
    }
}

.jar-label {
    margin-top: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #6C63FF;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.category-btn {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-btn:hover {
    border-color: #6C63FF;
    background: #f5f4ff;
}

.category-btn.selected {
    border-color: #6C63FF;
    background: #6C63FF;
    color: white;
}

#customCategory {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
}

#customCategory:focus {
    outline: none;
    border-color: #6C63FF;
}

/* Mood Statistics */
.mood-statistics {
    margin-top: 40px;
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mood-statistics h3 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #333;
    text-align: center;
}

.stats-section {
    margin-bottom: 25px;
}

.stats-section:last-child {
    margin-bottom: 0;
}

.stats-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #666;
    font-weight: 600;
}

.mood-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.mood-stat {
    text-align: center;
    padding: 15px;
    border-radius: 12px;
    background: #f5f5f5;
    transition: all 0.3s;
}

.mood-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.mood-stat-emoji {
    font-size: 28px;
    margin-bottom: 5px;
}

.mood-stat-count {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.mood-stat-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
}

.mood-stat-horrible .mood-stat-count { color: #D32F2F; }
.mood-stat-bad .mood-stat-count { color: #F57C00; }
.mood-stat-neutral .mood-stat-count { color: #FBC02D; }
.mood-stat-good .mood-stat-count { color: #7CB342; }
.mood-stat-awesome .mood-stat-count { color: #0288D1; }

.category-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.category-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
    border-left: 4px solid #6C63FF;
    transition: all 0.3s;
    cursor: pointer;
}

.category-stat:hover {
    transform: translateX(4px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #f0f0ff 0%, #e8e8ff 100%);
}

.category-stat-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.category-stat-count {
    font-size: 18px;
    font-weight: 700;
    color: #6C63FF;
}

/* Category Detail Modal */
.category-mood-breakdown {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.category-mood-item {
    text-align: center;
    padding: 15px 10px;
    border-radius: 12px;
    background: #f5f5f5;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.category-mood-item-horrible { 
    background: #FFEBEE; 
    border-color: #D32F2F;
}

.category-mood-item-bad { 
    background: #FFF3E0; 
    border-color: #F57C00;
}

.category-mood-item-neutral { 
    background: #FFFDE7; 
    border-color: #FBC02D;
}

.category-mood-item-good { 
    background: #F1F8E9; 
    border-color: #7CB342;
}

.category-mood-item-awesome { 
    background: #E1F5FE; 
    border-color: #0288D1;
}

.category-mood-emoji {
    font-size: 32px;
    margin-bottom: 8px;
}

.category-mood-count {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.category-mood-item-horrible .category-mood-count { color: #D32F2F; }
.category-mood-item-bad .category-mood-count { color: #F57C00; }
.category-mood-item-neutral .category-mood-count { color: #FBC02D; }
.category-mood-item-good .category-mood-count { color: #7CB342; }
.category-mood-item-awesome .category-mood-count { color: #0288D1; }

.category-mood-label {
    font-size: 12px;
    color: #666;
    text-transform: capitalize;
}

/* Modern UI/UX Refresh */
:root {
    --bg: #f3f5ff;
    --bg-soft: #eef2ff;
    --surface: #ffffff;
    --surface-soft: #f8faff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --primary: #4338ca;
    --primary-2: #5b21b6;
    --border: #e5e7eb;
    --ring: rgba(67, 56, 202, 0.2);
    --shadow-sm: 0 4px 12px rgba(49, 46, 129, 0.12);
    --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.15);
}

body {
    background:
        radial-gradient(circle at 10% 10%, #e7ecff 0%, transparent 35%),
        radial-gradient(circle at 90% 0%, #ece9ff 0%, transparent 30%),
        var(--bg);
    color: var(--text);
}

.container {
    max-width: 860px;
    background: transparent;
    padding-bottom: 26px;
}

.header {
    margin: 14px 14px 0;
    border-radius: 26px;
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #312e81 0%, #4c1d95 100%);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(10, 10, 35, 0.35);
    flex-shrink: 0;
}

.app-logo svg {
    width: 100%;
    height: 100%;
    display: block;
}

.header h1 {
    font-size: 30px;
    letter-spacing: 0.2px;
    margin: 0;
}

.language-selector {
    border-color: rgba(255, 255, 255, 0.45);
    border-radius: 12px;
    backdrop-filter: blur(8px);
}

.tab-nav {
    margin: -8px 14px 0;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    gap: 8px;
}

.tab-btn {
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    padding: 12px 14px;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(67, 56, 202, 0.34);
}

.tab-btn:hover:not(.active) {
    background: #f3f4f6;
    color: #374151;
}

.date-display,
.progress-section,
.habit-card,
.mood-statistics,
.modal-content {
    border: 1px solid rgba(99, 102, 241, 0.08);
}

.date-display {
    margin: 22px 14px 0;
    border-radius: 18px 18px 0 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

.progress-section {
    margin: 0 14px 16px;
    border-radius: 0 0 18px 18px;
    box-shadow: var(--shadow-sm);
}

#todos-tab .progress-section {
    margin: 20px 14px;
    border-radius: 18px;
}

.progress-bar {
    height: 10px;
    background: #eceff7;
}

.progress-fill {
    background: linear-gradient(90deg, #4338ca 0%, #5b21b6 100%);
}

.habits-list {
    padding: 0 14px;
}

.habit-card {
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    background: linear-gradient(180deg, #ffffff 0%, #fcfcff 100%);
}

.habit-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.checkbox {
    width: 30px;
    height: 30px;
    border: 2px solid #c7cedf;
}

.checkbox.checked {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: #16a34a;
}

.habit-name {
    font-weight: 650;
}

.habit-streak {
    color: var(--text-muted);
}

.delete-btn {
    width: 34px;
    height: 34px;
    font-size: 28px;
    border-radius: 10px;
}

.delete-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.add-btn {
    width: calc(100% - 28px);
    margin: 16px 14px;
    border-radius: 16px;
    padding: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    background: linear-gradient(135deg, #312e81 0%, #4c1d95 100%);
    box-shadow: 0 12px 22px rgba(49, 46, 129, 0.36);
}

.add-btn:hover {
    transform: translateY(-3px);
}

.modal {
    backdrop-filter: blur(5px);
}

.modal-content {
    border-radius: 24px;
    padding: 26px;
    box-shadow: var(--shadow-lg);
}

.modal-content h2 {
    color: #111827;
    font-size: 26px;
    margin-bottom: 16px;
}

#habitInput,
#todoInput,
#customCategory,
.frequency-select,
.mood-range-select {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

#habitInput:focus,
#todoInput:focus,
#customCategory:focus,
.frequency-select:focus,
.mood-range-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--ring);
    background: #fff;
}

.icon-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.icon-option {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.icon-option:hover {
    transform: translateY(-2px);
}

.icon-option.selected {
    background: #eef2ff;
    border-color: var(--primary);
}

.btn {
    border-radius: 12px;
    font-weight: 700;
}

.btn-cancel {
    background: #f3f4f6;
    color: #4b5563;
}

.btn-save {
    background: linear-gradient(135deg, #4338ca 0%, #5b21b6 100%);
}

.mood-header,
.mood-buttons,
.jar-container,
.mood-statistics {
    margin-left: 14px;
    margin-right: 14px;
}

.mood-header {
    margin-top: 20px;
    margin-bottom: 14px;
}

.mood-header h2 {
    font-size: 26px;
    color: #111827;
}

.mood-buttons {
    gap: 10px;
    margin-bottom: 22px;
}

.mood-btn {
    padding: 16px 8px;
    border-width: 2px;
    border-radius: 14px;
    background: #fff;
}

.mood-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.jar-container {
    padding: 6px 0 12px;
}

.jar {
    transform: translateZ(0);
}

.jar-body {
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(236, 245, 255, 0.65), rgba(226, 236, 255, 0.75));
}

.jar-label {
    color: #3730a3;
    font-weight: 700;
}

.mood-statistics {
    margin-top: 22px;
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    background: rgba(255, 255, 255, 0.95);
}

.mood-stat {
    border-radius: 12px;
    background: #f8faff;
    border: 1px solid #edf1f9;
}

.category-stat {
    border-left-width: 3px;
    border-radius: 12px;
    background: #f8faff;
    border: 1px solid #edf1f9;
}

.category-stat:hover {
    transform: translateY(-2px);
}

.category-buttons {
    gap: 8px;
}

.category-btn {
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 600;
}

.category-btn.selected {
    background: linear-gradient(135deg, #4338ca 0%, #5b21b6 100%);
    border-color: transparent;
}

.category-mood-breakdown {
    gap: 10px;
}

.category-mood-item {
    border-radius: 14px;
}

@media (max-width: 768px) {
    .container {
        max-width: 100%;
    }

    .header {
        margin: 8px 10px 0;
        border-radius: 20px;
        padding: 22px 14px 16px;
    }

    .header h1 {
        font-size: 24px;
    }

    .language-selector {
        font-size: 13px;
        padding: 7px 10px;
    }

    .tab-nav {
        margin: -6px 10px 0;
        padding: 6px;
    }

    .tab-btn {
        font-size: 13px;
        padding: 10px 8px;
    }

    .date-display,
    .progress-section,
    #todos-tab .progress-section,
    .habits-list,
    .mood-header,
    .mood-buttons,
    .jar-container,
    .mood-statistics,
    .add-btn {
        margin-left: 10px;
        margin-right: 10px;
    }

    .habits-list {
        padding: 0 10px;
    }

    .add-btn {
        width: calc(100% - 20px);
    }

    .mood-buttons {
        grid-template-columns: repeat(3, 1fr);
    }

    .mood-stats,
    .category-mood-breakdown {
        grid-template-columns: repeat(3, 1fr);
    }

    .jar,
    .jar-body {
        width: 240px;
    }

    .jar-body {
        height: 300px;
    }

    .icon-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 480px) {
    .app-logo {
        width: 38px;
        height: 38px;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .mood-buttons,
    .mood-stats,
    .category-mood-breakdown,
    .category-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .icon-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .modal-content {
        width: calc(100% - 20px);
        padding: 20px;
    }
}

/* Luxury Dark Theme + Motion */
:root {
    --bg: #090b14;
    --bg-soft: #0f1220;
    --surface: #111526;
    --surface-soft: #151a2e;
    --text: #e5e7eb;
    --text-muted: #a4acc2;
    --primary: #6d5efc;
    --primary-2: #8c52ff;
    --border: #222945;
    --ring: rgba(109, 94, 252, 0.26);
    --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 26px 56px rgba(0, 0, 0, 0.58);
}

body {
    background:
        radial-gradient(circle at 12% 10%, rgba(83, 68, 208, 0.16), transparent 32%),
        radial-gradient(circle at 88% 0%, rgba(140, 82, 255, 0.12), transparent 35%),
        var(--bg);
    color: var(--text);
}

.header {
    background: linear-gradient(135deg, #161b31 0%, #221344 60%, #2a1554 100%);
    border: 1px solid #2b3150;
    box-shadow: var(--shadow-md);
}

.tab-nav {
    background: rgba(18, 23, 40, 0.88);
    border: 1px solid #2a3150;
}

.tab-btn {
    color: #aab1c8;
}

.tab-btn.active {
    background: linear-gradient(135deg, #5e4df4 0%, #7b3ff2 100%);
    box-shadow: 0 10px 24px rgba(86, 71, 221, 0.45);
}

.tab-btn:hover:not(.active) {
    background: #1a2038;
    color: #f3f4f6;
}

.date-display,
.progress-section,
.habit-card,
.mood-statistics,
.modal-content {
    background: linear-gradient(180deg, #12182b 0%, #101427 100%);
    border: 1px solid #27304e;
    box-shadow: var(--shadow-sm);
}

.progress-header,
.mood-header h2,
.stats-section h4,
.modal-content h2,
.category-stat-name,
.habit-name {
    color: var(--text);
}

.date-display,
.habit-streak,
.mood-stat-label,
.category-mood-label,
.icon-label,
.modal-description,
.date {
    color: var(--text-muted);
}

.progress-bar {
    background: #1c2238;
}

.progress-fill {
    position: relative;
    background: linear-gradient(90deg, #5e4df4 0%, #8c52ff 100%);
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.26) 45%, transparent 70%);
    transform: translateX(-120%);
    animation: shimmer 2.6s infinite;
}

.habit-card {
    background: linear-gradient(180deg, #151b30 0%, #11172a 100%);
    animation: cardEnter 0.45s ease both;
}

.habit-card:hover {
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
    border-color: #39426a;
}

.checkbox {
    border-color: #445077;
    background: #12182a;
}

.checkbox.checked {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.delete-btn {
    color: #98a2c6;
}

.delete-btn:hover {
    background: rgba(220, 38, 38, 0.15);
}

.add-btn,
.btn-save {
    background: linear-gradient(135deg, #4d3deb 0%, #7b3ff2 100%);
    box-shadow: 0 14px 26px rgba(77, 61, 235, 0.42);
}

.add-btn:hover,
.btn-save:hover {
    box-shadow: 0 18px 32px rgba(77, 61, 235, 0.5);
}

.btn-cancel {
    background: #1c2238;
    color: #c3c9db;
}

#habitInput,
#todoInput,
#customCategory,
.frequency-select,
.mood-range-select {
    background: #0f1427;
    border-color: #2a3150;
    color: #e5e7eb;
}

#habitInput::placeholder,
#todoInput::placeholder,
#customCategory::placeholder {
    color: #7d86a4;
}

.icon-option,
.category-btn,
.mood-btn,
.mood-stat,
.category-stat,
.category-mood-item {
    background: #141a2e;
    border-color: #2b3354;
    color: #d7dbeb;
}

.icon-option:hover,
.category-btn:hover,
.mood-btn:hover,
.mood-stat:hover,
.category-stat:hover {
    border-color: #4c5786;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.42);
}

.icon-option.selected,
.category-btn.selected {
    background: linear-gradient(135deg, rgba(94, 77, 244, 0.28), rgba(140, 82, 255, 0.3));
    border-color: #6e61fc;
}

.mood-btn {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.mood-horrible { border-color: #ef4444; color: #fca5a5; }
.mood-horrible:hover { background: rgba(239, 68, 68, 0.14); }

.mood-bad { border-color: #f97316; color: #fdba74; }
.mood-bad:hover { background: rgba(249, 115, 22, 0.14); }

.mood-neutral { border-color: #eab308; color: #fde047; }
.mood-neutral:hover { background: rgba(234, 179, 8, 0.14); }

.mood-good { border-color: #84cc16; color: #bef264; }
.mood-good:hover { background: rgba(132, 204, 22, 0.14); }

.mood-awesome { border-color: #38bdf8; color: #7dd3fc; }
.mood-awesome:hover { background: rgba(56, 189, 248, 0.14); }

.jar-neck {
    background: linear-gradient(to bottom, rgba(85, 111, 190, 0.35), rgba(85, 111, 190, 0.55));
    border-color: rgba(102, 131, 210, 0.7);
}

.jar-body {
    background: linear-gradient(180deg, rgba(44, 58, 99, 0.4), rgba(31, 42, 76, 0.5));
    border-color: rgba(103, 126, 194, 0.72);
}

.jar-label {
    color: #b9b2ff;
}

.mood-statistics {
    background: linear-gradient(180deg, #11172a 0%, #0f1426 100%);
}

.category-stat-count,
#progressCount,
#todoProgressCount {
    color: #b9b2ff;
}

.category-mood-item-horrible { background: rgba(127, 29, 29, 0.3); border-color: #ef4444; }
.category-mood-item-bad { background: rgba(124, 45, 18, 0.28); border-color: #f97316; }
.category-mood-item-neutral { background: rgba(113, 63, 18, 0.28); border-color: #eab308; }
.category-mood-item-good { background: rgba(54, 83, 20, 0.28); border-color: #84cc16; }
.category-mood-item-awesome { background: rgba(7, 89, 133, 0.3); border-color: #38bdf8; }

.category-mood-count {
    color: #e5e7eb;
}

.tab-content.active {
    animation: fadeSlide 0.35s ease;
}

.modal.active .modal-content {
    animation: modalPop 0.3s ease;
}

.mood-emoji {
    animation: dropIn 0.6s ease-out, floatSoft 2.8s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

@keyframes fadeSlide {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes modalPop {
    0% { opacity: 0; transform: translateY(14px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardEnter {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes floatSoft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Modern Jar + Emoji Bubbles */
.tab-content#mood-tab {
    margin: 18px 14px 0;
    padding: 18px 0 8px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(19, 24, 44, 0.92), rgba(13, 18, 36, 0.92));
    border: 1px solid #283155;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.tab-content#mood-tab .mood-header,
.tab-content#mood-tab .mood-buttons {
    padding: 0 12px;
}

.mood-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mood-icon,
.mood-stat-emoji,
.category-mood-emoji,
.jar-empty-bubble,
.mood-emoji {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        inset 0 -10px 18px rgba(0, 0, 0, 0.23),
        0 10px 22px rgba(0, 0, 0, 0.3);
}

.mood-icon,
.mood-stat-emoji,
.category-mood-emoji {
    width: 34px;
    height: 34px;
    margin: 0 auto;
}

.category-mood-emoji {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
}

.mood-stat-emoji {
    margin-bottom: 8px;
}

.mood-icon::after,
.mood-stat-emoji::after,
.category-mood-emoji::after,
.jar-empty-bubble::after,
.mood-emoji::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 58%;
    width: 14px;
    height: 7px;
    border: 2px solid rgba(22, 26, 40, 0.78);
    border-top: 0;
    border-radius: 0 0 14px 14px;
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
}

.mood-icon::before,
.mood-stat-emoji::before,
.category-mood-emoji::before,
.jar-empty-bubble::before,
.mood-emoji::before {
    content: '';
    position: absolute;
    top: 35%;
    left: 32%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(17, 22, 36, 0.85);
    box-shadow: 14px 0 0 rgba(17, 22, 36, 0.85);
    z-index: 2;
}

.mood-pic-horrible {
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.42), transparent 30%),
        linear-gradient(145deg, #fb7185 0%, #e11d48 50%, #9f1239 100%);
    border: 1px solid rgba(244, 114, 182, 0.58);
}

.mood-pic-bad {
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.42), transparent 30%),
        linear-gradient(145deg, #fb923c 0%, #f97316 50%, #b45309 100%);
    border: 1px solid rgba(251, 146, 60, 0.58);
}

.mood-pic-neutral {
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.42), transparent 30%),
        linear-gradient(145deg, #facc15 0%, #eab308 50%, #ca8a04 100%);
    border: 1px solid rgba(250, 204, 21, 0.58);
}

.mood-pic-good {
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.42), transparent 30%),
        linear-gradient(145deg, #4ade80 0%, #22c55e 50%, #15803d 100%);
    border: 1px solid rgba(74, 222, 128, 0.58);
}

.mood-pic-awesome {
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.42), transparent 30%),
        linear-gradient(145deg, #60a5fa 0%, #3b82f6 35%, #8b5cf6 100%);
    border: 1px solid rgba(96, 165, 250, 0.58);
}

.mood-pic-horrible,
.mood-pic-bad,
.mood-pic-neutral,
.mood-pic-good,
.mood-pic-awesome {
    filter: saturate(1.08) contrast(1.02);
}

.mood-pic-horrible::before,
.mood-pic-bad::before,
.mood-pic-neutral::before,
.mood-pic-good::before,
.mood-pic-awesome::before {
    box-shadow: 15px 0 0 rgba(17, 22, 36, 0.88);
}

.mood-pic-horrible::after {
    top: 62%;
    border-top: 2px solid rgba(22, 26, 40, 0.82);
    border-bottom: 0;
    border-left: 2px solid rgba(22, 26, 40, 0.82);
    border-right: 2px solid rgba(22, 26, 40, 0.82);
    border-radius: 12px 12px 0 0;
}

.mood-pic-bad::after {
    top: 61%;
    width: 12px;
    height: 0;
    border: 0;
    border-top: 2px solid rgba(22, 26, 40, 0.82);
    border-radius: 2px;
}

.mood-pic-neutral::after {
    top: 60%;
    width: 11px;
    height: 0;
    border: 0;
    border-top: 2px solid rgba(22, 26, 40, 0.76);
    border-radius: 2px;
}

.mood-pic-good::after {
    top: 57%;
}

.mood-pic-awesome::after {
    top: 56%;
    width: 15px;
    height: 8px;
}

.jar {
    width: 300px;
    perspective: 1200px;
    transform-style: preserve-3d;
    filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.45));
}

.jar::after {
    content: '';
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -16px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(20, 28, 60, 0.56) 0%, rgba(20, 28, 60, 0) 72%);
    transform: translateZ(-1px);
}

.jar-neck {
    width: 112px;
    height: 34px;
    border-radius: 18px 18px 8px 8px;
    border-width: 2px;
    background: linear-gradient(180deg, rgba(139, 161, 236, 0.35) 0%, rgba(71, 96, 178, 0.5) 100%);
    position: relative;
    transform: translateZ(16px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 12px 16px rgba(0, 0, 0, 0.3);
}

.jar-neck::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    top: 7px;
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.1));
}

.jar-body {
    position: relative;
    width: 300px;
    height: 370px;
    border-width: 2px;
    border-radius: 30px;
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.2), transparent 25%),
        linear-gradient(180deg, rgba(58, 79, 138, 0.45) 0%, rgba(32, 44, 79, 0.68) 55%, rgba(19, 27, 52, 0.78) 100%);
    backdrop-filter: blur(10px);
    transform: rotateX(3deg) translateZ(10px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.32),
        inset 0 -18px 30px rgba(10, 18, 40, 0.42),
        0 22px 34px rgba(0, 0, 0, 0.42);
}

.jar-body::before {
    content: '';
    position: absolute;
    top: 8%;
    left: 9%;
    width: 34%;
    height: 78%;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.06));
    transform: skewX(-7deg);
    pointer-events: none;
}

.jar-body::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46%;
    background: linear-gradient(180deg, rgba(124, 93, 255, 0.05) 0%, rgba(124, 93, 255, 0.14) 100%);
    pointer-events: none;
}

.jar-emojis {
    padding: 14px;
    gap: 10px;
    transform: translateZ(18px);
}

.jar-empty-state {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 12px;
    gap: 14px;
}

.jar-empty-bubbles {
    display: flex;
    gap: 10px;
}

.jar-empty-bubble {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.26);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
    animation: floatSoft 2.8s ease-in-out infinite;
}

.jar-empty-bubble:nth-child(2) {
    animation-delay: 0.2s;
}

.jar-empty-bubble:nth-child(3) {
    animation-delay: 0.4s;
}

.jar-empty-text {
    color: #aeb6d3;
    font-size: 13px;
    max-width: 200px;
    line-height: 1.5;
}

.mood-emoji {
    position: relative;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -8px 12px rgba(8, 13, 28, 0.24),
        0 12px 20px rgba(0, 0, 0, 0.35);
    transform: rotate(var(--mood-rotate, 0deg)) scale(var(--mood-scale, 1)) translateZ(0);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    animation: dropIn 0.6s ease-out, floatSoft 3s ease-in-out infinite;
}

.mood-emoji:hover {
    transform: rotate(0deg) scale(1.18) translateY(-5px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.42),
        inset 0 -9px 14px rgba(5, 10, 24, 0.25),
        0 16px 26px rgba(0, 0, 0, 0.5);
}

.mood-emoji[data-mood='horrible'] { border-color: rgba(239, 68, 68, 0.55); }
.mood-emoji[data-mood='bad'] { border-color: rgba(249, 115, 22, 0.55); }
.mood-emoji[data-mood='neutral'] { border-color: rgba(234, 179, 8, 0.55); }
.mood-emoji[data-mood='good'] { border-color: rgba(132, 204, 22, 0.55); }
.mood-emoji[data-mood='awesome'] { border-color: rgba(56, 189, 248, 0.55); }

@media (max-width: 768px) {
    .tab-content#mood-tab {
        margin: 14px 10px 0;
    }

    .jar,
    .jar-body {
        width: 260px;
    }

    .jar-body {
        height: 320px;
    }

    .mood-emoji {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    .tab-content#mood-tab {
        margin: 12px 8px 0;
        border-radius: 18px;
    }

    .jar,
    .jar-body {
        width: 230px;
    }

    .jar-body {
        height: 285px;
    }

    .mood-emoji {
        width: 38px;
        height: 38px;
    }
}

/* SVG Mood Bubbles */
.mood-bubble-svg {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.30));
}

.mood-bubble-xs {
    width: 22px;
    height: 22px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}

.mood-icon-slot,
.mood-icon,
.mood-stat-emoji,
.category-mood-emoji,
.jar-empty-bubble,
.mood-emoji {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.mood-icon,
.mood-icon-slot {
    width: 40px;
    height: 40px;
}

.mood-stat-emoji,
.category-mood-emoji {
    width: 38px;
    height: 38px;
    margin: 0 auto 8px;
}

.jar-empty-bubble {
    width: 46px;
    height: 46px;
}

.mood-emoji {
    overflow: visible;
    border-radius: 0;
    width: 50px;
    height: 50px;
}

.mood-btn {
    border-radius: 16px;
    border: 1px solid rgba(132, 148, 209, 0.28);
    background: linear-gradient(180deg, rgba(29, 36, 64, 0.88), rgba(18, 23, 43, 0.92));
    backdrop-filter: blur(6px);
}

.mood-btn span[data-i18n] {
    font-size: 12px;
    letter-spacing: 0.2px;
}

.mood-btn:hover {
    border-color: rgba(145, 166, 255, 0.45);
    transform: translateY(-3px) scale(1.01);
}

.mood-stat,
.category-mood-item {
    background: linear-gradient(180deg, rgba(26, 33, 60, 0.86), rgba(18, 22, 42, 0.92));
    border: 1px solid rgba(126, 145, 205, 0.2);
}

.mood-icon::before,
.mood-icon::after,
.mood-icon-slot::before,
.mood-icon-slot::after,
.mood-stat-emoji::before,
.mood-stat-emoji::after,
.category-mood-emoji::before,
.category-mood-emoji::after,
.jar-empty-bubble::before,
.jar-empty-bubble::after,
.mood-emoji::before,
.mood-emoji::after {
    content: none !important;
}

/* Apple Glass Minimal Preset */
.tab-content#mood-tab {
    background: linear-gradient(180deg, rgba(26, 30, 52, 0.72), rgba(18, 22, 41, 0.78));
    border: 1px solid rgba(168, 176, 238, 0.32);
    backdrop-filter: blur(22px) saturate(135%);
    box-shadow: 0 12px 26px rgba(4, 10, 24, 0.34), inset 0 1px 0 rgba(200, 214, 255, 0.22);
}

.mood-header h2 {
    letter-spacing: -0.2px;
}

.mood-range-select {
    background: rgba(46, 55, 90, 0.52);
    border: 1px solid rgba(165, 178, 242, 0.36);
    color: #f1f6ff;
    backdrop-filter: blur(14px);
}

.mood-btn {
    background: linear-gradient(180deg, rgba(54, 62, 102, 0.62), rgba(37, 44, 76, 0.72));
    border: 1px solid rgba(164, 178, 244, 0.38);
    border-radius: 14px;
    box-shadow: 0 7px 16px rgba(4, 10, 24, 0.22), inset 0 1px 0 rgba(199, 216, 255, 0.24);
    backdrop-filter: blur(12px) saturate(125%);
}

.mood-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(4, 10, 24, 0.3), inset 0 1px 0 rgba(210, 225, 255, 0.3);
}

.mood-btn span[data-i18n] {
    font-size: 12px;
    color: #f3f8ff;
    opacity: 0.95;
}

.mood-icon,
.mood-icon-slot {
    width: 34px;
    height: 34px;
}

.mood-bubble-svg {
    filter: drop-shadow(0 3px 7px rgba(8, 12, 30, 0.18));
}

.jar {
    perspective: none;
    transform-style: flat;
    filter: drop-shadow(0 14px 20px rgba(6, 10, 25, 0.20));
}

.jar-container {
    background: linear-gradient(180deg, rgba(20, 24, 44, 0.34), rgba(14, 18, 34, 0.44));
    border: 1px solid rgba(150, 156, 220, 0.20);
    border-radius: 20px;
}

.jar::after {
    background: radial-gradient(ellipse at center, rgba(138, 122, 187, 0.20) 0%, rgba(138, 122, 187, 0) 72%);
    height: 12px;
}

.jar-neck {
    border-color: rgba(232, 215, 255, 0.62);
    background: linear-gradient(180deg, rgba(252, 236, 246, 0.34), rgba(228, 222, 255, 0.26));
    box-shadow: inset 0 1px 0 rgba(235, 248, 255, 0.62), 0 6px 12px rgba(6, 22, 44, 0.14);
    transform: none;
}

.jar-body {
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 244, 250, 0.26), transparent 34%),
        linear-gradient(180deg, rgba(78, 67, 109, 0.32) 0%, rgba(52, 52, 102, 0.38) 48%, rgba(34, 42, 82, 0.44) 100%);
    border-color: rgba(232, 216, 255, 0.66);
    backdrop-filter: blur(18px) saturate(125%);
    transform: none;
    box-shadow: inset 0 1px 0 rgba(233, 246, 255, 0.68), inset 0 -6px 14px rgba(10, 26, 52, 0.10), 0 14px 20px rgba(6, 16, 34, 0.16);
}

.jar-body::before {
    background: linear-gradient(180deg, rgba(235, 247, 255, 0.50), rgba(235, 247, 255, 0.06));
}

.jar-emojis {
    transform: none;
}

.mood-emoji {
    width: 46px;
    height: 46px;
    animation: dropIn 0.45s ease-out, floatSoft 3.8s ease-in-out infinite;
}

.mood-emoji:hover {
    transform: rotate(0deg) scale(1.08) translateY(-2px);
}

.mood-statistics,
.mood-stat,
.category-stat,
.category-mood-item {
    background: linear-gradient(180deg, rgba(48, 57, 93, 0.58), rgba(32, 38, 68, 0.7));
    border: 1px solid rgba(162, 175, 238, 0.28);
    box-shadow: 0 8px 16px rgba(4, 10, 24, 0.24), inset 0 1px 0 rgba(194, 209, 255, 0.22);
    backdrop-filter: blur(14px);
}

@media (max-width: 768px) {
    .mood-btn {
        border-radius: 12px;
    }

    .mood-emoji {
        width: 40px;
        height: 40px;
    }
}

/* Assistant Tab */
#assistant-tab {
    padding: 20px 14px;
}

.assistant-wrap {
    background: linear-gradient(180deg, rgba(33, 39, 66, 0.9), rgba(24, 28, 50, 0.95));
    border: 1px solid rgba(170, 182, 245, 0.3);
    border-radius: 20px;
    box-shadow: 0 14px 26px rgba(6, 10, 24, 0.3);
    padding: 16px;
}

.assistant-header h2 {
    color: #f4f7ff;
    font-size: 22px;
    margin-bottom: 6px;
}

.assistant-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.assistant-mode-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    border-radius: 999px;
    padding: 6px 10px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.assistant-mode-badge.connected {
    color: #dffdf3;
    background: rgba(20, 184, 166, 0.18);
    border-color: rgba(94, 234, 212, 0.4);
}

.assistant-mode-badge.fallback {
    color: #fff6e2;
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(251, 191, 36, 0.4);
}

.assistant-header p {
    color: #c5d0f7;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 14px;
}

.assistant-mode-hint {
    margin-top: -6px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #aeb9df;
}

.assistant-messages {
    height: 360px;
    overflow-y: auto;
    border-radius: 14px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(16, 20, 37, 0.75), rgba(12, 16, 31, 0.8));
    border: 1px solid rgba(132, 145, 208, 0.24);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assistant-msg-row {
    display: flex;
}

.assistant-msg-row.assistant {
    justify-content: flex-start;
}

.assistant-msg-row.user {
    justify-content: flex-end;
}

.assistant-msg-bubble {
    max-width: 84%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.assistant-msg-bubble.assistant {
    background: linear-gradient(180deg, rgba(224, 231, 255, 0.18), rgba(209, 215, 255, 0.1));
    border: 1px solid rgba(196, 205, 252, 0.35);
    color: #ecf0ff;
}

.assistant-msg-bubble.user {
    background: linear-gradient(180deg, rgba(204, 255, 239, 0.22), rgba(180, 240, 228, 0.16));
    border: 1px solid rgba(175, 235, 223, 0.38);
    color: #f6fffc;
}

.assistant-input-row {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

#assistantInput {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(171, 185, 246, 0.36);
    background: rgba(28, 35, 62, 0.88);
    color: #f0f4ff;
    padding: 12px;
    font-size: 14px;
}

#assistantInput::placeholder {
    color: #9facd8;
}

#assistantInput:focus {
    outline: none;
    border-color: #c2ccff;
    box-shadow: 0 0 0 3px rgba(157, 173, 255, 0.2);
}

.assistant-send-btn {
    border: none;
    border-radius: 12px;
    padding: 0 18px;
    min-height: 46px;
    font-weight: 700;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(135deg, #7c8dff, #8c7dff);
    box-shadow: 0 8px 16px rgba(88, 97, 182, 0.35);
}

.assistant-send-btn:hover {
    transform: translateY(-1px);
}

.assistant-disclaimer {
    margin-top: 10px;
    color: #aeb9df;
    font-size: 12px;
    line-height: 1.35;
}

@media (max-width: 768px) {
    #assistant-tab {
        padding: 14px 10px;
    }

    .assistant-wrap {
        padding: 12px;
        border-radius: 16px;
    }

    .assistant-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .assistant-messages {
        height: 320px;
    }

    .assistant-input-row {
        grid-template-columns: 1fr;
    }

    .assistant-send-btn {
        width: 100%;
    }
}

/* Modern UI refresh overrides */
:root {
    --ui-bg: #f8f4ec;
    --ui-surface: #fffefd;
    --ui-surface-strong: #fdf8f0;
    --ui-border: rgba(58, 47, 36, 0.13);
    --ui-text: #1c1814;
    --ui-text-muted: #7a6f62;
    --ui-accent: #95b7a0;
    --ui-accent-2: #82a98e;
    --ui-radius-lg: 18px;
    --ui-radius-md: 14px;
    --ui-shadow: 0 8px 20px rgba(58, 45, 30, 0.08);
}

body {
    background:
        radial-gradient(920px 500px at 0% -8%, rgba(201, 181, 156, 0.22), transparent 60%),
        radial-gradient(760px 480px at 100% 0%, rgba(166, 191, 170, 0.14), transparent 56%),
        var(--ui-bg);
    color: var(--ui-text);
}

.container {
    max-width: 720px;
    background: transparent;
    padding-bottom: 20px;
}

.header {
    margin: 14px 14px 0;
    border-radius: 22px 22px 0 0;
    border: 1px solid var(--ui-border);
    background: #fffdf8;
    box-shadow: var(--ui-shadow);
    backdrop-filter: blur(10px);
}

.header h1 {
    letter-spacing: 0.2px;
}

.brand-title {
    margin: 0;
    font-size: clamp(1.72rem, 1.25rem + 1.62vw, 2.35rem);
    font-weight: 800;
    letter-spacing: 0.016em;
    text-transform: uppercase;
    color: #1d1813;
    -webkit-text-stroke: 0.15px rgba(255, 255, 255, 0.4);
    text-shadow: 0 4px 10px rgba(130, 117, 101, 0.12);
    line-height: 1;
}

.brand {
    gap: 10px;
}

.app-logo {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    box-shadow: 0 10px 18px rgba(75, 58, 42, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(105, 88, 68, 0.18);
}

.date {
    color: var(--ui-text-muted);
    width: 100%;
    text-align: left;
    padding-left: 8px;
}

.language-selector {
    border: 1px solid rgba(101, 84, 64, 0.2);
    background: rgba(255, 252, 246, 0.95);
    border-radius: 12px;
    color: #241f19;
}

.tab-nav {
    margin: 0 14px;
    padding: 8px;
    gap: 8px;
    border-radius: 0 0 16px 16px;
    border: 1px solid var(--ui-border);
    border-top: none;
    background: #fcf7ef;
    box-shadow: var(--ui-shadow);
}

.tab-btn {
    border-radius: 12px;
    color: #6c5d4f;
    font-size: 14px;
    font-weight: 600;
}

.tab-btn.active {
    background: #edf4ee;
    color: #1f1a15;
    border: 1px solid rgba(128, 163, 136, 0.32);
}

.tab-content.active {
    padding-top: 6px;
}

.date-display,
.progress-section,
#todos-tab .progress-section,
.habit-card,
.mood-header,
.jar-container,
.mood-statistics,
.stats-section,
.modal-content,
.assistant-wrap {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
    backdrop-filter: blur(12px);
}

.date-display {
    margin: 18px 14px 0;
    color: #4d4136;
}

.progress-section,
#todos-tab .progress-section,
.mood-header,
.jar-container,
.mood-statistics,
.assistant-wrap {
    margin-left: 14px;
    margin-right: 14px;
}

.progress-header,
.habit-name,
.mood-header h2,
.mood-stat-title,
.category-name {
    color: var(--ui-text);
}

.habit-streak,
.modal-description,
.assistant-disclaimer,
.assistant-mode-hint {
    color: var(--ui-text-muted);
}

.progress-bar {
    background: rgba(176, 159, 136, 0.2);
    border-radius: 999px;
}

.progress-fill {
    background: linear-gradient(90deg, #8fb39a, #7ea387);
}

.habit-card {
    border-radius: var(--ui-radius-md);
    margin-bottom: 10px;
}

.habit-card:hover {
    transform: translateY(-1px);
}

.add-btn,
.assistant-send-btn,
.btn-save {
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ui-accent), var(--ui-accent-2));
    border: 1px solid rgba(119, 147, 124, 0.35);
    box-shadow: 0 6px 14px rgba(114, 140, 118, 0.2);
    color: #fbfaf6;
}

.add-btn:hover,
.assistant-send-btn:hover,
.btn-save:hover {
    transform: translateY(-1px);
}

input,
select,
#assistantInput,
.frequency-select {
    border-radius: 12px;
    border: 1px solid rgba(109, 92, 72, 0.2);
    background: #fffefb;
    color: #1f1a15;
}

input::placeholder,
#assistantInput::placeholder {
    color: #8d7c6a;
}

input:focus,
select:focus,
#assistantInput:focus,
.frequency-select:focus {
    outline: none;
    border-color: rgba(125, 156, 132, 0.72);
    box-shadow: 0 0 0 3px rgba(158, 191, 164, 0.22);
}

.modal {
    background: rgba(45, 35, 22, 0.24);
}

.assistant-messages {
    border-radius: 16px;
    background: #fffdf9;
    border: 1px solid rgba(111, 95, 76, 0.2);
}

.assistant-msg-bubble {
    border-radius: 14px;
}

.assistant-msg-bubble.assistant {
    background: #f8efe3;
    border: 1px solid rgba(122, 104, 84, 0.18);
    color: #2b241d;
}

.assistant-msg-bubble.user {
    background: rgba(184, 209, 188, 0.38);
    border: 1px solid rgba(126, 156, 132, 0.28);
    color: #1f1a15;
}

/* No-purple assurance overrides */
.language-selector option {
    background: #f5ede0;
    color: #1f1a15;
}

.tab-btn:hover:not(.active) {
    background: rgba(170, 195, 175, 0.24);
    color: #2a231c;
}

.tab-btn,
.tab-btn:not(.active) {
    color: #67594c !important;
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(160, 194, 166, 0.36), rgba(211, 228, 198, 0.34)) !important;
    color: #1f1a15 !important;
    border: 1px solid rgba(123, 156, 129, 0.36) !important;
    box-shadow: 0 8px 18px rgba(121, 151, 126, 0.22) !important;
}

.tab-btn:hover,
.tab-btn:focus-visible {
    background: rgba(170, 195, 175, 0.24) !important;
    color: #2a231c !important;
}

.tab-nav {
    box-shadow: 0 10px 22px rgba(83, 67, 50, 0.12) !important;
}

.progress-fill,
#todoProgressFill {
    background: linear-gradient(90deg, #93b29a 0%, #7f9f86 100%);
}

.add-btn,
.assistant-send-btn,
.btn-save {
    background: linear-gradient(135deg, #93b29a 0%, #7f9f86 100%);
}

.app-logo {
    border-color: rgba(111, 143, 118, 0.28);
}

.mood-stat,
.category-stat,
.category-mood-item {
    background: rgba(255, 250, 243, 0.94);
    border: 1px solid rgba(118, 100, 82, 0.16);
    box-shadow: 0 8px 16px rgba(67, 54, 41, 0.08);
}

/* Final mood-tab light override */
.tab-content#mood-tab {
    background: linear-gradient(180deg, #fdf8f0, #f7efe3) !important;
    border: 1px solid rgba(112, 95, 76, 0.18) !important;
    box-shadow: 0 12px 24px rgba(79, 59, 38, 0.10) !important;
}

.tab-content#mood-tab .mood-header,
.tab-content#mood-tab .jar-container,
.tab-content#mood-tab .mood-statistics,
.tab-content#mood-tab .stats-section {
    background: #fffdf8 !important;
    border: 1px solid rgba(112, 95, 76, 0.16) !important;
    box-shadow: 0 8px 16px rgba(79, 59, 38, 0.08) !important;
}

.tab-content#mood-tab .mood-buttons {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 12px !important;
    margin-bottom: 10px !important;
}

.tab-content#mood-tab .jar-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

.tab-content#mood-tab .jar::after {
    background: radial-gradient(ellipse at center, rgba(98, 82, 62, 0.16) 0%, rgba(98, 82, 62, 0) 72%) !important;
}

.tab-content#mood-tab .jar-neck {
    border-color: rgba(198, 184, 165, 0.58) !important;
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.38), rgba(255, 251, 245, 0.24)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 6px 10px rgba(72, 56, 40, 0.1) !important;
}

.tab-content#mood-tab .jar-body {
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.42), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.14) 48%, rgba(255, 255, 255, 0.18) 100%) !important;
    border-color: rgba(206, 191, 171, 0.72) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), inset 0 -8px 14px rgba(86, 68, 48, 0.08), 0 12px 20px rgba(73, 57, 41, 0.12) !important;
}

.tab-content#mood-tab .jar-body::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.08) 100%) !important;
}

.tab-content#mood-tab .mood-header h2,
.tab-content#mood-tab h3,
.tab-content#mood-tab h4,
.tab-content#mood-tab .mood-stat-title,
.tab-content#mood-tab .category-name,
.tab-content#mood-tab .category-mood-name,
.tab-content#mood-tab .mood-stat-label {
    color: #1f1a15 !important;
}

.tab-content#mood-tab .mood-range-select {
    background: #edf4ee !important;
    border: 1px solid rgba(124, 155, 130, 0.34) !important;
    color: #2b241d !important;
}

.tab-content#mood-tab .mood-btn {
    background: linear-gradient(180deg, #f2f7f2, #e9f1ea) !important;
    border: 1px solid rgba(125, 156, 132, 0.34) !important;
    box-shadow: 0 6px 14px rgba(102, 131, 108, 0.14) !important;
}

.tab-content#mood-tab .mood-btn span[data-i18n] {
    color: #2a231c !important;
}

.tab-content#mood-tab .mood-btn:hover {
    background: linear-gradient(180deg, #eaf3eb, #ddeade) !important;
    border-color: rgba(112, 145, 120, 0.42) !important;
    transform: translateY(-2px) !important;
}

.tab-content#mood-tab .mood-buttons {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: stretch !important;
}

.tab-content#mood-tab .mood-btn {
    height: 104px !important;
    min-height: 104px !important;
    border-radius: 14px !important;
    margin: 0 !important;
    align-self: stretch !important;
    box-sizing: border-box !important;
}

@media (max-width: 700px) {
    .tab-content#mood-tab .mood-buttons {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .tab-content#mood-tab .mood-buttons {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .tab-content#mood-tab .mood-btn {
        height: 98px !important;
        min-height: 98px !important;
    }
}

@media (max-width: 520px) {
    .tab-content#mood-tab .mood-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

.tab-content#mood-tab .jar,
.tab-content#mood-tab .jar-body,
.tab-content#mood-tab .jar-neck,
.tab-content#mood-tab .jar::after,
.tab-content#mood-tab .jar-body::after {
    filter: none !important;
}

@media (max-width: 768px) {
    .header,
    .tab-nav,
    .date-display,
    .progress-section,
    #todos-tab .progress-section,
    .mood-header,
    .jar-container,
    .mood-statistics,
    .assistant-wrap {
        margin-left: 10px;
        margin-right: 10px;
    }

    .tab-nav {
        gap: 6px;
        padding: 6px;
    }
}
