/* HTML Report Modal Styles */

.html-report-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100010;  /* above all UI modals, below loading/downloading */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.html-report-modal.active {
    opacity: 1;
    visibility: visible;
}

.html-report-modal-content {
    width: 95%;
    height: 95%;
    background: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.html-report-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    gap: 0.75rem;
}

.html-report-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.html-report-modal-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.html-report-save-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.html-report-save-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.html-report-print-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.html-report-print-btn:hover {
    background: #2563eb;
}

.html-report-pdf-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.html-report-pdf-btn:hover {
    background: #b91c1c;
}

.html-report-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: #64748b;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    transition: background-color 0.2s;
}

.html-report-close-btn:hover {
    background: #475569;
}

.html-report-iframe-container {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

.html-report-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.html-report-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #64748b;
}

.html-report-loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.html-report-loading-text {
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}

.html-report-loading-details {
    font-size: 0.875rem;
    color: #94a3b8;
    text-align: center;
    font-style: italic;
    margin-top: 0.25rem;
    max-width: 300px;
    line-height: 1.4;
}

.html-report-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #dc2626;
    text-align: center;
}

.html-report-error-icon {
    font-size: 3rem;
}

.html-report-error-text {
    font-size: 1rem;
    font-weight: 500;
}

.html-report-error-details {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* Print-specific styles for the modal */
@media print {
    .html-report-modal {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: white !important;
    }
    
    .html-report-modal-header {
        display: none !important;
    }
    
    .html-report-modal-content {
        width: 100% !important;
        height: auto !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    
    .html-report-iframe-container {
        height: auto !important;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .html-report-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .html-report-modal-header {
        padding: 0.625rem 0.875rem;
        border-radius: 0;
        gap: 0.5rem;
    }

    .html-report-modal-title {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }

    /* Hide the icon on mobile to save space */
    .html-report-modal-title i {
        display: none;
    }

    .html-report-modal-actions {
        gap: 0.375rem;
        flex-shrink: 0;
    }

    /* Icon-only buttons on mobile — hide the text label using font-size trick */
    .html-report-save-btn,
    .html-report-print-btn,
    .html-report-pdf-btn {
        padding: 0.5rem 0.625rem;
        font-size: 0;       /* hides text node */
        gap: 0;
        min-width: 2.25rem;
        justify-content: center;
    }

    /* Restore icon size after font-size:0 on parent */
    .html-report-save-btn i,
    .html-report-print-btn i,
    .html-report-pdf-btn i {
        font-size: 1rem;
    }
}

/* Success message for print action */
.print-success-message {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #059669;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    z-index: 100011;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.print-success-message.show {
    transform: translateX(0);
    opacity: 1;
}

.print-success-message i {
    font-size: 1.25rem;
}

/* Report actions styling in property modal */
.report-actions {
    margin-top: 0.75rem;
    text-align: center;
}

.report-actions .text-muted {
    font-size: 0.875rem;
    color: #64748b;
    font-style: italic;
}

/* Comps header styling */
.comps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 1.5rem 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.comps-title h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.comps-title p {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

.comps-actions .btn {
    padding: 0.625rem 1.25rem;
    font-weight: 500;
}

/* Enhanced appeal card styling */
.appeal-card.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
}

.appeal-card.primary h4,
.appeal-card.primary p {
    color: white;
}

.appeal-card.primary .appeal-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.appeal-card.primary .appeal-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Full width appeal card */
.appeal-card.full-width {
    width: 100%;
    text-align: center;
    padding: 2rem;
}

.appeal-card.full-width .appeal-btn.large {
    padding: 1rem 2.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    min-width: 300px;
}

.appeal-card .help-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-style: italic;
    margin-top: 0.5rem;
    display: block;
}

/* Responsive design for comps header */
@media (max-width: 768px) {
    .comps-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .comps-title {
        text-align: center;
    }
    
    .comps-actions {
        text-align: center;
    }
}

/* Generate Evidence Section */
.generate-evidence-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    border: 2px solid #cbd5e1;
    text-align: center;
}

.evidence-summary h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    color: #1e293b;
    font-weight: 600;
}

.evidence-summary p {
    margin: 0 0 1rem 0;
    color: #475569;
    line-height: 1.6;
}

.potential-savings {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0 1.5rem 0;
    border: 1px solid #e2e8f0;
}

.savings-highlight {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #059669;
    font-size: 1.125rem;
}

.savings-highlight i {
    font-size: 1.25rem;
}

.savings-highlight strong {
    color: #047857;
    font-weight: 700;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-large:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Mobile responsive for evidence section */
@media (max-width: 768px) {
    .generate-evidence-section {
        margin-top: 1.5rem;
        padding: 1rem;
    }
    
    .evidence-summary h4 {
        font-size: 1.125rem;
    }
    
    .savings-highlight {
        font-size: 1rem;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* Generated Document Actions Styling */
.document-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.document-actions .btn-large {
    padding: 1rem 2rem;
    font-size: 1.25rem;
    font-weight: 600;
    min-width: 280px;
    border-radius: 8px;
    transition: all 0.2s;
}

.document-actions .btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

.secondary-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.secondary-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Mobile responsive for document actions */
@media (max-width: 768px) {
    .document-actions .btn-large {
        min-width: 100%;
        font-size: 1.125rem;
        padding: 0.875rem 1.5rem;
    }
    
    .secondary-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .secondary-actions .btn {
        flex: 1;
        max-width: 48%;
    }
}