:root {
    --bg-color: #000000;
    --accent-color: #f5deb3;
    --text-color: #ffffff;
    --accent-text-color: rgb(241, 106, 80);
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    font-family: 'Satoshi', sans-serif;
    background: linear-gradient(to right, #1a1a1a 0%, #1a1a1a 15rem, #000000 25rem, #000000 100%);
    background-attachment: fixed;
}

nav {
    width: 15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.top {
    flex-grow: 0;
}

.middle {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    align-items: flex-start;
}

.bottom {
    flex-grow: 0;
}

nav a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 10rem;
    padding: 12px 20px;
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    background-color: transparent;
    text-decoration: none;
    color: var(--accent-text-color);
    outline: none;

    transform-origin: center;
    transition: transform 160ms cubic-bezier(.2, 1, .3, 1), box-shadow 160ms cubic-bezier(.2, 1, .3, 1);
    will-change: transform, box-shadow;
    overflow: visible;
    gap: 12px;
}

nav a::after {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 8px;
    height: 2px;
    background: var(--accent-color);
    transform-origin: left center;
    transform: scaleX(0);
    opacity: 0.95;
    border-radius: 2px;
    transition: transform 220ms cubic-bezier(.2, 1, .3, 1), opacity 160ms;
    pointer-events: none;
}

nav a:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

nav a:hover::after {
    transform: scaleX(1);
}

.nav-icon {
    /* Hidden by default on Desktop */
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(245, 222, 179, 0.4);
    background-color: rgba(245, 222, 179, 0.08);
    flex-shrink: 0;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
}

.nav-label {
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--accent-text-color);
}

main {
    flex: 1;
    padding: 40px;
    color: var(--text-color);
}

main h1 {
    margin: 0 0 20px 0;
    font-size: 2.5rem;
}

main p {
    font-size: 1rem;
    line-height: 1.6;
}


main h1 {
    color: var(--accent-text-color);
}

#credits {
    color: var(--accent-color);
}


#arrow {
    width: 50rem;
    margin-top: -13rem;
    margin-left: 1rem;
}

.content-section {
    display: block;
    animation: fadeInScale 500ms ease-out forwards;
}

.content-section.hiding {
    animation: fadeOutScale 400ms ease-in forwards;
}

.hidden {
    display: none !important;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.section-header p {
    max-width: 620px;
}

#habits-section h1 {
    color: var(--accent-text-color);
    margin-top: 0;
}

#habits-section h2 {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-top: -10px;
}

.new-habit-btn {
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-text-color);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Satoshi', sans-serif;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.new-habit-btn:hover {
    background-color: rgba(245, 222, 179, 0.1);
}

.habit-form {
    border: 1px solid var(--accent-color);
    border-radius: 15px;
    padding: 20px;
    background-color: rgba(245, 222, 179, 0.05);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    animation: formSlideDown 300ms ease-out forwards;
}

.habit-form.hidden {
    display: none;
}

.habit-form.closing {
    animation: formSlideUp 300ms ease-in forwards;
}

.modal-overlay {
    display: none;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: var(--accent-color);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--text-color);
    padding: 10px;
    border-radius: 5px;
    font-family: 'Satoshi', sans-serif;
    font-size: 0.9rem;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.days-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.days-selector label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    background-color: transparent;
    cursor: pointer;
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0;
    padding: 0;
    position: relative;
}

.days-selector input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.days-selector input[type="checkbox"]:checked+label {
    background-color: var(--accent-text-color);
    color: #000;
}

.days-selector label input[type="checkbox"] {
    display: none;
}

.save-btn,
.cancel-btn {
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid var(--accent-color);
    cursor: pointer;
    font-family: 'Satoshi', sans-serif;
    margin-right: 10px;
    font-size: 0.9rem;
}

.save-btn {
    background-color: var(--accent-text-color);
    color: #ffffff;
}

.cancel-btn {
    background-color: transparent;
    color: var(--accent-text-color);
}

.habits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.habit-box {
    position: relative;
    border: 1px solid var(--accent-color);
    border-radius: 15px;
    padding: 25px;
    background-color: rgba(245, 222, 179, 0.05);
    min-height: 250px;
    display: flex;
    flex-direction: column;
    animation: slideIn 300ms ease-out backwards;
    will-change: transform, opacity;
    transition: transform 400ms cubic-bezier(.2, 1, .3, 1), opacity 400ms cubic-bezier(.2, 1, .3, 1);
}

.habit-box:nth-child(1) {
    animation-delay: 0ms;
}

.habit-box:nth-child(2) {
    animation-delay: 100ms;
}

.habit-box:nth-child(3) {
    animation-delay: 200ms;
}

.habit-box:nth-child(4) {
    animation-delay: 300ms;
}

.habit-box:nth-child(5) {
    animation-delay: 400ms;
}

.habit-box:nth-child(n+6) {
    animation-delay: calc((var(--index, 5) - 5) * 100ms);
}

/* Body Section */
.body-day-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 40px;
    /* Increased spacing from top */
    padding-top: 16px;
    /* Added padding to prevent cropping */
    position: relative;
    z-index: 2;
    /* Ensure above other components */
}

/* Ensure selector-track is above buttons and not cropped */
.selector-track {
    position: absolute;
    z-index: 3;
    top: 0;
}

.body-day-selector button {
    padding: 12px 24px;
    border-radius: 18px;
    border: 2px solid rgba(245, 222, 179, 0.35);
    background-color: transparent;
    color: var(--text-color);
    font-weight: 600;
    text-transform: capitalize;
    cursor: pointer;
    transition: all 200ms cubic-bezier(.2, 1, .3, 1);
    will-change: transform;
    transform-origin: center bottom;
}

.body-day-selector button:hover {
    background-color: rgba(245, 222, 179, 0.07);
}

.body-day-selector button:active {
    transform: translateY(-1px) scale(0.98);
}

.body-day-selector button.active {
    background-color: rgba(245, 222, 179, 0.15);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

/* small smooth bouncy animation triggered by adding .bounce class */
@keyframes dayButtonBounce {
    0% {
        transform: translateY(0) scale(1);
    }

    30% {
        transform: translateY(-4px) scale(0.98);
    }

    55% {
        transform: translateY(2px) scale(1.03);
    }

    80% {
        transform: translateY(-1px) scale(0.995);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

.body-day-selector button.bounce {
    animation: dayButtonBounce 360ms cubic-bezier(.2, .9, .25, 1);
}

.body-day-selector button:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(245, 222, 179, 0.09);
}

.body-weekly-board {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.body-day-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.body-day-name {
    font-size: 1.6rem;
    color: var(--accent-color);
    letter-spacing: 0.04em;
}

.body-day-date {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
}

.body-exercise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    min-height: 200px;
}

.body-exercise-card {
    border: 2px solid rgba(245, 222, 179, 0.3);
    border-radius: 15px;
    padding: 24px;
    background-color: rgba(245, 222, 179, 0.04);
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 220px;
    animation: slideIn 300ms ease-out backwards;
    animation-delay: calc(var(--card-index, 0) * 80ms);
    transition: all 200ms cubic-bezier(.2, 1, .3, 1);
}

.body-exercise-card:hover {
    border-color: rgba(245, 222, 179, 0.5);
    background-color: rgba(245, 222, 179, 0.06);
}

.body-exercise-top {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.body-exercise-top h3 {
    margin: 0;
    font-size: 1.25rem;
}

.body-exercise-subtitle {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.95rem;
}

.body-type-pill {
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1.5px solid rgba(245, 222, 179, 0.5);
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
    background: rgba(245, 222, 179, 0.08);
}

.body-exercise-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.meta-pill {
    padding: 6px 12px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
}

.body-exercise-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.body-exercise-check {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    border: 2px solid var(--accent-color);
    background: transparent;
    position: relative;
    cursor: pointer;
    transition: all 200ms ease;
}

.body-exercise-check::after {
    content: "✓";
    position: absolute;
    /* center the check mark using top/left and translate - don't use inset (was causing offset) */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0) rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 1.4rem;
    font-weight: bold;
    opacity: 0;
    transition: transform 400ms cubic-bezier(.68, -.55, .265, 1.55), opacity 400ms cubic-bezier(.68, -.55, .265, 1.55);
}

.body-exercise-check:hover:not(:disabled) {
    border-color: var(--accent-text-color);
}

.body-exercise-check.checked {
    border-color: var(--accent-text-color);
    background: var(--accent-text-color);
    animation: checkPulse 400ms cubic-bezier(.68, -.55, .265, 1.55) forwards;
}

.body-exercise-check.checked::after {
    animation: checkmarkPop 400ms cubic-bezier(.68, -.55, .265, 1.55) forwards;
}

.body-exercise-check:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.body-empty-state {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 15px;
}

/* Exercise Modal */
.exercise-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}

.exercise-modal.hidden {
    display: none;
}

.exercise-modal-content {
    background-color: #0f0f0f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    width: min(520px, 100%);
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: var(--text-color);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    animation: modalPop 220ms cubic-bezier(.2, 1, .3, 1);
}

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

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.modal-field input,
.modal-body select,
.toggle-target {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 2px solid rgba(245, 222, 179, 0.25);
    background: rgba(245, 222, 179, 0.08);
    color: var(--text-color);
    font-family: 'Satoshi', sans-serif;
    font-size: 0.95rem;
    transition: all 200ms cubic-bezier(.2, 1, .3, 1);
    box-sizing: border-box;
}

.modal-field input {
    padding-right: 20px;
}

.modal-body select {
    appearance: none;
    padding-right: 40px;
    background-image: linear-gradient(45deg, transparent 50%, var(--accent-color) 50%), linear-gradient(135deg, var(--accent-color) 50%, transparent 50%);
    background-position: calc(100% - 14px) calc(50% + 2px), calc(100% - 10px) calc(50% + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
}

.modal-body select option {
    background: #1a1a1a;
    color: var(--text-color);
    padding: 8px;
}

.modal-field input:focus,
.modal-body select:focus,
.toggle-target:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(245, 222, 179, 0.12);
    box-shadow: 0 0 0 5px rgba(245, 222, 179, 0.18);
}

.modal-field input::placeholder,
.toggle-target::placeholder {
    color: rgba(245, 222, 179, 0.55);
    font-weight: 500;
}

.modal-toggle-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

.toggle-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(245, 222, 179, 0.4);
    border-radius: 6px;
    background: rgba(245, 222, 179, 0.06);
    cursor: pointer;
    transition: all 200ms cubic-bezier(.2, 1, .3, 1);
    flex-shrink: 0;
}

.toggle-label input[type="checkbox"]:hover {
    border-color: rgba(245, 222, 179, 0.6);
    background: rgba(245, 222, 179, 0.1);
}

.toggle-label input[type="checkbox"]:checked {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.toggle-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: #000;
    font-weight: bold;
    font-size: 12px;
}

.toggle-label input[type="checkbox"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(245, 222, 179, 0.2);
}

.toggle-target.collapsed {
    display: none;
}

.modal-inline {
    display: flex;
    gap: 12px;
}

.modal-inline .modal-field {
    flex: 1;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.modal-actions-right {
    display: flex;
    gap: 10px;
}

.delete-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
}

#type-specific-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@keyframes modalPop {
    from {
        transform: translateY(10px) scale(0.96);
        opacity: 0;
    }

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

.habit-streak {
    position: relative;
    background-color: transparent;
    color: #999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: -10px;
}

.habit-streak::before {
    content: "🔥 ";
    margin-right: 4px;
}

.habit-streak[data-streak="0"] {
    color: #999;
}

.habit-streak:not([data-streak="0"]) {
    color: var(--accent-text-color);
}

.habit-box h3 {
    color: var(--accent-color);
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.habit-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.habit-top h3 {
    flex: 1;
    margin: 0;
}

.habit-schedule {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.schedule-days {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.day-circle {
    width: 30px;
    height: 30px;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-color);
    background-color: transparent;
}

.day-circle.active {
    background-color: var(--accent-text-color);
    border-color: var(--accent-text-color);
    color: #000;
}

.times-badge {
    background-color: transparent;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-text-color);
    flex-shrink: 0;
}

.habit-box p {
    color: var(--text-color);
    font-size: 0.95rem;
    margin: 0 0 12px 0;
    flex-grow: 1;
    line-height: 1.5;
}

.habit-check {
    width: 48px;
    height: 48px;
    cursor: pointer;
    align-self: flex-start;
    appearance: none;
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    background-color: transparent;
    transition: all 200ms ease;
    position: relative;
    margin-top: 12px;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.habit-check::before {
    content: attr(data-times);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent-color);
}

.habit-check[data-show-counter="true"]:not([data-completed="true"])::before {
    display: block;
}

.habit-check[data-completed="true"]::before {
    display: none;
}

.habit-check:hover {
    border-color: var(--accent-text-color);
}

.habit-check:checked,
.habit-check[data-completed="true"] {
    background-color: var(--accent-text-color);
    border-color: var(--accent-text-color);
    animation: checkPulse 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.habit-check:checked::after,
.habit-check[data-completed="true"]::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-weight: bold;
    font-size: 28px;
    display: block;
    animation: checkmarkPop 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.edit-btn {
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-text-color);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Satoshi', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 200ms ease;
}

.edit-btn:hover {
    background-color: var(--accent-text-color);
    color: #000;
    border-color: var(--accent-text-color);
}

.habit-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: auto;
    gap: 10px;
}

/* Tasks Section */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
    align-items: start;
}

.kanban-column {
    background: rgba(245, 222, 179, 0.03);
    border: 1px solid rgba(245, 222, 179, 0.1);
    border-radius: 20px;
    padding: 20px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.column-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    flex: 1;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.todo {
    background-color: var(--accent-text-color);
}

.status-dot.inprogress {
    background-color: #f5deb3;
}

.status-dot.done {
    background-color: #4ade80;
}

.task-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    min-height: 100px;
    /* Drop target area */
}

.task-card {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(245, 222, 179, 0.15);
    border-radius: 14px;
    padding: 16px;
    cursor: grab;
    transition: all 200ms ease;
    position: relative;
    animation: slideIn 300ms ease-out backwards;
}

.task-card:hover {
    border-color: rgba(245, 222, 179, 0.4);
    transform: translateY(-2px);
    background: rgba(30, 30, 30, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.task-card:active {
    cursor: grabbing;
}

.task-card h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.4;
}

.task-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 12px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.task-tag {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(245, 222, 179, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(245, 222, 179, 0.2);
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.task-link {
    color: var(--accent-text-color);
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-link:hover {
    text-decoration: underline;
}

.task-edit-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
}

.task-edit-btn:hover {
    color: var(--text-color);
}

.modal-textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 2px solid rgba(245, 222, 179, 0.25);
    background: rgba(245, 222, 179, 0.08);
    color: var(--text-color);
    font-family: 'Satoshi', sans-serif;
    font-size: 0.95rem;
    min-height: 100px;
    resize: vertical;
    box-sizing: border-box;
}

.modal-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(245, 222, 179, 0.12);
}

/* Watch List Section */
.watch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.watch-card {
    background: rgba(245, 222, 179, 0.03);
    border: 1px solid rgba(245, 222, 179, 0.1);
    border-radius: 16px;
    overflow: hidden;
    transition: all 300ms cubic-bezier(.2, 1, .3, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.watch-card:hover {
    transform: translateY(-4px);
    background: rgba(245, 222, 179, 0.06);
    border-color: rgba(245, 222, 179, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.watch-card.watched {
    opacity: 0.6;
    filter: grayscale(0.8);
}

.watch-card.watched:hover {
    opacity: 0.9;
    filter: grayscale(0);
}

.watch-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
    overflow: hidden;
}

.watch-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms ease;
}

.watch-card:hover .watch-thumbnail img {
    transform: scale(1.05);
}

.watch-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.2);
    font-size: 3rem;
}

.watch-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.watch-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
}

.watch-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.watch-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 2;
    align-items: center;
}

.watch-check {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    appearance: none;
    position: relative;
    transition: all 200ms ease;
    backdrop-filter: blur(4px);
    margin: 0;
}

.watch-check:checked {
    background: var(--accent-text-color);
    border-color: var(--accent-text-color);
}

.watch-check::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    color: #000;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0) rotate(-45deg);
    transition: transform 400ms cubic-bezier(.68, -.55, .265, 1.55), opacity 400ms cubic-bezier(.68, -.55, .265, 1.55);
}

.watch-check:checked::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.watch-check.animate-check {
    animation: checkPulse 400ms cubic-bezier(.68, -.55, .265, 1.55) forwards;
}

.watch-check.animate-check::after {
    animation: checkmarkPop 400ms cubic-bezier(.68, -.55, .265, 1.55) forwards;
}

.watch-check:hover {
    transform: scale(1.05);
    border-color: #fff;
}

.watch-edit-btn {
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
    transition: all 200ms ease;
    opacity: 0;
}

.watch-card:hover .watch-edit-btn {
    opacity: 1;
}

.watch-edit-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
}

/* Statistics Section */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.level-card .level-circle {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.level-circle span {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-text-color);
}

.circular-chart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke: var(--accent-text-color);
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.points-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.streak-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent-color);
    margin: 10px 0;
}

.completion-rate {
    font-size: 3rem;
    font-weight: 900;
    color: #4caf50;
    margin: 10px 0;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.chart-container {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(245, 222, 179, 0.2);
}

.chart-container h3 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--accent-color);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.9;
}

canvas {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

/* Mobile navigation layout */
@media (max-width: 900px) {
    body {
        flex-direction: column;
        min-height: 100vh;
        height: auto;
        background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
        background-attachment: scroll;
    }

    main {
        width: 100%;
        padding: 24px 20px 120px;
        box-sizing: border-box;
    }

    nav {
        /* Fixed to bottom */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;

        /* Flex setup */
        flex-direction: row;
        align-items: center;
        /* Updated: space-between creates equal gaps relative to the edges */
        justify-content: space-between;

        /* Padding adjustments: 15px top, 30px sides */
        padding: 15px 30px;
        /* Safe area support for iPhone home bar */
        padding-bottom: calc(15px + env(safe-area-inset-bottom));

        gap: 0;

        /* styling */
        background: rgba(0, 0, 0, 0.95);
        border-top: 1px solid rgba(245, 222, 179, 0.2);
        backdrop-filter: blur(10px);
        z-index: 1000;
        box-sizing: border-box;
    }

    nav .top,
    nav .middle,
    nav .bottom {
        display: contents;
    }

    nav a {
        /* Sizing */
        flex: 0 0 auto;
        /* Prevent growing/shrinking */
        width: auto;
        margin: 0;
        padding: 0;

        /* Centering */
        display: flex;
        justify-content: center;
        align-items: center;

        /* Reset styles */
        border: none;
        background: transparent;
        border-radius: 12px;
    }

    nav a::after {
        display: none;
    }

    nav a:hover {
        transform: none;
        box-shadow: none;
    }

    .nav-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        /* Size adjustments */
        width: 42px;
        height: 42px;

        margin: 0;

        border-radius: 12px;
        border: 1px solid rgba(245, 222, 179, 0.3);
        background-color: rgba(245, 222, 179, 0.08);
    }

    .nav-icon svg {
        width: 22px;
        height: 22px;
    }

    .nav-label {
        display: none;
    }

    /* Horizontal scroll for day selector on mobile */
    .body-day-selector {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
        margin-left: -20px;
        margin-right: -20px;
        padding-left: 20px;
        padding-right: 20px;
        /* Hide scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .body-day-selector::-webkit-scrollbar {
        display: none;
    }

    .body-day-selector button {
        flex-shrink: 0;
    }

    #arrow {
        display: none;
    }

    /* Active state for mobile menu */
    nav a.active .nav-icon {
        background-color: var(--accent-text-color);
        border-color: var(--accent-text-color);
        color: #000;
        /* Contrast icon color */
        animation: menuBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    nav a.active .nav-icon svg path {
        fill: #000;
    }
}

@keyframes menuBounce {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.25);
    }

    50% {
        transform: scale(0.9);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

@keyframes checkPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes checkmarkPop {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-45deg);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(10deg);
    }

    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

.new-habit-created {
    animation: slideIn 400ms ease-out !important;
}

main {
    animation: fadeInUp 600ms ease-out forwards;
}

nav {
    animation: fadeInLeft 600ms ease-out forwards;
}

.content-section {
    animation: fadeInScale 500ms ease-out forwards;
}

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

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOutScale {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

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

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

@keyframes formSlideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* User Profile Section */
#user-section {
    display: flex;
    flex-direction: column;
    min-height: 80vh;
    /* Fill most of the screen */
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin: 40px 0;
    flex-grow: 1;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: border-color 0.3s cubic-bezier(0.2, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    border-color: var(--accent-text-color);
}

.stat-card h3 {
    color: var(--accent-text-color);
    font-size: 1.2rem;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
}

.stat-card p {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.quote-container {
    margin-top: auto;
    padding: 40px 60px;
    border-left: 5px solid var(--accent-color);
    background: none;
    border-radius: 0 20px 20px 0;
    position: relative;
}

.quote-text {
    font-family: 'Satoshi', sans-serif;
    font-style: italic;
    font-size: 2rem !important;
    line-height: 1.4;
    margin: 0 0 20px 0;
    color: var(--text-color);
    opacity: 0.9;
}

.quote-author {
    text-align: right;
    color: var(--accent-text-color);
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 1px;
}