:root {
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

    --color-primary: var(--tg-theme-button-color, #007aff);
    --color-success: #34c759;
    --color-danger: #ff3b30;
    --color-warning: #ff9500;
}

body.dark-theme {
    --glass-bg: rgba(30, 30, 30, 0.45);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

body {
    background-color: var(--tg-theme-secondary-bg-color, #f4f4f9);
    color: var(--tg-theme-text-color, #222);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 20px;
    padding-top: 10px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Animated Blobs */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    opacity: 0.6;
    animation: float 10s infinite alternate ease-in-out;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: #4facfe;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 250px;
    height: 250px;
    background: #00f2fe;
    bottom: 50px;
    right: -50px;
    animation-delay: -2s;
}

.blob-3 {
    width: 200px;
    height: 200px;
    background: #fdfbfb;
    top: 40%;
    left: 40%;
    animation-delay: -5s;
}

body.dark-theme .blob-1 {
    background: #1a2980;
}

body.dark-theme .blob-2 {
    background: #26d0ce;
}

body.dark-theme .blob-3 {
    background: #333333;
}

@keyframes float {
    0% {
        transform: translateY(0px) scale(1);
    }

    100% {
        transform: translateY(30px) scale(1.1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Base Glass Element */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px 0 rgba(31, 38, 135, 0.2);
}

.glass-element {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

body.dark-theme .glass-element {
    background: rgba(0, 0, 0, 0.2);
}

/* Header */
.main-header {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 10px 0 20px 0;
    margin-bottom: 0px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bot-icon {
    font-size: 42px;
    color: var(--color-primary);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    padding: 12px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.main-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 5px;
}

.badge.bg-success {
    background: rgba(52, 199, 89, 0.2);
    color: var(--color-success);
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.badge.bg-warning {
    background: rgba(255, 149, 0, 0.2);
    color: var(--color-warning);
    border: 1px solid rgba(255, 149, 0, 0.3);
}

/* Typography */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.panel-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h2 i {
    color: var(--color-primary);
}

.text-primary {
    color: var(--color-primary);
}

.text-success {
    color: var(--color-success);
}

.text-danger {
    color: var(--color-danger);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-box {
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.stat-box:hover {
    background: rgba(255, 255, 255, 0.4);
}

body.dark-theme .stat-box:hover {
    background: rgba(255, 255, 255, 0.05);
}

.stat-box i {
    font-size: 20px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 11px;
    opacity: 0.7;
}

.stat-value {
    font-weight: 700;
    font-size: 15px;
}

/* Inputs and Buttons */
.input-group {
    display: flex;
    gap: 10px;
    padding: 5px;
}

.glass-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 15px;
    color: var(--tg-theme-text-color);
    font-family: inherit;
    outline: none;
}

.glass-input::placeholder {
    color: var(--tg-theme-hint-color);
}

.btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
}

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

.btn-primary {
    background: var(--color-primary);
    color: var(--tg-theme-button-text-color, #fff);
    border-radius: 10px;
    padding: 0 18px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
}

.btn-glass {
    background: var(--glass-bg);
    color: var(--tg-theme-text-color);
    border: 1px solid var(--glass-border);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.6);
}

.btn-upload {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 15px;
    gap: 10px;
}

.btn-danger-text {
    background: transparent;
    color: var(--color-danger);
    font-size: 18px;
}

/* Lists */
.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-item-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
}

/* Tasks */
.task-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 15px;
}

.task-item.done {
    opacity: 0.6;
}

.task-item.done .task-text {
    text-decoration: line-through;
}

.task-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.task-text {
    word-break: break-word;
    margin-top: 2px;
}

/* Custom Checkbox */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 24px;
    cursor: pointer;
    font-size: 22px;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: rgba(255, 255, 255, 0.3);
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    transition: all 0.2s;
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--color-primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Settings Toggle */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.setting-info {
    display: flex;
    flex-direction: column;
}

.setting-info span {
    font-size: 12px;
    opacity: 0.7;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--glass-border);
    transition: .4s;
}

body.dark-theme .slider {
    background-color: rgba(255, 255, 255, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--color-success);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Activity Feed */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid rgba(0, 122, 255, 0.3);
    margin-left: 10px;
}

.activity-item {
    position: relative;
    padding: 10px 15px;
    margin-left: 15px;
    margin-bottom: 10px;
}

.action-dot {
    position: absolute;
    left: -23.5px;
    top: 13px;
    color: var(--color-primary);
    background: var(--glass-bg);
    border-radius: 50%;
}

.hint {
    text-align: center;
    padding: 15px;
    opacity: 0.6;
    font-size: 14px;
}

/* Loaders */
#loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 122, 255, 0.2);
    border-left-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 122, 255, 0.2);
    border-left-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 380px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}