:root {
    --bg: #e6e9ef;
    --bg-soft: #eef1f7;
    --fg: #2c313a;
    --muted: #6b7280;
    --primary: #3b82f6;
    --danger: #ef4444;

    --shadow-light: rgba(255, 255, 255, 0.7);
    --shadow-dark: rgba(0, 0, 0, 0.08);
}


@font-face {
    font-family: Sahel;
    src: url(Sahel-FD.woff2);
}

* {
    box-sizing: border-box;
    font-family: Sahel;

}

html,
body {
    height: 100%;
    background: var(--bg);
    color: var(--fg);
    font-family: Sahel, "Vazirmatn", system-ui, sans-serif;
    font-size:1em;
}
span{
    padding-left: 2rem;
}
#count-done{
    flex-grow: 1;
}
.container {
    max-width: 720px;
    margin: 4rem auto;
    padding: 2rem;
    border-radius: 24px;
    background: var(--bg);
    box-shadow:
        12px 12px 24px var(--shadow-dark),
        -12px -12px 24px var(--shadow-light);
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.subtitle {
    margin: 0;
    color: var(--muted);
}

.controls {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
}

input[type="text"],
input[type="search"] {
    /* width: 100%; */
    flex: 1;
    padding: 0.9rem 1rem;
    border: none;
    border-radius: 16px;
    background: var(--bg);
    color: var(--fg);
    box-shadow:
        inset 6px 6px 12px var(--shadow-dark),
        inset -6px -6px 12px var(--shadow-light);
}

input::placeholder {
    color: var(--muted);
}

label {
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: flex-start;
    align-items: center;
}

.btn {
    border: none;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    background: var(--bg);
    color: var(--fg);
    box-shadow:
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
    transition: transform 0.05s ease, box-shadow 0.2s ease, background 0.2s ease;
    align-self: center;
    justify-content: center;
    align-content: center;
}

.btn:active {
    transform: translateY(1px);
}

.btn.primary {
    color: white;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.btn.danger {
    color: white;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    /* float: left; */
    margin: 1rem 0;
}

.filters {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.filters button{
    margin:1em 0;
}
.filter-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn.pill {
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
}

.btn.pill.active {
    outline: 2px solid rgba(59, 130, 246, 0.35);
}

.search-group {
    flex: 1;
}

.todo-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
}

.todo-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.95rem 0.75rem;
    border-radius: 16px;
    background: var(--bg);
    box-shadow:
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
    justify-items: end;
    justify-content: space-between;
    align-items: center;
}

.check {
    display: inline-grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.check input {
    display: none;
}

.todo-check {
    position: absolute;
    background:none;
    border:0;
    appearance: none;
    width: 14px;
    height: 14px;
}

.mark {
    /* width: 22px; */
    /* height: 22px; */
    padding-block: 12px;
    padding-inline: 13px;
    display: inline-flex;
    border-radius: 8px;
    box-shadow:
        inset 6px 6px 12px var(--shadow-dark),
        inset -6px -6px 12px var(--shadow-light);
    position: relative;
}

.todo-item.done .mark::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #10b981;
    font-weight: 700;
}

.content {
    display: grid;
    grid-template-columns: 1fr;
}

.text {
    line-height: 1.7;
    word-break: break-word;
    padding: 0;
    padding-right: 10px;
    font-size: 0.9em;
}

.todo-item.done .text {
    color: var(--muted);
    text-decoration: line-through;
}

.edit-input {
    display: none;
    margin-top: 0.25rem;
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    background: var(--bg-soft);
    box-shadow:
        inset 6px 6px 12px var(--shadow-dark),
        inset -6px -6px 12px var(--shadow-light);
}

.actions {
    display: flex;
    gap: 0.25rem;
    /* flex: 1; */
}

.btn.icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    font-size: 18px;
}

.btn.icon.edit {
    color: #374151;
}

.btn.icon.save {
    color: #0ea5e9;
    display: none;
}

.btn.icon.delete {
    color: #ef4444;
}

.footer {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stats {
    display: flex;
    gap: 1rem;
    color: var(--muted);
}

footer {display: flex;margin-top: 2rem;align-items: center;flex-wrap: wrap;}

@media (max-width: 520px) {
    .container {
        margin: 2rem 1rem;
        padding: 1.25rem;
    }

    /* .filters {
        flex-direction: column;
        align-items: stretch;
    } */

#search-input, #clear-done{
    flex:100%;
}
    
}