/* Minimal CSS to make templates functional */
body {
    font-family: system-ui, sans-serif;
    background: #f4f6f9;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0066cc;
}

/* Project list grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.project-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    display: block;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: #28a745;
}

/* Accordion */
.accordion-title {
    cursor: pointer;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.accordion-title strong {
    flex: 1;
    margin-right: 0.5rem;
}

.accordion-content {
    display: none;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
}

.accordion-content.open {
    display: block;
}

/* ===== NEW STYLES FOR ENHANCED FEATURES ===== */

/* Progress big display on project detail */
.progress-big {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.progress-big strong {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #0066cc;
}

/* Complete banner for finished projects */
.complete-banner {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Accordion item with complete status */
.accordion-item.complete {
    border-left: 4px solid #28a745;
}

/* Form container for project/task creation */
.form-container {
    max-width: 600px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.85rem;
}

.form-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

/* Button styles */
.btn-primary,
.btn-secondary {
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    min-height: 40px;
}

.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-primary:hover {
    background: #0055aa;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Inline action buttons */
.toggle-task,
.btn-record {
    border: none;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: 0.75rem;
    min-height: 34px;
    color: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.toggle-task.btn-done {
    background: #28a745;  /* Green for completed tasks */
}

.toggle-task.btn-mark {
    background: #6c757d;  /* Gray for incomplete tasks */
}

.btn-record {
    background: #0066cc;  /* Blue for housekeeping record */
}

.toggle-task:hover,
.btn-record:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Last done timestamp */
.last-done {
    color: #666;
    font-size: 0.85rem;
    margin-left: 0.75rem;
}

/* Complete tag */
.complete-tag {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    margin-top: 10px;
}

/* Add button container - CENTERED */
.add-buttons {
    margin: 2rem 0;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.add-buttons a {
    background: #0066cc;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.add-buttons a:hover {
    background: #0055aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.add-buttons a.add-housekeeping {
    background: #28a745;
    margin-left: 0;
}

.add-buttons a.add-housekeeping:hover {
    background: #218838;
}

/* Housekeeping log history */
.housekeeping-logs {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.housekeeping-logs strong {
    display: block;
    margin-bottom: 0.5rem;
}

.housekeeping-logs ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.housekeeping-logs li {
    font-size: 0.9rem;
    color: #666;
}

/* Housekeeping display */
.hk-description {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border-left: 3px solid #0066cc;
}

.completion-history ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.completion-history li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.log-datetime {
    font-weight: bold;
    color: #0066cc;
}

.log-note {
    color: #555;
    font-style: italic;
}

.no-logs {
    color: #6c757d;
    font-style: italic;
    padding: 0.5rem 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    border: none;
    background: none;
}

.close-modal:hover {
    color: #000;
}

.modal .form-group {
    margin-bottom: 1.25rem;
}

.modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.modal .form-group input,
.modal .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: system-ui, sans-serif;
}

.modal .form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.85rem;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet and smaller */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 16px;
        border-radius: 0;
        box-shadow: none;
    }

    header {
        padding-bottom: 16px;
        margin-bottom: 24px;
        text-align: center;
    }

    header h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    header a {
        display: block;
        margin-top: 8px;
        font-size: 0.95rem;
    }

    /* Project grid: single column on mobile */
    .project-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .project-card {
        padding: 18px;
    }

    .project-card h3 {
        font-size: 1.35rem;
        margin-bottom: 10px;
    }

    /* Progress bar */
    .progress-bar {
        height: 6px;
    }

    /* Accordion */
    .accordion-title {
        padding: 14px;
        font-size: 1.1rem;
    }

    .accordion-content {
        padding: 14px;
        font-size: 0.95rem;
    }

    /* Buttons - optimized touch targets */
    .btn-primary,
    .btn-secondary {
        min-height: 40px;
        padding: 0.55rem 1rem;
        font-size: 0.95rem;
    }

    .toggle-task,
    .btn-record {
        min-height: 36px;
        padding: 0.35rem 0.8rem;
        margin-left: 0.6rem;
        font-size: 0.9rem;
    }

    /* Form container */
    .form-container {
        margin: 1rem auto;
        padding: 20px 16px;
    }

    .form-group label {
        font-size: 1.05rem;
        margin-bottom: 0.6rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 12px;
        font-size: 1.05rem;
    }

    .form-group small {
        font-size: 0.9rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }

    /* Add buttons - centered and compact */
    .add-buttons {
        margin: 1.5rem 0;
    }

    .add-buttons a {
        padding: 12px;
        font-size: 1rem;
        min-width: auto;
        width: 100%;
        max-width: 300px;
    }

    /* Progress display */
    .progress-big {
        padding: 18px;
        margin-bottom: 20px;
    }

    .progress-big strong {
        font-size: 1.9rem;
    }

    /* Modal */
    .modal-content {
        margin: 8% 12px;
        padding: 24px 20px;
        width: calc(100% - 24px);
        max-width: 480px;
    }

    .close-modal {
        top: 18px;
        right: 18px;
        font-size: 32px;
    }

    /* Housekeeping */
    .hk-description {
        padding: 14px;
        font-size: 0.95rem;
    }

    .completion-history li {
        padding: 10px 0;
        font-size: 0.95rem;
    }

    .log-datetime {
        font-size: 1rem;
    }

    .last-done {
        font-size: 0.95rem;
        margin-left: 0.6rem;
    }

    /* Complete banner */
    .complete-banner {
        padding: 16px;
        font-size: 1.1rem;
    }
}

/* Small phones (under 480px) */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .container {
        padding: 12px;
    }

    header h1 {
        font-size: 1.65rem;
    }

    .project-card h3 {
        font-size: 1.25rem;
    }

    .progress-big strong {
        font-size: 1.7rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 14px;
        font-size: 1rem;
        min-height: 40px;
    }

    .toggle-task,
    .btn-record {
        min-height: 36px;
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
    }

    .form-container {
        padding: 18px 14px;
    }

    .modal-content {
        margin: 4% 8px;
        padding: 20px 16px;
    }

    .close-modal {
        font-size: 36px;
    }
}