/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

:root {
    --safe-top: 0px;
    --safe-bottom: 0px;
    --safe-bottom-ui: 0px;
    --safe-left: 0px;
    --safe-right: 0px;
}

html {
    background-color: #151519;
    min-height: 100%;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    height: 100%;
}

body {
    -webkit-touch-callout: none;
    -webkit-text-size-adjust: none;
    -webkit-user-select: none;
    font-family: 'Jost', sans-serif;
    background-color: #1E1E23;
    min-height: 100%;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    height: 100%;
    width: 100%;
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* WebKit bug: in iOS standalone PWA, 100svh/100dvh under-report height — use 100vh */
@media (display-mode: standalone), (display-mode: fullscreen) {
    html,
    body {
        min-height: 100vh;
        height: 100vh;
    }
}

html.pwa-standalone,
html.pwa-standalone body {
    min-height: 100vh;
    height: 100vh;
}

.app-container {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 320px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background-color: #1E1E23;
    overflow: hidden;
    box-sizing: border-box;
}

.header {
    flex-shrink: 0;
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    padding-top: calc(20px + var(--safe-top));
}

.header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
}

h1, .menu-item, .create-project-btn {
    font-family: 'Jost', sans-serif;
    font-weight: 500; /* Medium */
}

.no-projects, .no-data, .settings-item, .stat-card {
    font-family: 'Jost', sans-serif;
    font-weight: 400; /* Regular */
}

h1 {
    font-size: 28px;
    line-height: 32px;
    color: #efeff8;
}

.project-count {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
    min-width: 32px;
    height: 32px;
    background: #1e1e23;
    border-radius: 10px;
    color: #FAFAFA;
    font-size: 14px;
    line-height: 17px;
    font-weight: 500;
}

.main-content {
    flex: 1 1 0;
    min-height: 0;
    height: 0;
    display: block;
    padding: 20px;
    width: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    padding-bottom: 12px;
}

html.browser-mode .main-content {
    padding-bottom: calc(var(--safe-bottom-ui) + 12px);
}

#projects .main-content {
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
}

#projects-container {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
}

.bottom-create-project {
    width: 100%;
    max-width: 640px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.no-projects-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.no-projects {
    font-size: 18px;
    line-height: 26px;
    color: #AAAAB2;
    text-align: center;
    margin: 0;
}

button#createProjectBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 50px;
    width: auto;
    padding: 0 30px;
}

button#createProjectBtn .icon {
    width: 24px;
    height: 24px;
    background: url(../img/icons/ic_add_white.svg) center no-repeat;
}

button#createProjectBtn span {
    font-family: 'Jost';
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: #F3F3F3;
}

.create-project-btn {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    gap: 10px;
    width: auto;
    min-width: -webkit-fill-available;
    height: 50px;
    background: #151519;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    color: #efeff8;
    font-size: 16px;
    line-height: 20px;
    transition: background-color 0.2s ease-in-out;
    font-weight: 400;
}

.create-project-btn:hover {
    background: #1e1e23;
}

.create-project-btn:active {
    transform: scale(0.95);
}

.create-project-btn .icon {
    width: 24px;
    height: 24px;
    background: url(../img/icons/ic_add_white.svg) center no-repeat;
    flex-shrink: 0;
}

/* Remove ripple effect */
.create-project-btn::after {
    display: none;
}

.icon {
    width: 24px;
    height: 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-repeat: no-repeat;
    background-position: center;
}

.add-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #F3F3F3;
    background: url('../img/icons/ic_add_white.svg') center no-repeat;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: #404043;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 4px;
    min-width: 64px;
    text-align: center;
}

.menu-item .icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    opacity: 0.2;
    transition: opacity 0.2s ease;
}

.menu-item span {
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
}

.menu-item:hover {
    color: #efeff8;
}

.menu-item.active {
    color: #efeff8;
}

.menu-item.active .icon {
    opacity: 1;
}

/* Иконки меню */
.icon-projects {
    background: url('../img/icons/ic_folder_white.svg') center no-repeat;
    background-size: contain;
}

.icon-timer {
    background: url('../img/icons/ic_menu_timer_white.svg') center no-repeat;
    background-size: contain;
}

.icon-statistics {
    background: url('../img/icons/ic_statistics_white.svg') center no-repeat;
    background-size: contain;
}

.icon-settings {
    background: url('../img/icons/ic_settings_white.svg') center no-repeat;
    background-size: contain;
}

.icon-checklist {
    background: url('../img/icons/ic_check_list_light.svg') center no-repeat;
    background-size: contain;
}

/* Активные состояния иконок */
.menu-item.active .icon-projects {
    background-image: url('../img/icons/ic_folder_white.svg');
}

.menu-item.active .icon-timer {
    background-image: url('../img/icons/ic_menu_timer_white.svg');
}

.menu-item.active .icon-statistics {
    background-image: url('../img/icons/ic_statistics_white.svg');
}

.menu-item.active .icon-settings {
    background-image: url('../img/icons/ic_settings_white.svg');
}

.menu-item.active .icon-checklist {
    background-image: url('../img/icons/ic_check_list_light.svg');
    opacity: 1;
}

/* Удаляем конфликтующие стили */
.icon-projects::before,
.icon-timer::before,
.icon-statistics::before,
.icon-settings::before,
.icon-checklist::before {
    content: none;
}

.tab-content {
    display: none;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 0;
    background: #0e0e11;
    position: relative;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
}

.no-data {
    font-size: 18px;
    line-height: 26px;
    color: #AAAAB2;
    text-align: center;
    margin-bottom: 20px;
}

.settings-list {
    width: 100%;
    /* padding: 20px; */
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Jost', sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover {
    background-color: #151519;
}

.settings-item-danger span {
    color: #ff6b68;
}

.settings-item-danger:hover {
    background-color: #1a1214;
}

#demo-project-item {
    border-radius: 10px;
    border: 1px solid #2a2a30;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a30;
    width: auto;
}

#demo-project-item:hover {
    background-color: #151519;
    border-color: #3a3a42;
}

.app-version {
    cursor: default;
    background: none !important;
    justify-content: center;
    padding: 30px;
    margin-top: 20px;
    border-bottom: none;
}

.app-version:hover {
    background: none !important;
}

.version-number {
    color: #8F5FE0;
    font-weight: 500;
    margin-left: 10px;
}

.settings-toggle {
    width: 40px;
    height: 24px;
    background: #2B2C2E;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.settings-toggle::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #FAFAFA;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease-in-out;
}

.settings-toggle.active {
    background: #4CAF50;
}

.settings-toggle.active::before {
    transform: translateX(16px);
}

/* ─── Statistics Tab ──────────────────────────────────────────────────────── */
.stats-main-content {
    padding: 0 !important;
    align-items: stretch !important;
}

.stats-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.stats-dropdown {
    position: relative;
}

.stats-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid #22222a;
    color: #efeff8;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    max-width: 150px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.stats-dropdown-btn:active {
    background: #22222a;
}

.stats-dropdown.open .stats-dropdown-btn {
    border-color: #3a3a44;
    background: #22222a;
}

.stats-dropdown-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 110px;
}

.stats-dropdown-arrow {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.stats-dropdown.open .stats-dropdown-arrow {
    transform: rotate(180deg);
}

.stats-dropdown-list {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 170px;
    background: #1a1a1f;
    border: 1px solid #2a2a32;
    border-radius: 10px;
    overflow: hidden;
    z-index: 999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.stats-dropdown.open .stats-dropdown-list {
    display: block;
    animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.stats-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    color: #8e8e93;
    cursor: pointer;
    transition: background 0.1s ease, color 0.1s ease;
}

.stats-dropdown-item:not(:last-child) {
    border-bottom: 1px solid #22222a;
}

.stats-dropdown-item:active,
.stats-dropdown-item:hover {
    background: #22222a;
    color: #efeff8;
}

.stats-dropdown-item.selected {
    color: #efeff8;
}

.stats-dropdown-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stats-dropdown-item-check {
    margin-left: auto;
    opacity: 0;
    color: #efeff8;
    font-size: 14px;
}

.stats-dropdown-item.selected .stats-dropdown-item-check {
    opacity: 1;
}

.stats-period-tabs {
    display: flex;
    flex-shrink: 0;
    padding: 5px;
    border: 1px solid #22222a;
    border-radius: 10px;
    margin: 0 20px;
}

.stats-period-tab {
    flex: 1;
    padding: 8px 10px;
    background: none;
    border: none;
    color: #8e8e93;
    font-family: 'Jost', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.stats-period-tab.active {
    color: #0e0e11;
    background: #efeff8;
    border-radius: 6px;
}

.stats-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid #1e1e23;
    margin-top: 10px;
}

.stats-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.stats-nav-btn:active {
    opacity: 1;
}

.stats-nav-label {
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    color: #efeff8;
    font-weight: 500;
    text-align: center;
    flex: 1;
}

#stats-content {
    padding: 16px;
    padding-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.stats-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stats-card {
    background: #151519;
    border: 1px solid #1e1e23;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stats-card-value {
    font-family: 'Jost', sans-serif;
    font-size: 22px;
    font-weight: 500;
    color: #efeff8;
    line-height: 1.2;
}

.stats-card-label {
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    color: #8e8e93;
}

.stats-extras-info {
    font-family: 'Jost', sans-serif;
    font-size: 11px;
    color: #5a5a65;
    margin-top: 3px;
}


.stats-chart-section {
    background: #151519;
    border: 1px solid #1e1e23;
    border-radius: 10px;
    padding: 16px;
    box-sizing: border-box;
    width: 100%;
}

.stats-legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 12px;
}

.stats-legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
}

.stats-legend-marker {
    position: relative;
    width: 28px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-legend-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--lc, #5c6bc0);
    border-radius: 1px;
}

.stats-legend-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lc, #5c6bc0);
    border: 2px solid #151519;
    z-index: 1;
}

.stats-legend-name {
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    color: #8e8e93;
}

.stats-chart-title {
    font-family: 'Jost', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #efeff8;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.stats-chart-title img {
    vertical-align: middle;
    margin-right: 10px;
    opacity: 1;
}

.stats-canvas-container {
    display: flex;
    align-items: flex-start;
}

/* Fixed Y-axis canvas — never scrolls */
.stats-yaxis-canvas {
    flex-shrink: 0;
    display: block;
    background: #151519;
    position: relative;
    z-index: 1;
}

.stats-canvas-wrap {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.stats-canvas-wrap canvas {
    display: block;
}

/* Thin scrollbar for the daily bar chart */
.stats-canvas-wrap::-webkit-scrollbar {
    height: 3px;
}
.stats-canvas-wrap::-webkit-scrollbar-track {
    background: transparent;
}
.stats-canvas-wrap::-webkit-scrollbar-thumb {
    background: #2e2e36;
    border-radius: 2px;
}

.stats-no-data {
    text-align: center;
    color: #8e8e93;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    padding: 60px 20px;
}

/* Material Design Animations */
@keyframes ripple {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

.menu-item, .create-project-btn, .settings-item {
    position: relative;
    overflow: hidden;
}

.menu-item::after, .create-project-btn::after, .settings-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: scale(0);
    transform-origin: center;
    opacity: 0;
}

.menu-item:active::after, .create-project-btn:active::after, .settings-item:active::after {
    animation: ripple 0.6s ease-out;
}

/* Menu item animations */
.menu-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item .icon {
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Settings items animation */
.settings-item {
    transition: background-color 0.2s ease-in-out;
    cursor: pointer;
}

.settings-item:hover {
    background: #151519;
}

/* Stats card hover */
.stats-card:hover {
    border-color: #2a2a30;
}

.bottom-menu {
    flex-shrink: 0;
    width: 100%;
    background-color: #151519;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 6px 0 10px 0;
    box-shadow: 0 -1px 10px rgb(11 11 13 / 76%);
    border-top: solid 1px #2c2c33;
    box-sizing: border-box;
}

.bottom-menu .menu-item {
    min-width: 0;
    flex: 1;
    padding: 8px 4px;
}

.bottom-menu .menu-item span {
    font-size: 11px;
}

#checklist-tab {
    position: relative;
}

#checklist-tab .checklist-add-button {
    bottom: calc(96px + var(--safe-bottom-ui, 0px));
    z-index: 10;
}

#checklist-main {
    padding-bottom: 110px;
}

#checklist-tabs {
    display: flex;
}

.checklist-accordion {
    border: 1px solid #22222a;
    background: #151519;
    margin-bottom: 12px;
    border-radius: 10px;
    overflow: hidden;
}

.checklist-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: none;
    border: none;
    color: #efeff8;
    cursor: pointer;
    text-align: left;
    font-family: 'Jost', sans-serif;
    font-size: 16px;
}

.checklist-accordion-toggle .checklist-accordion-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checklist-accordion-toggle .checklist-accordion-meta {
    color: #8e8e93;
    font-size: 13px;
    flex-shrink: 0;
}

.checklist-accordion-toggle .arrow-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    background: url('../img/icons/ic_arrow_down_light.svg') center no-repeat;
    transition: transform 0.2s ease;
}

.checklist-accordion-toggle.expanded .arrow-icon {
    transform: rotate(180deg);
}

.checklist-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.checklist-accordion-body.expanded {
    max-height: 3000px;
    padding: 0 16px 16px;
}

.checklist-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.checklist-input-row .task-checkbox.checked::after {
    background: url('../img/icons/ic_save_light.svg') no-repeat center;
    background-size: contain;
}

.checklist-item-text.completed {
    text-decoration: line-through;
    color: #8e8e93;
}

.checklist-input-row.is-completed .checklist-item-text {
    text-decoration: line-through;
    color: #8e8e93;
}

.checklist-item-text {
    flex: 1;
    min-width: 0;
    color: #efeff8;
    font-size: 18px;
    line-height: 1.4;
    padding: 12px 0;
    font-family: 'Jost', sans-serif;
}

.checklist-input-row .input-field {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.checklist-add-row .input-field,
.checklist-draft-row .input-field {
    width: 100%;
}

.checklist-create-items-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.checklist-create-items-label {
    flex-shrink: 0;
    margin: 0;
    padding: 16px 20px 0;
    color: #8e8e93;
    font-size: 14px;
    font-weight: 400;
    font-family: 'Jost', sans-serif;
}

.checklist-create-items {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 20px 16px;
}

.checklist-input-row .task-action-button {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0.7;
}

.checklist-input-row .task-action-button:hover {
    opacity: 1;
}

.checklist-create-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: calc(100% - 32px);
    max-width: 450px;
    height: 80vh;
    max-height: 80vh;
    background: #151519;
    border: 1px solid #2c2c33;
    border-radius: 10px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.checklist-create-modal.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.checklist-create-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
}

.checklist-create-header h3 {
    color: #efeff8;
    font-size: 18px;
    font-weight: 500;
    font-family: 'Jost', sans-serif;
}

.checklist-create-title-wrap {
    flex-shrink: 0;
    padding: 16px 20px 0;
}

.checklist-create-footer {
    flex-shrink: 0;
    padding: 16px 20px 20px;
    border-top: 1px solid #22222a;
    background: #151519;
}

.checklist-create-footer .confirm-button {
    width: 100%;
    height: 50px;
    background: #efeff8;
    border: none;
    border-radius: 10px;
    color: #0e0e11;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Jost', sans-serif;
    cursor: pointer;
    transition: background 0.2s ease;
}

.checklist-create-footer .confirm-button:hover {
    background: #ffffff;
}

@media screen and (min-width: 768px) {
    #projects-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
        align-items: start;
        max-width: 1200px;
    }

    .project-card {
        width: 100%;
    }
}

@media screen and (max-width: 359px) {
    .bottom-menu {
        padding: 8px 15px 10px 15px;
    }
    
    .menu-item {
        padding: 8px 12px;
    }
}

@media screen and (min-width: 360px) {
    .app-container {
        padding: 0;
    }
}

@media screen and (max-width: 359px) {
    .header {
        padding: 15px;
        padding-top: calc(15px + var(--safe-top));
    }
    
    .main-content {
        padding: 15px;
    }
    
    .bottom-menu {
        padding: 8px 15px 10px 15px;
    }
    
    .menu-item {
        padding: 6px;
    }
    
    .menu-icon {
        width: 20px;
        height: 20px;
    }
    
    .menu-item span {
        font-size: 11px;
    }
    
    h1 {
        font-size: 20px;
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgb(11 11 13 / 65%);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--safe-top) var(--safe-right) var(--safe-bottom-ui) var(--safe-left);
    box-sizing: border-box;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: flex;
}

.popup {
    position: relative;
    z-index: 1001;
    width: 90%;
    max-width: 450px;
    max-height: calc(100% - 32px);
    background: #151519;
    border: 1px solid #2c2c33;
    border-radius: 10px;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.popup-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0px;
    width: 100%;
    height: 32px;
}

.popup-title {
    font-family: 'Jost';
    font-style: normal;
    font-weight: 500;
    font-size: 22px;
    line-height: 32px;
    color: #f9f9ff;
}

.close-button {
    width: 24px;
    height: 24px;
    background: url('../img/icons/ic_close_light.svg') center no-repeat;
    border: none;
    cursor: pointer;
    padding: 0;
}

.popup-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 25px 0px 0 0;
    gap: 15px;
    width: 100%;
}

.input-field {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 15px !important;
    gap: 10px;
    width: 100%;
    height: 50px;
    background: #151519;
    border: 1px solid #2c2c33;
    border-radius: 10px;
    color: #FAFAFA;
    font-family: 'Jost';
    font-size: 18px;
}

.input-field::placeholder {
    color: #45454D;
}

.select-field {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    gap: 10px;
    width: 300px;
    height: 34px;
    background: #3A3A42;
    border-radius: 10px;
    border: none;
    color: #FAFAFA;
    font-family: 'Jost';
    font-size: 14px;
    cursor: pointer;
}

.select-field .icon {
    width: 24px;
    height: 24px;
    background: url('../img/icons/ic_expand_light.svg') center no-repeat;
}

.color-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #17171c;
    border-radius: 10px;
    padding: 10px;
    border: solid 1px #22222a;
}

.color-select .middle-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
}

.color-select button {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    opacity: 0.5;
}

.color-select button img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.color-select .color-preview {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-size: 150% 150%;
    background-position: center;
}

.color-select span {
    color: #f9f9ff;
    font-family: 'Jost';
    font-size: 18px;
}

.create-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    width: 100%;
    height: 50px;
    background: rgb(229 231 239);
    border-radius: 10px;
    border: none;
    cursor: pointer;
    color: #151519;
    font-family: 'Jost';
    font-size: 14px;
    transition: background-color 0.2s ease-in-out;
    margin-top: 25px;
}

.create-button:hover {
    background: #F5F5F5;
}

.create-button .icon {
    width: 32px;
    height: 32px;
}

.create-button span {
    font-family: 'Jost';
    font-weight: 500;
    font-size: 18px;
    line-height: 20px;
    color: #151519;
}

.project-card {
    width: 100%;
    max-width: none;
    background: linear-gradient(75deg, #0e0e11, #151519);
    border: 1px solid #28282e;
    border-radius: 5px 5px 20px 20px;
    position: relative;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
}

.project-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}

.project-card-header {
    width: calc(100% + 40px);
    height: 4px;
    margin: 0 -20px;
    border-radius: 5px 5px 0 0;
    background-size: 300% 300%;
    animation: gradientFlow 6s ease infinite;
}

@keyframes gradientFlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.project-card-title {
    font-family: 'Jost';
    font-weight: 500;
    font-size: 22px;
    line-height: 26px;
    color: #efeff8;
    margin-top: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 10px;
}

.project-card-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.project-card-time, .project-card-date {
    display: flex;
    gap: 5px;
    height: 70px;
    background: #151519;
    border-radius: 10px;
    flex-wrap: nowrap;
    flex-direction: column;
    padding-top: 15px;
    padding-bottom: 15px;
    padding-left: 10px;
    padding-right: 10px;
    align-items: center;
    justify-content: center;
}

.project-card-time {
    min-width: 48%;
    padding-left: 10px;
    padding-right: 10px;
}

.project-card-date {
    width: 48%;
}

.project-card-time span, .project-card-date span {
    color: #9d9da7;
    font-weight: 400;
}

.project-card-settings {
    width: fit-content;
    height: 50px;
    background: #17171c;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 15px;
    border: solid 1px #22222a;
}

.project-card-total {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-top: 25px;
    flex-direction: column;
    gap: 20px;
}

.project-card-total .total-amount {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    flex-direction: row;
    color: #eeeef4;
    font-weight: 500;
}

.project-card-total .details-action {
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-card-total .details-action span {
    color: #9d9da7;
    font-size: 16px;
}

.project-card-total .action-button.tertiary {
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
}

.project-card-total .action-button.tertiary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.project-card img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.project-card-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 20px 0px;
}

.action-button {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 15px;
    gap: 10px;
    height: 50px;
    border-radius: 10px;
    border: none;
    font-family: 'Jost';
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
    color: #f9f9ff;
    cursor: pointer;
}

.action-button.primary {
    background-size: 150% 150%;
    background-position: center;
    min-width: 20%;
    transition: transform 0.2s ease-in-out;
}

.action-button.primary:active {
    transform: scale(0.95);
}

.action-button.secondary {
    background: #2c2c33;
    color: #FAFAFA;
    min-width: 10%;
}

.action-button.tertiary {
    background: #2c2c33;
    width: 40px;
    margin-left: auto;
}

.options-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgb(11 11 13 / 65%);
    backdrop-filter: blur(2px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--safe-top) var(--safe-right) var(--safe-bottom-ui) var(--safe-left);
    box-sizing: border-box;
}

.options-content {
    background: #151519;
    border: 1px solid #2c2c33;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-height: 490px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.options-content .popup-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    width: 100%;
    height: 32px;
    margin-bottom: 15px;
}

.options-content h3 {
    color: #FAFAFA;
    font-size: 22px;
    font-weight: 400;
    margin: 0;
}

.options-content .close-button {
    width: 24px;
    height: 24px;
    background: url('../img/icons/ic_close_light.svg') center no-repeat;
    border: none;
    cursor: pointer;
    padding: 0;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #27292D;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    border: 1px solid #3D3D45;
}

.color-option:hover {
    background: #323338;
}

.color-option .color-preview {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-size: 150% 150%;
    background-position: center;
}

.color-option span {
    color: #FAFAFA;
    font-family: 'Jost';
    font-size: 16px;
}

.option-button {
    background: #3A3A42;
    border: none;
    border-radius: 10px;
    padding: 12px;
    color: #FAFAFA;
    font-family: 'Jost';
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    text-align: left;
    width: 100%;
}

.option-button:hover {
    background: #4D4D55;
}

.month-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #17171c;
    border-radius: 10px;
    padding: 10px;
    border: solid 1px #22222a;
}

.month-selector button {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.month-selector button img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.month-selector span {
    color: #f9f9ff;
    font-family: 'Jost';
    font-size: 18px !important;
}

.rate-slider {
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column-reverse;
    gap: 20px;
    background: #17171c;
    border: solid 1px #22222a;
    border-radius: 10px;
    padding: 10px !important;
}

.rate-slider input[type="range"] {
    width: 100%;
    height: 4px;
    background: #3A3A42;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.rate-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #FAFAFA;
    border-radius: 50%;
    cursor: pointer;
}

.rate-value {
    margin-top: 10px;
    color: #f9f9ff;
    font-family: 'Jost';
    font-size: 18px;
    text-align: center;
}

button, input {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

button:focus, input:focus {
    outline: none;
}

.create-project-btn, .menu-item, .action-button, .close-button, .settings-toggle {
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

.project-card-divider {
    width: calc(100% + 40px);
    height: 1px;
    margin: 0 -20px;
    background: #26262b;
}

.popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

.delete-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 8px 16px;
    width: 100%;
    height: 50px;
    background: #9941401a;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    color: #c66664;
    font-family: 'Jost';
    font-size: 18px;
    transition: background-color 0.2s ease-in-out;
}

.delete-button:hover {
    background: #99414034;
}

.delete-icon {
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ec8784' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6'/%3E%3Cpath d='M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.hours-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.counter-button {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: #3A3A42;
    color: #FAFAFA;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease-in-out;
}

.counter-button:hover {
    background: #4D4D55;
}

.hours-value {
    font-family: 'Jost';
    font-size: 18px;
    color: #FAFAFA;
    min-width: 60px;
    text-align: center;
}

.add-hours-button {
    width: 100%;
    height: 50px;
    background: #efeff8;
    border: none;
    border-radius: 10px;
    color: #0e0e11;
    font-family: 'Jost';
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.add-hours-button:hover {
    background: #F5F5F5;
}

.project-card-total .last-update {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.project-card-total .last-update span {
    color: #9d9da7;
    font-size: 16px;
    line-height: 20px;
    opacity: 1;
}

/* Base styles for all interactive elements */
.create-project-btn,
.menu-item,
.settings-item,
.action-button,
.counter-button,
.create-button,
.delete-button,
.project-card-settings,
.close-button,
.color-select button {
    transition: transform 0.2s ease-in-out;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
}

.create-project-btn:active,
.menu-item:active,
.settings-item:active,
.action-button:active,
.action-button.primary:active,
.create-button:active,
.delete-button:active,
.project-card-settings:active,
.close-button:active,
.color-select button:active {
    transform: scale(0.96);
    transition: transform 0.08s ease-out;
}

.counter-button:active {
    transform: scale(0.92);
    transition: transform 0.08s ease-out;
}

/* Optimize animations for mobile */
@media (hover: none) and (pointer: coarse) {
    .create-project-btn,
    .menu-item,
    .settings-item,
    .action-button,
    .counter-button,
    .create-button,
    .delete-button,
    .project-card-settings,
    .close-button,
    .color-select button {
        transition: transform 0.08s ease-out;
    }

    .create-project-btn:active,
    .menu-item:active,
    .settings-item:active,
    .action-button:active,
    .action-button.primary:active,
    .create-button:active,
    .delete-button:active,
    .project-card-settings:active,
    .close-button:active,
    .color-select button:active {
        transform: scale(0.96);
    }

    .counter-button:active {
        transform: scale(0.92);
    }
}

/* Remove hover effects on mobile */
@media (hover: none) {
    .create-project-btn:hover,
    .menu-item:hover,
    .settings-item:hover,
    .action-button:hover,
    .create-button:hover,
    .delete-button:hover {
        transform: none;
    }
}

.timer-projects-list {
    padding: 20px;
}

.timer-projects-list h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.timer-projects {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.timer-project-item {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timer-project-color {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 15px;
}

.timer-project-info {
    flex: 1;
}

.timer-project-info h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.timer-project-info span {
    font-size: 14px;
    color: #666;
}

.start-timer, .stop-timer {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.start-timer:hover, .stop-timer:hover {
    opacity: 0.9;
}

.timer-display {
    font-size: 46px;
    font-weight: 100;
    color: #f9f9ff;
    margin-bottom: 20px;
    font-family: 'Jost', sans-serif;
}

.timer-display .milliseconds {
    font-size: 30px;
    opacity: 0.7;
    min-width: 1.2em;
    display: inline-block;
    
}

.icon-flag {
    background-image: url('../img/icons/ic_flag_light.svg');
}

.time-marks-container {
    width: 100%;
    margin-top: 20px;
    background: #151519;
    /* border: solid 1px #28282e; */
    border-radius: 10px;
    overflow: hidden;
}

.toggle-marks-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px;
    background: none;
    border: none;
    color: #aaaab2;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'Jost';
}

.toggle-marks-button:hover {
    background: #151519;
}

.toggle-marks-button .arrow-icon {
    width: 24px;
    height: 24px;
    background: url('../img/icons/ic_arrow_down_light.svg') center no-repeat;
    transition: transform 0.2s ease;
}

.toggle-marks-button.expanded .arrow-icon {
    transform: rotate(180deg);
}

.time-marks-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.time-marks-list.expanded {
    max-height: 300px;
    overflow-y: auto;
}

/* Стилизация скроллбара */
.time-marks-list::-webkit-scrollbar {
    width: 4px;
}

.time-marks-list::-webkit-scrollbar-track {
    background: #151519;
}

.time-marks-list::-webkit-scrollbar-thumb {
    background: #28282e;
    border-radius: 2px;
}

.time-marks-list::-webkit-scrollbar-thumb:hover {
    background: #3a3a42;
}

.time-mark {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 12px 15px;
    border-top: 1px solid #28282e;
    transition: background-color 0.2s ease;
}

.time-mark:hover {
    background: rgba(255, 255, 255, 0.02);
}

.time-mark-info {
    display: flex;
    flex-direction: column;
    /* gap: 4px; */
}

.time-mark-time {
    color: #efeff8;
    font-size: 16px;
}

.time-mark-date {
    color: #4d4d55;
    font-size: 16px;
}

.time-mark-duration {
    color: #efeff8;
    font-size: 16px;
    font-weight: 400;
    padding: 5px 10px;
    background: linear-gradient(225deg, #1e1e23c7 0%, #2727341a 100%);
    border: solid 1px #2c2c33;
    border-radius: 10px;
    /* height: 50px; */
    display: flex;
    align-items: center;
    min-width: 35%;
    justify-content: center;
}

.delete-mark {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    background: url('../img/icons/ic_delete_light.svg') center no-repeat;
}

.delete-mark:hover {
    opacity: 1;
}

.no-projects-timer {
    text-align: center;
    padding: 40px 20px;
}

.no-projects-timer p {
    color: #666;
    margin-bottom: 20px;
}

.project-hours-editor {
    margin: 20px 0;
    padding: 15px;
    background: #2c2c33;
    border-radius: 10px;
}

.project-hours-editor h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #FAFAFA;
}

.hours-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #17171c;
    border-radius: 10px;
    padding: 10px;
    border: solid 1px #22222a;
}

.hours-counter button {
    background: #17171c;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    width: 40px;
    border-radius: 10px;
    transition: background-color 0.2s;
    justify-content: center;
    opacity: 0.5;
}

.hours-counter button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hours-counter button img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.hours-counter .time-value {
    color: #FAFAFA;
    font-family: 'Jost';
    font-size: 18px;
    font-weight: 400;
    min-width: 160px;
    text-align: center;
}

.dark-theme .project-hours-editor {
    background: #2c2c33;
}

.dark-theme .project-hours-editor h3,
.dark-theme .hours-counter .time-value {
    color: #FAFAFA;
}

.dark-theme .hours-counter button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.input-group {
    margin-bottom: 0px;
}

.input-group label {
    display: block;
    color: #efeff8;
    margin-bottom: 8px;
    font-size: 14px;
}

.comment-input {
    width: 100%;
    min-height: 80px;
    background: #1e1e23;
    border: 1px solid #2a2a30;
    border-radius: 10px;
    color: #efeff8;
    padding: 10px;
    font-family: 'Jost';
    resize: vertical;
    transition: border-color 0.2s ease;
    font-size: 14px;
}

.comment-input:focus {
    outline: none;
    border-color: #4b149e;
}

.entry-comment {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 15px;
    background: #17171c;
    border-radius: 10px;
}

.entry-comment img {
    margin-top: 2px;
}

.entry-comment span {
    color: #9d9da7;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.entries {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out;
    opacity: 0;
    transform-origin: top;
    will-change: max-height, opacity;
}

.entries.expanded {
    max-height: 1000px;
    opacity: 1;
}

.toggle-history-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px;
    background: none;
    border: none;
    color: #efeff8;
    cursor: pointer;
    transition: background-color 0.2s ease;
    will-change: background-color;
}

.toggle-history-button:hover {
    background: rgba(255, 255, 255, 0.05);
}

.toggle-history-button .arrow-up,
.toggle-history-button .arrow-down {
    position: absolute;
    transition: opacity 0.2s ease, transform 0.2s ease;
    will-change: opacity, transform;
}

.toggle-history-button .arrow-up {
    opacity: 0;
    transform: translateY(5px);
}

.toggle-history-button .arrow-down {
    opacity: 1;
    transform: translateY(0);
}

.toggle-history-button.expanded .arrow-up {
    opacity: 1;
    transform: translateY(0);
}

.toggle-history-button.expanded .arrow-down {
    opacity: 0;
    transform: translateY(-5px);
}

.hour-entry {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.2s forwards;
    animation-delay: calc(var(--entry-index) * 0.03s);
    will-change: transform, opacity;
}

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

.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: linear-gradient(75deg, #0e0e11, #151519);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    justify-content: center;
    border: solid 1px #28282e;
}

.timer-display {
    font-size: 46px;
    font-weight: 100;
    color: #f9f9ff;
    margin-bottom: 20px;
    font-family: 'Jost', sans-serif;
    display: flex;
    flex-direction: row;
    align-items: baseline;
}

.timer-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.timer-btn {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: none;
    background: #1e1e23;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.timer-icon {
    width: 24px;
    height: 24px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.icon-play {
    background-image: url('../img/icons/ic_play_light.svg');
}

.icon-stop {
    background-image: url('../img/icons/ic_stop_light.svg');
}

.icon-refresh {
    background-image: url('../img/icons/ic_refresh_light.svg');
}

.timer-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.timer-btn:hover:not(:disabled) {
    background: #3a3a40;
    transform: scale(1.05);
}

.timer-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.icon-timer::before {
    content: none;
}

.menu-item.active .icon-timer::before {
    opacity: 1;
}

.toggle-marks-button .left-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.time-marks-count {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
    min-width: 32px;
    height: 32px;
    background: #1e1e23;
    border-radius: 10px;
    color: #aaaab2;
    font-size: 14px;
    line-height: 17px;
    font-weight: 500;
}

.clear-all-marks-button {
    width: -webkit-fill-available;
    padding: 12px;
    margin-top: 10px;
    background: hsl(240deg 6% 11% / 0%);
    border: 1px solid #1e1e23;
    border-radius: 10px;
    color: #aaaab2;
    font-family: 'Jost';
    font-size: 14px;
    display: none;  /* Hidden by default */
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 10px;
}

/* Update the selector to require both classes */
.time-marks-list.expanded.has-marks + .clear-all-marks-button {
    display: flex;  /* Show only when list is expanded and has marks */
}

.clear-all-marks-button:hover {
    background: #28282e;
    border-color: #323238;
}

.clear-all-marks-button img {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

/* Tasks styles */
.tasks-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #17171c77;
    border-radius: 10px;
    margin-top: 10px;
    transition: background-color 0.2s ease;
    width: 100%;
    height: 50px;
    border: solid 1px #22222a;
}

.tasks-section .left-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #efeff8;
}

.tasks-section .right-content {
    display: flex;
    align-items: center;
}

.tasks-section .right-content img {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.tasks-section:hover {
    background: #1e1e23;
}

.tasks-count {
    background: linear-gradient(225deg, #1e1e23c7 0%, #2727341a 100%);
    color: #efeff8;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 14px;
    min-width: 20px;
    text-align: center;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tasks-dialog {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 450px;
    height: 100%;
    background: #0e0e11;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding-bottom: var(--safe-bottom-ui);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
    box-sizing: border-box;
}

.tasks-dialog.active {
    transform: translateX(0);
}

.tasks-dialog-header {
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    padding-top: calc(20px + var(--safe-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1E1E23;
}

.tasks-dialog-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tasks-dialog-header-left h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tasks-dialog-header h2 {
    font-size: 20px;
    font-weight: 500;
    color: #efeff8;
}

.tasks-tabs {
    display: flex;
    flex-shrink: 0;
    padding: 5px;
    border: 1px solid #22222a;
    border-radius: 10px;
    margin: 10px 20px 0 20px;
}

.task-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    color: #8e8e93;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.task-tab img {
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.task-tab .count {
    background: transparent;
    color: #8e8e93;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.15s ease;
}

.task-tab.active {
    color: #f9f9ff;
    background: #17171c;
    border-radius: 6px;
    border: solid #22222a 1px;
}

.task-tab.active img {
    opacity: 1;
}

.task-tab.active .count {
    background: #25252a;
    color: #f9f9ff;
}

.task-tab:not(.active)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #4a4a57;
    transform: scaleX(0);
    transition: none;
}

.task-tab:hover:not(.active) {
    color: #b5b5bd;
}

.task-tab:hover:not(.active) img {
    opacity: 0.85;
}

.task-tab:hover:not(.active)::after {
    transform: scaleX(0);
}

.tasks-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.task-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #151519;
    border-radius: 10px;
    margin-bottom: 12px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    border: solid 1px #1e1e23;
    word-break: break-word;
    flex-direction: column;
    align-items: flex-start;
}

.task-item.completing {
    transform: translateX(100%);
    opacity: 0;
}

.task-checkbox {
    width: 36px;
    height: 36px;
    border: 1px solid #22222a;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
    background: #151519;
}

.task-checkbox:hover {
    border-color: #3a3a42;
    background: #1e1e23;
}

/* Убираем старые стили для чекбокса */
.task-checkbox.checked {
    background: transparent;
    border: none;
}

.task-checkbox.checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: url('../img/icons/ic_restore_light.svg') no-repeat center;
    background-size: contain;
    opacity: 0.7;
}

.task-checkbox.checked:hover::after {
    opacity: 1;
}

.task-input-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: calc(100% - 40px);
    max-width: 400px;
    padding: 20px;
    border-radius: 10px;
    background: #151519;
    border: 1px solid #2c2c33;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    min-height: 40%;
}

.task-input-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.task-input-popup .popup-header h3 {
    color: #efeff8;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

.task-input-popup .close-button {
    width: 24px;
    height: 24px;
    background: url('../img/icons/ic_close_light.svg') no-repeat center;
    background-size: 24px;
    border: none;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.task-input-popup .close-button:hover {
    opacity: 1;
}

.task-input-popup textarea {
    width: 100%;
    min-height: 180px;
    background: #1e1e23;
    border: 1px solid #2a2a30;
    border-radius: 10px;
    color: #efeff8;
    padding: 10px;
    font-family: 'Jost';
    resize: vertical;
    transition: border-color 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 20px;
}

.task-input-popup textarea::placeholder {
    color: #45454D;
}

.task-input-popup textarea:focus {
    outline: none;
    border-color: #4d4d55;
}

.task-input-popup .confirm-button {
    width: 100%;
    height: 50px;
    background: #efeff8;
    border: none;
    border-radius: 10px;
    color: #0e0e11;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.task-input-popup .confirm-button:hover {
    background: #ffffff;
}

.task-input-popup.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.task-input-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgb(11 11 13 / 65%);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
    padding: var(--safe-top) var(--safe-right) var(--safe-bottom-ui) var(--safe-left);
    box-sizing: border-box;
}

.task-input-overlay.active {
    opacity: 1;
}

/* Стили для задач */
.task-content {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.task-title {
    color: #efeff8;
    margin-bottom: 15px;
    font-size: 16px;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.task-date {
    color: #8e8e93 !important;
    font-size: 14px !important;
}

/* Стили для завершенных задач */
.task-item.completed {
    opacity: 0.8;
}

.task-item.completed .task-title {
    color: #8e8e93;
    text-decoration: line-through;
}

.task-item.completed .task-date {
    color: #666;
}

.task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.task-action-button {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    border-radius: 4px;
    width: 36px;
    height: 36px;
    filter: grayscale(1);
}

.task-action-button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.add-task-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #efeff8;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.add-task-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.add-task-button:active {
    transform: scale(0.95);
}

.add-task-button img {
    width: 32px;
    height: 32px;
    opacity: 1;
}


.task-header {
    width: 100%;

}

.task-category {
    border-radius: 5px !important;
    font-size: 14px !important;
    padding: 5px 10px !important;
    margin-bottom: 15px !important;
}

.category-input {
    width: 100% !important;
    border-radius: 10px !important;
}


.category-input-group {
    display: flex;
    gap: 10px;
    flex-direction: column;
    margin-bottom: 15px;
}

/* Categories manager button in tasks dialog header */
.categories-manager-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.categories-manager-btn:hover {
    opacity: 1;
}

.categories-manager-btn img {
    width: 24px;
    height: 24px;
}

/* Delete all completed button */
.delete-completed-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    margin: 8px 0 16px;
    background: transparent;
    border: 1px solid #2a2a30;
    border-radius: 10px;
    color: #8e8e93;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-completed-btn:hover {
    border-color: #c0392b;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.06);
}

.delete-completed-btn img {
    opacity: 0.7;
}

.delete-completed-btn:hover img {
    opacity: 1;
}

/* Archive section */
.archive-section {
    margin-bottom: 8px;
    border-bottom: 1px solid #1e1e23;
}

.archive-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.archive-toggle-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8e8e93;
    font-family: 'Jost', sans-serif;
    font-size: 15px;
}

.archive-toggle-btn:hover .archive-toggle-left {
    color: #b5b5bd;
}

.archive-count {
    background: #151519;
    color: #8e8e93;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 13px;
    min-width: 24px;
    text-align: center;
}

.archive-arrow {
    width: 20px;
    height: 20px;
    background: url('../img/icons/ic_arrow_down_light.svg') no-repeat center;
    background-size: contain;
    opacity: 0.5;
    transition: transform 0.25s ease;
}

.archive-arrow.expanded {
    transform: rotate(180deg);
}

.archive-list {
    display: none;
    flex-direction: column;
}

.archive-list.expanded {
    display: flex;
}

.archived-item {
    opacity: 0.65;
    border-color: #1a1a1f !important;
}

.archived-item .task-title {
    text-decoration: line-through;
    color: #6e6e76 !important;
}

/* Category manager modal */
.category-manager-modal {
    max-height: 80vh;
    overflow-y: auto;
    padding-bottom: 10px;
}

.categories-manager-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.category-manager-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #28282e;
    border-radius: 10px;
}

.cat-color-dot {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
}

.cat-name-display {
    flex: 1;
    color: #efeff8;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.cat-rename-input {
    flex: 1;
    background: #151519;
    border: 1px solid #3a3a42;
    color: #efeff8;
    padding: 6px 10px;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    outline: none;
    border-radius: 10px;
    min-width: 0;
}

.cat-rename-input:focus {
    border-color: #5a5a6a;
}

/* Category edit mode */
.category-manager-item.cat-edit-mode {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    background: #151519;
    border-color: #35353d;
}

.cat-edit-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-edit-color-preview {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
}

.cat-edit-color-name {
    flex: 1;
    color: #efeff8;
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-edit-bottom-row {
    display: flex;
    align-items: center;
    gap: 6px;
}


