/**
 * Teocalli Reports CSS
 * Styles for both admin and front-end display
 */

/* Admin Area Styles */
.teocalli-reports-create,
.teocalli-reports-edit,
.teocalli-reports-existing {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.status-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.status-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.status-checkbox input {
    margin-right: 5px;
}

.chart-container {
    width: 100%;
    height: 400px;
    margin-top: 20px;
    margin-bottom: 20px;
}

#report-preview {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.report-actions {
    margin-top: 20px;
}

/* Existing Reports Table */
.actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* Preview Modal */
#report-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
}

.report-preview-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

#report-preview-chart-container {
    width: 100%;
    height: 400px;
    margin-top: 20px;
}

/* Front-end Styles */
.teocalli-report-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
}

.teocalli-report-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.teocalli-chart-container {
    width: 100%;
    height: 400px;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 782px) {
    .status-checkboxes {
        flex-direction: column;
        gap: 10px;
    }
    
    .actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .actions .button {
        width: 100%;
        text-align: center;
    }
    
    .report-preview-content {
        width: 95%;
        padding: 15px;
    }
    
    .teocalli-chart-container,
    .chart-container,
    #report-preview-chart-container {
        height: 300px;
    }
     .status-report-chart-container,
    .teocalli-chart-container {
        min-height: 600px;
    }
}

@media screen and (max-width: 480px) {
    .teocalli-chart-container,
    .chart-container,
    #report-preview-chart-container {
        height: 250px;
    }
       .status-report-chart-container,
    .teocalli-chart-container {
        min-height: 500px;
    }
}

/* Add this to style.css */

/* Status Reports Tab Styles */
.teocalli-status-reports-container {
    margin-top: 20px;
}

.status-reports-generate {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-tabs-wrapper {
    margin-bottom: 0;
    border-bottom: 1px solid #ccc;
}

.status-nav-tab {
    display: inline-block;
    padding: 10px 15px;
    margin-bottom: -1px;
    text-decoration: none;
    color: #444;
    border: 1px solid transparent;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

.status-nav-tab:hover {
    background-color: #f0f0f0;
    color: #000;
}

.status-nav-tab-active {
    background-color: #fff;
    color: #000;
    border-color: #ccc;
    border-bottom-color: #fff;
}

.status-tab-content {
    padding: 20px;
    border: 1px solid #ccc;
    border-top: none;
    background-color: #fff;
}



.status-report-table {
    margin-top: 10px;
}

#status-report-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
}

#status-report-preview-chart-container {
    width: 100%;
    height: 400px;
    margin-top: 20px;
}

/* Mobile Responsive Styles for Status Reports */
@media screen and (max-width: 782px) {
    .status-nav-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .status-tab-content {
        padding: 15px 10px;
    }
    
    #status-report-preview-chart-container {
        height: 300px;
    }
}

@media screen and (max-width: 600px) {
    .status-tabs-wrapper {
        display: flex;
        flex-direction: column;
        border-bottom: none;
    }
    
    .status-nav-tab {
        margin-bottom: 5px;
        border: 1px solid #ccc;
        border-radius: 3px;
    }
    
    .status-nav-tab-active {
        background-color: #f0f0f0;
        border-bottom-color: #ccc;
    }
    
    .status-tab-content {
        border: 1px solid #ccc;
    }
    
    #status-report-preview-chart-container {
        height: 250px;
    }
}




/* Add a loading spinner */
.status-report-loading {
    padding: 20px 0;
    font-style: italic;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Status Reports Chart Container */
.status-report-chart-container {
    width: 100%;
    min-height: 800px;
    margin-top: 20px;
    margin-bottom: 20px;
    overflow-y: auto;  /* Add scrolling for very tall charts */
    max-height: 1200px; /* Increased maximum height before scrolling */
}

/* For embedded reports */
.teocalli-chart-container {
    width: 100%;
    min-height: 800px;
    max-height: 1200px; /* Increased maximum height before scrolling */
    overflow-y: auto;  /* Add scrolling for very tall charts */
}

/* Make sure the tab content can expand to fit the chart */
.status-tab-content {
    padding: 20px;
    border: 1px solid #ccc;
    border-top: none;
    background-color: #fff;
    overflow: visible; /* Allow content to expand beyond default height */
    height: auto !important; /* Override any height restrictions */
}

/* Status reports container can get very tall */
.teocalli-status-reports-container {
    margin-top: 20px;
    margin-bottom: 40px;
    height: auto !important; /* Override any height restrictions */
}

/* Status report container in the front-end */
.teocalli-status-report-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    height: auto !important;
}

/* Add a loading spinner */
.status-report-loading {
    padding: 20px 0;
    font-style: italic;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-report-loading:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

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