/**
 * Apartment Inspection Checklist Styles
 */

/* Główna struktura */
.apartment-inspection-checklist {
    max-width: 100%;
    margin-bottom: 40px;
}

/* Formularze */
.inspection-info-form {
    background-color: #f9f9f9;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 5px;
    border: 1px solid #e5e5e5;
}

.form-row {
    margin-bottom: 15px;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-row input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Elementy listy kontrolnej */
.checklist-items {
    margin-bottom: 30px;
}

.checklist-item {
    margin-bottom: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
}

.checklist-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 5px 5px 0 0;
}

.checklist-item-header h4 {
    margin: 0;
}

.item-status {
    min-width: 150px;
}

.checklist-item-details {
    padding: 15px;
    background-color: #fff;
    display: none;
    border-top: 1px solid #e5e5e5;
}

.checklist-item-details.visible {
    display: block;
}

.item-description {
    margin-bottom: 15px;
}

.item-notes {
    margin-bottom: 20px;
}

.item-notes textarea {
    width: 100%;
    min-height: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Sekcja zdjęć */
.item-photos {
    margin-bottom: 20px;
}

.photo-upload {
    margin-bottom: 15px;
}

.photo-file-input {
    display: none;
}

.photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.photo-item {
    position: relative;
    width: 150px;
    height: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item .delete-photo {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Sekcja podsumowania */
.inspection-summary {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #e5e5e5;
}

/* Przyciski */
.button {
    display: inline-block;
    background-color: #0073aa;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.button:hover {
    background-color: #005c88;
}

.button.button-error {
    background-color: #d63638;
}

.generate-report-button {
    margin-top: 20px;
}

/* Ukryj pola formularza ale zachowaj ich funkcjonalność */
#global-ai-form-container .mwai-form .mwai-form-inputs {
    position: absolute;
    left: -9999px;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Upewnij się, że przycisk Submit jest widoczny */
#global-ai-form-container .mwai-form .mwai-form-submit {
    position: relative;
    left: auto;
    height: auto;
    width: auto;
    overflow: visible;
    margin: 20px 0;
}

/* Style dla kontenera wynikowego */
#global-ai-form-container .mwai-form .mwai-form-output {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    min-height: 100px;
    margin-top: 20px;
}

/* Wskaźnik ładowania */
#global-ai-form-container .mwai-form .mwai-form-output.mwai-loading:before {
    content: "Generowanie opisu...";
    display: block;
    font-style: italic;
    color: #777;
}

/* Upewnij się, że przycisk zamknięcia jest widoczny */
#global-ai-form-container .close-ai-form {
    display: block;
    margin: 10px auto;
}

/* Stylizacja globalnego kontenera formularza */
#global-ai-form-container {
    z-index: 99999;
}

#global-ai-form-container > div {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Stylizacja przycisku "Generuj opis AI" */
.generate-ai-description {
    margin-top: 10px !important;
}

/* Stylizacja kontenera opisu AI */
.ai-description {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.ai-description-content {
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Animacja ładowania */
@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.mwai-loading {
    animation: pulse 1.5s infinite;
}

/* Wymuś aktywację przycisków */
#global-ai-form-container .mwai-form .mwai-form-submit button[disabled] {
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Usuń style dla nieaktywnych przycisków */
#global-ai-form-container .mwai-form .mwai-form-submit button.mwai-disabled {
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Style dla przycisków w formularzu AI */
#global-ai-form-container .ai-form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

#global-ai-form-container .copy-ai-to-checklist {
    background-color: #4CAF50;
    color: white;
    transition: background-color 0.3s;
}

#global-ai-form-container .copy-ai-to-checklist:hover {
    background-color: #3e8e41;
}

/* Dodatkowy styl dla wskaźnika ładowania */
#global-ai-form-container .mwai-form-output.mwai-loading {
    position: relative;
    min-height: 100px;
}

#global-ai-form-container .mwai-form-output.mwai-loading:before {
    content: "Generowanie opisu AI...";
    display: block;
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
    animation: pulse 1.5s infinite;
}

/* Styles for AI description actions */
.ai-description-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}

.delete-ai-description {
    background-color: #FFFFFF !important;
}

.delete-ai-description:hover {
    background-color: #CC3366 !important;
}

/* Przycisk zapisu zmian - dodanie marginesu górnego */
.save-item-button {
    margin-top: 50px !important;
    display: block;
}

/* Modal Styles */
.inspection-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.6);
}

.inspection-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    position: relative;
    border-radius: 5px;
}

.inspection-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
}

.inspection-modal-close:hover,
.inspection-modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.inspection-modal .form-row {
    margin-bottom: 15px;
}

.inspection-modal label {
    display: block;
    margin-bottom: 5px;
}

.inspection-modal .regular-text {
    width: 100%;
}

.inspection-modal .email-status-message.success {
    color: green;
    font-weight: bold;
}

.inspection-modal .email-status-message.error {
    color: red;
    font-weight: bold;
}

/* Clear button style */
.clear-checklist-button {
    background-color: #dc3545; /* Red color */
    border-color: #dc3545;
    color: white;
}

.clear-checklist-button:hover,
.clear-checklist-button:focus {
    background-color: #c82333; /* Darker red on hover */
    border-color: #bd2130;
    color: white;
}

/* Export/Import button styles */
.export-json-button,
.import-json-button {
    background-color: #6c757d; /* Gray color */
    border-color: #6c757d;
    color: white;
}

.export-json-button:hover,
.export-json-button:focus,
.import-json-button:hover,
.import-json-button:focus {
    background-color: #5a6268;
    border-color: #545b62;
    color: white;
}

/* Action buttons sections */
.inspection-actions-primary .button,
.inspection-actions-secondary .button {
    margin-right: 10px; 
    margin-bottom: 5px; /* Add some space for wrapping */
}

.inspection-actions-secondary {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 15px; /* Dodaj margines górny dla lepszego oddzielenia */
}

/* Specific style for download button if needed */
.download-photos-button {
    background-color: #17a2b8; /* Teal color */
    border-color: #17a2b8;
    color: white;
}

.download-photos-button:hover,
.download-photos-button:focus {
    background-color: #138496;
    border-color: #117a8b;
    color: white;
}