body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
}

header {
    background-color: #0056b3;
    color: white;
    padding: 15px 0;
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    margin: 0;
}

.checklist-section {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.checklist-header {
    padding: 15px;
    background-color: #e2e2e2;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 1.1em;
}

.checklist-header:hover {
    background-color: #dcdcdc;
}

.toggle-icon {
    font-size: 1.4em;
    font-weight: bold;
}

.checklist-content {
    padding: 15px;
    border-top: 1px solid #eee;
    display: none;
}

.checklist-content.active {
    display: block;
}

.checklist-item {
    margin-bottom: 15px;
    padding-left: 20px;
    border-left: 3px solid #f0f0f0;
}

.checklist-subitems {
    margin-top: 10px;
    padding-left: 25px;
}

.checklist-item-question {
    font-weight: bold;
    margin-bottom: 8px;
}

.checklist-item-options label {
    margin-right: 15px;
    cursor: pointer;
}

.checklist-item-notes textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 60px;
    margin-top: 10px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 1em;
}

.inspection-details {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.detail-field {
    margin-bottom: 15px;
}

.detail-field label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.detail-field input[type="text"],
.detail-field input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
}

#page-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px 10px;
    margin-top: 20px;
}

.action-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin: 0;
    flex-shrink: 0;
}

.action-btn:hover {
    background-color: #0056b3;
}

.action-btn.danger {
    background-color: #dc3545;
}

.action-btn.danger:hover {
    background-color: #c82333;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 80%;
    max-width: 700px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    animation-name: animatetop;
    animation-duration: 0.4s
}

@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-content h2 {
    margin-top: 0;
    color: #0056b3;
}

.modal-content p {
    line-height: 1.6;
}

#modal-close-btn {
    display: block;
    margin: 20px auto 0;
    background-color: #6c757d;
}
#modal-close-btn:hover {
    background-color: #5a6268;
}

.checklist-item-options label.highlight-red {
    color: #dc3545;
    font-weight: bold;
}

@media print {
    body {
        background-color: #fff;
        padding: 0;
        margin: 0;
        font-size: 10pt;
    }

    header, #page-actions, .toggle-icon, .modal {
        display: none;
    }

    .checklist-section {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
        margin-bottom: 10px;
    }

    .checklist-content {
         border-top: 1px solid #ccc;
    }

    .checklist-content:not(.active) {
        display: none;
    }
    
    .checklist-item-notes textarea {
        border: 1px solid #aaa;
        background-color: #fff;
        color: #000;
        resize: none;
    }

    .checklist-item {
        padding-left: 15px;
        margin-bottom: 10px;
    }

    .checklist-subitems {
        padding-left: 20px;
    }
}

@media screen and (max-width: 520px) {
    #page-actions {
        gap: 5px;
    }

    .action-btn {
        padding: 10px 8px;
        font-size: 0.99em;
        font-weight: normal;
    }

    body {
        padding: 10px;
    }
}

/* Added styles for photo functionality */
.photo-section {
    margin-top: 10px;
}

.photo-btn {
    background-color: #28a745;
    padding: 8px 16px;
    font-size: 0.9em;
}

.photo-btn:hover {
    background-color: #218838;
}

.photo-container {
    margin-top: 10px;
    text-align: center;
}

.photo-wrapper {
    position: relative;
    display: inline-block;
}

.photo-container img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: block;
}

.remove-photo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 24px;
    text-align: center;
    font-size: 14px;
    padding: 0;
}

.remove-photo-btn:hover {
    background-color: #c82333;
}


@media print {
    .photo-section {
        page-break-inside: avoid;
    }

    .photo-btn, .remove-photo-btn {
        display: none;
    }

    .photo-container img {
        max-width: 200px; /* Adjust size for print */
        border: 1px solid #ccc;
    }
}