@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #0e0e0e;
    --panel-color: rgba(20, 20, 20, 0.7);
    --panel-solid: #141414;
    --accent-color: #FFFFFF;
    --text-primary: #FFFFFF;
    --btn-color: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.5);
}

/* Base Setup */
body {
    background-color: var(--bg-color);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: auto;
    min-height: 100vh;
    margin: 0;
}

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

/* Premium Glass Panel with Glint Effect */
.glass-panel {
    background: var(--panel-color);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border-radius: 20px;
    position: relative;
    border: none;
    box-shadow: none;
    /* Removed shadows as requested */
    transition: all 0.3s cubic-bezier(0.1, 0.5, 0.1, 1);
}

/* Restore the Glint Effect - Exactly as in reference project */
.glass-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(255, 255, 255, 0.05) 75%,
            rgba(255, 255, 255, 0.15) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

/* Toggle for removing liquid glass effect */
body.no-glass-effect .glass-panel::before,
body.no-glass-effect .language-dropdown-btn::before,
body.no-glass-effect .dropdown-menu::before,
body.no-glass-effect #selectedTimeBadge::before,
body.no-glass-effect .custom-picker-container::before,
body.no-glass-effect .quick-time-btn::before {
    display: none !important;
}

/* App View Sections */
.view-section::-webkit-scrollbar {
    display: none;
}

.view-section {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 10;
    visibility: hidden;
    opacity: 0;
    overflow-y: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

/* Safe Area Padding for PWA */
#tasksView .max-w-md,
#settingsView .max-w-md {
    padding-top: calc(20px + env(safe-area-inset-top));
}

.view-section.active {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 20;
}

#tasksView::after {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: var(--bg-color);
    -webkit-mask-image: linear-gradient(to top, black 10%, transparent 100%);
    mask-image: linear-gradient(to top, black 10%, transparent 100%);
    pointer-events: none;
    z-index: 30;
}

/* Icon Buttons */
.icon-btn {
    transition: transform 0.2s cubic-bezier(0.1, 0.5, 0.1, 1), opacity 0.2s ease;
}

.icon-btn:active {
    transform: scale(0.9);
}

/* Floating Action Button */
.fab-btn {
    position: fixed;
    bottom: calc(30px + env(safe-area-inset-bottom));
    right: 20px;
    width: 52px;
    height: 52px;
    background: #FFFFFF;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    color: #000000;
    z-index: 999;
    transition: transform 0.2s cubic-bezier(0.1, 0.5, 0.1, 1), opacity 0.3s ease;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.fab-btn.visible {
    display: flex;
}

.fab-btn:active {
    transform: scale(0.88);
}

/* Input Modal Overlay */
#inputOverlay,
#syncOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    /* Darkened to prevent bloom */
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    visibility: hidden;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none;
}

#inputOverlay.active,
#syncOverlay.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.input-sheet {
    width: 100%;
    max-width: 500px;
    background: var(--panel-solid, #121212);
    border-radius: 24px 24px 0 0;
    padding: 12px 20px 45px 20px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: none;
    /* Removed shadows as requested */
    will-change: transform;
    touch-action: none;
}

#inputOverlay.active .input-sheet,
#syncOverlay.active .input-sheet {
    transform: translateY(0);
}

.input-sheet.dragging {
    transition: none;
}

.drag-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 0 auto 16px auto;
}

/* Input Styling */
.task-input {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-primary);
    outline: none;
    border-radius: 16px;
    padding: 16px 20px;
    width: 100%;
    font-size: 1rem;
    font-weight: 400;
    appearance: none;
    -webkit-appearance: none;
}

/* iOS Style Drum Picker */
.custom-picker-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 0 10px;
    /* Reduced vertical padding to allow clean collapse */
    margin-top: 5px;
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease,
        padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.custom-picker-container::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(255, 255, 255, 0.05) 75%,
            rgba(255, 255, 255, 0.15) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

.custom-picker-container.show {
    grid-template-rows: 1fr;
    opacity: 1;
    padding: 15px 10px;
}

.picker-content {
    min-height: 0;
}

.picker-wheels {
    display: flex;
    justify-content: space-between;
    height: 140px;
    position: relative;
    overflow: hidden;
    mask-image: linear-gradient(to bottom,
            transparent 0%,
            black 30%,
            black 70%,
            transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom,
            transparent 0%,
            black 30%,
            black 70%,
            transparent 100%);
}

.picker-selection-bar {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-50%);
    border-radius: 10px;
    pointer-events: none;
    z-index: 0;
}

.picker-column {
    flex: 1;
    height: 100%;
    z-index: 1;
    perspective: 1000px;
    overflow-x: hidden;
}

.picker-wheel {
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 52px 0;
    /* (height 140 - item 36) / 2 */
    touch-action: pan-y;
}

.picker-wheel::-webkit-scrollbar {
    display: none;
}

.picker-item {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.4);
    scroll-snap-align: center;
    transition: all 0.2s ease;
    user-select: none;
}

.picker-item.active {
    color: #FFFFFF;
    font-weight: 600;
    transform: scale(1.1);
}

.quick-time-btn {
    height: 42px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.quick-time-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(255, 255, 255, 0.05) 75%,
            rgba(255, 255, 255, 0.15) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

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

.quick-time-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.quick-time-btn svg {
    opacity: 0.7;
}

.quick-time-btn.active svg {
    opacity: 1;
}

#selectedTimeBadge {
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
}

#selectedTimeBadge::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(255, 255, 255, 0.05) 75%,
            rgba(255, 255, 255, 0.15) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

#selectedTimeBadge.hidden {
    display: none;
    opacity: 0;
    transform: translateY(-5px);
}

#selectedTimeBadge:not(.hidden) {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Language Dropdown */
.language-selector {
    position: relative;
    width: 100%;
}

.language-dropdown-btn {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 16px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.language-dropdown-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(255, 255, 255, 0.05) 75%,
            rgba(255, 255, 255, 0.15) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

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

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #1a1a1a !important;
    /* Solid dark color since blur is removed */
    border-radius: 18px;
    z-index: 500;
    display: block;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.1, 0.5, 0.1, 1);
    -webkit-transform: translate3d(0, -10px, 0);
    transform: translate3d(0, -10px, 0);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-menu::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(255, 255, 255, 0.05) 75%,
            rgba(255, 255, 255, 0.15) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

.dropdown-menu.show {
    max-height: 300px;
    opacity: 1;
    visibility: visible;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.dropdown-content {
    min-height: 0;
}

.dropdown-item {
    width: 100%;
    padding: 14px 16px;
    text-align: left;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.dropdown-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.task-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    display: block;
    font-weight: 300;
}

/* Premium Button Styling - Moderately rounded, not pill */
.btn-premium {
    width: 100%;
    padding: 14px;
    border-radius: 18px;
    /* Moderately rounded as requested */
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.1, 0.5, 0.1, 1);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--btn-color, #FFFFFF);
    color: #000000;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    /* Grayish transparent */
    color: #FFFFFF;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-premium:active {
    transform: scale(0.96);
}

/* Settings Color Params - No border/underline as requested */
.color-input-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    background: transparent;
    border: none;
}

.color-picker {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
    padding: 0;
}

/* Task Item */
.task-item {
    padding: 18px;
    margin-bottom: 12px;
    position: relative;
    border-radius: 20px;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    /* Smooth, bouncy return when released */
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.5s ease, opacity 0.3s ease;
}

.task-item.pressing {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.1);
    /* Very fast down transition so it doesn't feel sluggish */
    transition: transform 0.1s ease-out, background 0.1s ease-out;
}

.task-checkbox-circle {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.task-checkbox:checked+.task-checkbox-circle {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.task-checkbox:checked+.task-checkbox-circle+.checkmark svg {
    color: #000;
}


/* Animations */
@keyframes fadeInTask {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.animate-fade-in {
    animation: fadeInTask 0.6s cubic-bezier(0.1, 0.5, 0.1, 1) forwards;
}

@keyframes fadeOutTask {
    0% {
        opacity: 1;
        transform: scale(1);
        margin-bottom: 12px;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    100% {
        opacity: 0;
        transform: scale(0.95);
        height: 0;
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}


.task-item.new-task {
    animation: fadeInTask 0.4s cubic-bezier(0.1, 0.5, 0.1, 1) forwards;
}

.task-item.deleting {
    animation: fadeOutTask 0.3s cubic-bezier(0.1, 0.5, 0.1, 1) forwards;
    overflow: hidden;
    pointer-events: none;
}

/* Checkmark fade */
.checkmark {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease !important;
    opacity: 0;
}

.peer:checked~.checkmark {
    opacity: 1 !important;
}

@property --strike {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 0%;
}

@keyframes strike {
    from {
        --strike: 0%;
    }

    to {
        --strike: 100%;
    }
}

@keyframes taskFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.5;
    }
}

@keyframes taskFadeIn {
    from {
        opacity: 0.5;
    }

    to {
        opacity: 1;
    }
}

/* Checkbox Circle Animations */
@keyframes fillCheckbox {
    from {
        background-color: transparent;
        border-color: rgba(255, 255, 255, 0.1);
    }

    to {
        background-color: var(--accent-color);
        border-color: var(--accent-color);
    }
}

@keyframes emptyCheckbox {
    from {
        background-color: var(--accent-color);
        border-color: var(--accent-color);
    }

    to {
        background-color: transparent;
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Checkmark Fade Animations */
@keyframes checkmarkFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes checkmarkFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.task-completed-anim {
    animation: taskFadeOut 0.2s ease forwards;
}

.task-uncompleted-anim {
    animation: taskFadeIn 0.2s ease forwards;
}


/* Task Text & Line-through */
.task-text {
    position: relative;
    display: inline;
    transition: color 0.2s ease, opacity 0.2s ease;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;

    /* We use linear gradient color stops to animate to avoid the Chrome percentage background-size bug on multiline fragments */
    background-image: linear-gradient(to right, currentColor var(--strike, 0%), transparent var(--strike, 0%));
    background-position: 0% 55%;
    background-repeat: no-repeat;
    background-size: auto 1.5px;
}

/* We'll use this class for the one that was just clicked */
.task-text.animate-strike {
    animation: strike 0.2s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

.task-text.completed {
    opacity: 0.3;
    text-decoration: none !important;
    --strike: 100%;
}

/* Notification Prompt Curtain */
.notification-prompt {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.notification-prompt.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.notification-content {
    width: 100%;
    max-width: 450px;
    margin: 16px;
    margin-bottom: calc(16px + env(safe-area-inset-bottom));
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.1, 0.5, 0.1, 1);
}

.notification-prompt.show .notification-content {
    transform: translateY(0);
}


/* Removed Ambient Background Light */

/* Custom Pull to Refresh */
body {
    overscroll-behavior-y: none;
}

.ptr-container {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

.ptr-spinner {
    width: 36px;
    height: 36px;
    background: #1c1c1c;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    box-shadow: none;
}

.ptr-spinner svg {
    width: 20px;
    height: 20px;
    transform: rotate(0deg);
}

.ptr-container.refreshing .ptr-spinner svg {
    animation: ptrSpin 1s linear infinite;
    color: var(--accent-color);
}

@keyframes ptrSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.tasks-content {
    position: relative;
    z-index: 20;
    will-change: transform;
}