/* Import Brad Frost Design Tokens */
@import url('./bf-tokens.css');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    accent-color: var(--bf-theme-color-background-brand);
}

/* Base Styles */
body {
    font-family: var(--bf-theme-typography-body-font-family);
    font-size: var(--bf-theme-typography-body-font-size);
    line-height: var(--bf-theme-typography-body-line-height);
    color: var(--bf-theme-color-content-default);
    background: var(--bf-theme-color-background-default);
    padding: 0;
    margin: 0;
}

h1, h2, h3, h4 {
    font-family: var(--bf-theme-typography-headline-font-family);
    text-transform: var(--bf-theme-typography-headline-text-transform);
    line-height: var(--bf-theme-typography-headline-line-height);
    margin-bottom: 1rem;
}

h1, .big-title {
    font-size: var(--bf-theme-typography-headline-lg-font-size);
    margin: 0 0 2rem;
}

h2 {
    font-size: var(--bf-theme-typography-headline-sm-font-size);
    color: var(--bf-theme-color-content-brand);
    margin: 0;
    padding-bottom: 0.25rem;
}

h3 {
    font-size: var(--bf-theme-typography-title-font-size);
}

a {
    color: var(--bf-theme-color-content-brand);
    text-decoration: none;
    transition: all var(--bf-anim-fade-quick) var(--bf-anim-ease);
}

/* Lists */
ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

li:last-child {
    border-bottom: none;
}

/* Horizontal rule styling */
hr {
    border: none;
    height: 2px;
    background: var(--bf-theme-color-border-subtle);
    margin: 3rem 0;
    display: none;
}

input[type="checkbox"] {
    accent-color: var(--bf-theme-color-background-brand);
    border: 1px solid var(--bf-theme-color-border-knockout);
    background: none;
    border-radius: 1rem;
    opacity: 0.3;
    width: 1.5rem;
    height: 1.5rem;
}

input[type="checkbox"]:checked {
    opacity: 1;
}

/* Ensure all checkbox labels are block-level elements for better hit area */
label[for*="checkbox"] {
    display: block;
    width: 100%;
    padding: 0.5rem 0;
    cursor: pointer;
}

/* Specific styling for priority item labels */
.priority-text {
    display: block;
    width: 100%;
    padding: 0.5rem 0;
    cursor: pointer;
}

/* Specific styling for task list item labels */
.task-text {
    display: block;
    width: 100%;
    padding: 0.5rem 0;
    cursor: pointer;
}

/* Specific styling for dynamically created list item labels */
.list-text {
    display: block;
    width: 100%;
    padding: 0.5rem 0;
    cursor: pointer;
}

/* Focus states for better accessibility */
.list-text:focus-visible,
.priority-text:focus-visible,
.task-text:focus-visible {
    outline: 2px solid var(--bf-theme-color-border-brand);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Layout */
.container {
    display: grid;
    min-height: 100vh;
}

@media (min-width: 800px) {
    .container {
        grid-template-columns: 33% 1fr;
    }
}

/* Multi-column layout for large screens */
@media (min-width: 1200px) {
    /* Section grids for top and bottom sections */
    .section-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
        gap: 2rem;
        align-items: start;
        margin-bottom: 2rem;
    }
    
}


/* Priority Section */
.priority {
    background: var(--bf-theme-color-background-knockout);
    color: var(--bf-theme-color-content-knockout);
    padding: 3rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.priority::-webkit-scrollbar {
    width: 6px;
}

.priority::-webkit-scrollbar-track {
    background: transparent;
}

.priority::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.priority::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.priority-category {
    border: 2px dotted rgba(255, 255, 255, 0.3);
    border-radius: var(--bf-theme-border-radius);
    background: transparent;
    padding: 1rem;
    margin-bottom: 2rem;
    transition: all var(--bf-anim-fade-quick) var(--bf-anim-ease);
}

/* Change background when all checkboxes in the category are checked */
.priority-category:has(input[type="checkbox"]:checked):not(:has(input[type="checkbox"]:not(:checked))) {
    background: var(--bf-theme-color-background-brand);
    border-color: var(--bf-theme-color-border-brand);
    color: var(--bf-theme-color-content-knockout);
}

.priority-category:has(input[type="checkbox"]:checked):not(:has(input[type="checkbox"]:not(:checked))) h2 {
    color: var(--bf-theme-color-content-knockout);
}


@media (min-width: 800px) {
    .priority {
        height: 100vh;
        overflow: auto;
        position: fixed;
        top: 0;
        left: 0;
        width: 33%;        
    }
}

.priority h1 {
    color: var(--bf-theme-color-content-accent);
}

.priority h2 {
    color: var(--bf-color-brand-mustard);
}

.content {
    padding: 3rem;
}

/* Accordion Styles */
.accordion {
    margin-bottom: 0.5rem;
    overflow: hidden;
    padding: 1rem;
    border-radius: var(--bf-theme-border-radius);
    border: 2px dotted var(--bf-theme-color-border-subtle);
}

.accordion:has(.accordion-trigger[aria-expanded="true"]) {
    border-color: var(--bf-theme-color-border-brand);
    background: var(--bf-theme-color-background-subtle);
}

.accordion-trigger {
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: var(--bf-theme-typography-headline-font-family);
    font-size: var(--bf-theme-typography-title-font-size);
    text-transform: var(--bf-theme-typography-headline-text-transform);
    line-height: var(--bf-theme-typography-headline-line-height);
    color: var(--bf-theme-color-content-default);
    position: relative;
    transition: all var(--bf-anim-fade-quick) var(--bf-anim-ease);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-trigger:hover {
    color: var(--bf-theme-color-content-brand);
}

.accordion-trigger:focus-visible {
    outline: 3px solid var(--bf-theme-color-border-brand);
    outline-offset: -3px;
}

.accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--bf-anim-fade-quick) var(--bf-anim-ease);
}

.accordion-panel.active {
    max-height: 1000px;
}

.accordion-panel ul {
    margin: 0;
    padding: 0.5rem 0;
}





.accordion-panel li:last-child {
    border-bottom: none;
}

/* Keyboard navigation support */
.accordion-trigger:focus-visible {
    outline: 3px solid var(--bf-theme-color-border-brand);
    outline-offset: -3px;
}

/* Screen reader only text for better accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


