/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

/* HTMX indicator styles */
.htmx-indicator {
    display: none;
    margin-left: 10px;
    color: #666;
    font-style: italic;
}

.htmx-request .htmx-indicator {
    display: inline;
}

.htmx-request button {
    opacity: 0.6;
    cursor: not-allowed;
}

.container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="text"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: #3498db;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* Checkbox grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 10px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
    transform: scale(1.2);
}

.checkbox-item label {
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}

/* Date range selector */
.date-range {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.date-range > div {
    flex: 1;
    min-width: 200px;
}

.note {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Results section */
.results {
    margin-top: 30px;
}

.alert {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

/* HTMX Progress Bar - based on Bootstrap styling */
.progress {
    height: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    background-color: #f5f5f5;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}

.progress-bar {
    float: left;
    width: 0%;
    height: 100%;
    font-size: 12px;
    line-height: 20px;
    color: #fff;
    text-align: center;
    background-color: #337ab7;
    -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
    -webkit-transition: width .6s ease;
    -o-transition: width .6s ease;
    transition: width .6s ease;
}

.progress-text {
    color: #333;
    font-size: 16px;
    margin: 10px 0;
    font-weight: bold;
}

.chunk-progress {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
}

.export-actions {
    margin-top: 20px;
    text-align: center;
}

/* Download and reset buttons */
.download-link {
    display: inline-block;
    margin-top: 10px;
    padding: 12px 20px;
    background-color: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.download-link:hover {
    background-color: #27ae60;
    text-decoration: none;
}

.reset-button {
    background-color: #95a5a6;
    margin-left: 10px;
}

.reset-button:hover {
    background-color: #7f8c8d;
}

/* Form section visibility */
.form-group {
    transition: opacity 0.3s ease-in-out, max-height 0.3s ease-in-out, margin 0.3s ease-in-out;
    overflow: hidden;
}

.form-group.hidden {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.form-group.visible {
    opacity: 1;
    max-height: 500px;
    margin-bottom: 20px;
    pointer-events: auto;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    .date-range {
        flex-direction: column;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    button {
        width: 100%;
        margin-right: 0;
    }
}

/* HTMX Fade Animations */
.fade-transition {
    transition: opacity 300ms ease-in-out;
}

.fade-transition.htmx-swapping {
    opacity: 0;
}

.fade-transition.htmx-added {
    opacity: 0;
}

.fade-transition.htmx-settling {
    opacity: 1;
}