/* TaskMaster Custom Styles */

/* Base Markdown Styles for .prose class */
.prose {
    line-height: 1.6;
    word-wrap: break-word;
}

/* Mobile typography optimization */
@media (max-width: 640px) {
    .prose {
        font-size: 0.875rem;
    }
}

/* Headings */
.prose h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    color: #111827;
}
.dark .prose h1 {
    color: #f3f4f6;
}

.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 1.25rem;
    margin-bottom: 0.625rem;
    line-height: 1.3;
    color: #111827;
}
.dark .prose h2 {
    color: #f3f4f6;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: #111827;
}
.dark .prose h3 {
    color: #f3f4f6;
}

.prose h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 0.875rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: #374151;
}

.prose h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.75rem;
    margin-bottom: 0.375rem;
    line-height: 1.5;
    color: #374151;
}

.prose h6 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.625rem;
    margin-bottom: 0.375rem;
    line-height: 1.5;
    color: #4b5563;
}

/* Paragraphs */
.prose p {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Lists */
.prose ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.prose ol {
    list-style-type: decimal;
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.prose li {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.prose ul ul,
.prose ul ol,
.prose ol ul,
.prose ol ol {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Task Lists */
.prose input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Blockquotes */
.prose blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1rem;
    margin-left: 0;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    color: #6b7280;
    font-style: italic;
}
.dark .prose blockquote {
    border-left-color: #4b5563;
    color: #9ca3af;
}

/* Code */
.prose code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
    color: #dc2626;
}
.dark .prose code {
    background-color: #374151;
    color: #fca5a5;
}

.prose pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}
.dark .prose pre {
    background-color: #111827;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.875rem;
}

/* Links */
.prose a {
    color: #2563eb;
    text-decoration: underline;
}

.prose a:hover {
    color: #1d4ed8;
}

/* Horizontal Rules */
.prose hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Tables */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.prose table th {
    background-color: #f9fafb;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    font-weight: 600;
    text-align: left;
}

.prose table td {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
}

.prose table tr:nth-child(even) {
    background-color: #f9fafb;
}
.dark .prose table th {
    background-color: #374151;
    border-color: #4b5563;
}
.dark .prose table td {
    border-color: #4b5563;
}
.dark .prose table tr:nth-child(even) {
    background-color: #1f2937;
}

/* Images */
.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

/* Strong and Emphasis */
.prose strong {
    font-weight: 600;
    color: #111827;
}
.dark .prose strong {
    color: #f3f4f6;
}

.prose em {
    font-style: italic;
}

/* Strikethrough */
.prose del {
    text-decoration: line-through;
    color: #6b7280;
}

/* First and last element margin reset */
.prose > :first-child {
    margin-top: 0;
}

.prose > :last-child {
    margin-bottom: 0;
}

/* Kanban Board Styles */
.kanban-board {
    scrollbar-width: thin;
    scrollbar-color: #9ca3af transparent;
    min-height: 400px;
    align-items: stretch;
}

.kanban-board::-webkit-scrollbar {
    height: 8px;
}

.kanban-board::-webkit-scrollbar-track {
    background: transparent;
}

.kanban-board::-webkit-scrollbar-thumb {
    background-color: #9ca3af;
    border-radius: 4px;
}

.dark .kanban-board::-webkit-scrollbar-thumb {
    background-color: #4b5563;
}

.kanban-pan-rail {
    height: 24px;
    transition: background-color 0.15s ease;
}

.kanban-pan-rail:hover {
    background-color: #e5e7eb; /* gray-200 */
}

.dark .kanban-pan-rail:hover {
    background-color: #1e293b; /* slate-800 */
}

.kanban-pan-rail.cursor-grabbing {
    cursor: grabbing;
}

.kanban-sort-menu {
    position: fixed;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 0.25rem;
    z-index: 1000;
    min-width: 160px;
}

.dark .kanban-sort-menu {
    background: #1e293b;
    border-color: #334155;
}

.kanban-sort-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #374151;
    border-radius: 0.375rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.kanban-sort-menu-item:hover {
    background-color: #f3f4f6;
}

.kanban-sort-menu-separator {
    height: 1px;
    background-color: #e5e7eb;
    margin: 0.25rem 0;
}

.dark .kanban-sort-menu-separator {
    background-color: #334155;
}

.dark .kanban-sort-menu-item {
    color: #e2e8f0;
}

.dark .kanban-sort-menu-item:hover {
    background-color: #334155;
}

.kanban-column {
    transition: transform 0.15s ease;
    min-height: 350px;
}

.kanban-done-column {
    min-height: 350px;
}

.kanban-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.kanban-card:hover {
    transform: translateY(-2px);
}

.kanban-card.opacity-50 {
    opacity: 0.5;
}

.kanban-card.rotate-2 {
    transform: rotate(2deg);
}

.kanban-column-tasks {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.5rem;
    padding: 0.25rem;
    margin: -0.25rem;
}

.kanban-empty-placeholder {
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* Kanban drop zone highlight */
.kanban-column-tasks.ring-2 .kanban-empty-placeholder {
    border-color: #60a5fa;
    background-color: rgba(59, 130, 246, 0.05);
}

.dark .kanban-column-tasks.ring-2 .kanban-empty-placeholder {
    background-color: rgba(59, 130, 246, 0.1);
}

/* Print Stylesheet */
@media print {
    /* Hide all non-essential UI */
    header,
    nav,
    button,
    #dark-mode-toggle,
    [data-action="back"],
    [data-action="delete-checklist"],
    [data-action="status-change"],
    [data-action="change-image"],
    [data-edit],
    #task-search-input,
    #clear-task-search,
    [data-tag-filter],
    [data-checklist-tag-filter],
    .hover\:shadow-md,
    .transition-all,
    .rounded-full,
    .progress-bar {
        display: none !important;
    }

    /* Hide images and backgrounds */
    img,
    [style*="background"],
    .bg-white,
    .bg-gray-50,
    .dark\:bg-gray-800,
    .dark\:bg-gray-900,
    .prose h1 + img,
    .prose img {
        display: none !important;
    }

    /* Clean black and white print */
    body {
        background: white !important;
        color: black !important;
        margin: 0;
        padding: 0;
    }

    main {
        padding: 0 !important;
        max-width: 100% !important;
    }

    /* Main content area */
    #app {
        padding: 0 !important;
    }

    /* Checklist container */
    > div {
        background: white !important;
    }

    /* Title styling for print */
    h1,
    h2 {
        color: black !important;
        page-break-after: avoid;
        margin-bottom: 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    h2 {
        font-size: 1.125rem;
        margin-top: 1rem;
    }

    /* Hide status badge, progress bar, and description on first page */
    .inline-flex.items-center.px-3 {
        display: none !important;
    }

    .w-full.bg-gray-200,
    .space-y-2,
    .flex.items-center.justify-between.text-sm {
        display: none !important;
    }

    /* Task items - clean checkbox layout */
    [data-note-checkbox] {
        appearance: none;
        width: 1rem;
        height: 1rem;
        border: 2px solid black;
        border-radius: 0.25rem;
        margin-right: 0.75rem;
        cursor: text;
        flex-shrink: 0;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    [data-note-checkbox]:checked {
        background: white;
        border-color: black;
    }

    /* Task content container */
    .flex.items-start.space-x-2,
    .flex.items-start.space-x-3 {
        border: none !important;
        background: transparent !important;
        padding: 0.5rem 0 !important;
        page-break-inside: avoid;
    }

    .flex.flex-1.min-w-0 {
        width: 100%;
    }

    /* Hide tags and attachments in print */
    .inline-flex.items-center.px-2.py-0.5 {
        display: none !important;
    }

    .flex.flex-wrap.gap-1.5 {
        display: none !important;
    }

    /* Task text - simple black on white */
    .prose {
        color: black !important;
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .prose h1,
    .prose h2,
    .prose h3 {
        color: black !important;
        font-weight: 600;
    }

    .prose strong {
        color: black !important;
        font-weight: 600;
    }

    .prose em {
        font-style: italic;
        color: black !important;
    }

    .prose del {
        color: #666 !important;
        text-decoration: line-through;
    }

    .prose p {
        margin: 0 0 0.25rem 0;
    }

    .prose ul,
    .prose ol {
        margin: 0.25rem 0 0.25rem 1.5rem;
        padding: 0;
    }

    .prose li {
        margin: 0;
    }

    .prose code {
        background: #f5f5f5;
        color: black;
        padding: 0.125rem 0.25rem;
        border-radius: 0.25rem;
    }

    .prose blockquote {
        border-left: 3px solid black;
        padding-left: 0.75rem;
        margin: 0.5rem 0;
    }

    /* Remove hover effects and transitions */
    * {
        transition: none !important;
        box-shadow: none !important;
    }

    /* Compact spacing */
    .space-y-3 > * + * {
        margin-top: 0.25rem;
    }

    .mb-4,
    .mb-6,
    .mb-8 {
        margin-bottom: 0.5rem !important;
    }

    .mt-2,
    .mt-3,
    .mt-4 {
        margin-top: 0.25rem !important;
    }

    .p-3,
    .p-4,
    .p-6,
    .p-8 {
        padding: 0 !important;
    }

    /* Border styling for print */
    border-b,
    border-l,
    border-r,
    border-t {
        border-color: black !important;
    }
}
