/* /tools/project-checklist-manager/style.css */

/* --- Toolbar (Save & Title) --- */
.ac-tool-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 2em;
    background: var(--color-surface);
    padding: 15px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.ac-tool-toolbar h2,
.ac-tool-toolbar h3 {
    margin: 0;
    flex-grow: 1;
    text-align: left;
}

/* Mobile Adjustments for Toolbar */
@media (max-width: 768px) {
    .ac-tool-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 12px;
    }

    .ac-tool-toolbar h2,
    .ac-tool-toolbar h3 {
        text-align: center;
        order: -1;
        /* Move title to top on mobile */
    }

    .ac-tool-toolbar>div,
    .ac-tool-toolbar>button:not(h2):not(h3) {
        display: flex;
        justify-content: center;
        width: 100%;
    }
}

/* --- Custom Tool Assets --- */

/* --- Project LIst --- */
.ac-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5em;
}

.ac-project-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5em;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
}

.ac-project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-color: var(--color-primary);
}

.ac-card-title {
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 0.5em;
    color: var(--color-heading);
}

.ac-card-meta {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    display: flex;
    justify-content: space-between;
}

.ac-mini-progress {
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.ac-mini-bar {
    height: 100%;
    background: var(--color-success);
    border-radius: 3px;
}


/* --- Checklist Editor --- */
.ac-progress-wrapper {
    position: relative;
    padding: 1.5em;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: 2em;
    text-align: center;
    border: 1px solid var(--color-border);
}

.ac-progress-track {
    height: 10px;
    background: var(--color-border);
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

.ac-progress-fill {
    height: 100%;
    background: var(--color-success);
    width: 0%;
    transition: width 0.5s ease;
}

.ac-progress-text {
    font-weight: 700;
    color: var(--color-heading);
    font-size: 1.2em;
}

.ac-task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ac-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    transition: background 0.2s;
}

.ac-task-item:first-child {
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.ac-task-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.ac-task-item:hover {
    background: #fdfdfd;
}

.ac-task-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    color: var(--color-text-main);
    font-size: 1rem;
}

.ac-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.ac-task-item.checked .ac-checkbox {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
}

.ac-task-item.checked .ac-task-text {
    text-decoration: line-through;
    color: var(--color-text-tertiary);
}

.ac-task-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

.ac-task-item:hover .ac-task-actions {
    opacity: 1;
}

.ac-btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-tertiary);
    font-size: 1.2em;
    padding: 5px;
}

.ac-btn-icon:hover {
    color: var(--color-danger);
}


/* Confetti */
.ac-confetti {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 10px;
    background: red;
    z-index: 9999;
    animation: ac-fall 3s linear forwards;
}

@keyframes ac-fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }

    #actb-print-area,
    #actb-print-area * {
        visibility: visible;
    }

    #actb-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
}