/**
 * Tektonic Air Quality Document Manager - Frontend Styles
 * Version: 4.2.1
 */

/* Common Shortcode Styles */
.tektonic-customers-shortcode,
.tektonic-users-shortcode,
.tektonic-drafts-shortcode,
.tektonic-my-documents-shortcode,
.tektonic-published-posts-shortcode { 
    margin: 20px 0; 
    max-width: 100%; 
}

.tektonic-customers-shortcode > h3,
.tektonic-users-shortcode > h3,
.tektonic-drafts-shortcode > h3 { 
    margin-bottom: 20px; 
    margin-top: 0; 
}

/* Messages */
.tektonic-success-message { 
    background: #d4edda; 
    color: #155724; 
    padding: 15px; 
    border: 1px solid #c3e6cb; 
    border-radius: 3px; 
    margin-bottom: 20px; 
}

.tektonic-error-message { 
    background: #f8d7da; 
    color: #721c24; 
    padding: 15px; 
    border: 1px solid #f5c6cb; 
    border-radius: 3px; 
    margin-bottom: 20px; 
}

/* Split Container */
.tektonic-split-container { 
    display: flex; 
    gap: 20px; 
    flex-wrap: wrap; 
}

.tektonic-directory-section { 
    flex: 1; 
    min-width: 300px; 
}

.tektonic-form-section { 
    flex: 1; 
    min-width: 300px; 
}

/* Form Toggle */
.tektonic-form-toggle { 
    background: #f9f9f9; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    margin-bottom: 20px; 
}

.tektonic-form-toggle-header { 
    padding: 15px 20px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    user-select: none; 
    background: #0073aa; 
    color: white; 
    border-radius: 5px 5px 0 0; 
}

.tektonic-form-toggle-header:hover { 
    background: #005177; 
}

.tektonic-form-toggle-header h3 { 
    margin: 0; 
    font-size: 16px; 
}

.tektonic-form-toggle-arrow { 
    font-size: 14px; 
    font-weight: bold; 
    transition: transform 0.3s ease; 
}

.tektonic-form-toggle-arrow.open { 
    transform: rotate(90deg); 
}

.tektonic-form-toggle-content { 
    max-height: 0; 
    overflow: hidden; 
    transition: max-height 0.3s ease; 
}

.tektonic-form-toggle-content.open { 
    max-height: 1000px; 
}

/* Forms */
.tektonic-shortcode-form { 
    background: #f9f9f9; 
    padding: 20px; 
    border-radius: 0 0 5px 5px; 
}

.tektonic-shortcode-form h3 { 
    margin-top: 0; 
    display: none; 
}

.tektonic-form-field { 
    margin-bottom: 15px; 
}

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

.tektonic-form-field input,
.tektonic-form-field textarea,
.tektonic-form-field select { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ddd; 
    border-radius: 3px; 
    box-sizing: border-box; 
}

.tektonic-form-field textarea { 
    resize: vertical; 
}

/* Buttons */
.tektonic-submit-btn { 
    background: #0073aa; 
    color: white; 
    padding: 12px 24px; 
    border: none; 
    border-radius: 3px; 
    cursor: pointer; 
    font-size: 16px; 
    width: 100%; 
}

.tektonic-submit-btn:hover { 
    background: #005177; 
}

.tektonic-filter-btn { 
    background: #0073aa; 
    color: white; 
    padding: 6px 16px; 
    border: none; 
    border-radius: 3px; 
    cursor: pointer; 
    font-size: 14px; 
    text-decoration: none; 
    display: inline-block; 
}

.tektonic-filter-btn:hover { 
    background: #005177; 
}

.tektonic-clear-btn { 
    padding: 6px 16px; 
    background: #f0f0f0; 
    color: #333; 
    text-decoration: none; 
    border-radius: 3px; 
    font-size: 14px; 
    display: inline-block; 
}

.tektonic-clear-btn:hover { 
    background: #e0e0e0; 
}

.tektonic-shortcode-edit { 
    background: #0073aa; 
    color: white; 
    padding: 8px 15px; 
    text-decoration: none; 
    border-radius: 3px; 
    display: inline-block; 
}

.tektonic-shortcode-edit:hover { 
    background: #005177; 
    color: white; 
}

.tektonic-delete-customer-btn { 
    background: #d63638; 
    color: white; 
    padding: 8px 15px; 
    border: none; 
    border-radius: 3px; 
    cursor: pointer; 
    font-size: 14px; 
}

.tektonic-delete-customer-btn:hover { 
    background: #9c2527; 
}

.tektonic-reset-btn { 
    background: #d63638; 
    color: white; 
    padding: 8px 15px; 
    border: none; 
    border-radius: 3px; 
    cursor: pointer; 
    font-size: 14px; 
}

.tektonic-reset-btn:hover { 
    background: #9c2527; 
}

.tektonic-delete-user-btn { 
    background: #dc3232; 
    color: white; 
    padding: 8px 15px; 
    border: none; 
    border-radius: 3px; 
    cursor: pointer; 
    font-size: 14px; 
}

.tektonic-delete-user-btn:hover { 
    background: #a00; 
}

.tektonic-set-btn { 
    background: #46b450; 
    color: white; 
    padding: 6px 16px; 
    border: none; 
    border-radius: 3px; 
    cursor: pointer; 
    font-size: 13px; 
    white-space: nowrap; 
}

.tektonic-set-btn:hover { 
    background: #368a3d; 
}

.tektonic-set-btn:disabled { 
    background: #ccc; 
    cursor: not-allowed; 
    opacity: 0.6; 
}

.tektonic-view-link { 
    background: #46b450; 
    color: white; 
    padding: 8px 15px; 
    text-decoration: none; 
    border-radius: 3px; 
    display: inline-block; 
    font-size: 14px; 
    white-space: nowrap; 
}

.tektonic-view-link:hover { 
    background: #368a3d; 
    color: white; 
}

.tektonic-delete-btn { 
    background: #d63638; 
    color: white; 
    padding: 8px 15px; 
    border: none; 
    border-radius: 3px; 
    cursor: pointer; 
    font-size: 14px; 
    white-space: nowrap; 
}

.tektonic-delete-btn:hover { 
    background: #9c2527; 
}

.tektonic-show-more-btn { 
    background: #46b450; 
    color: white; 
    padding: 12px 24px; 
    border: none; 
    border-radius: 3px; 
    cursor: pointer; 
    font-size: 16px; 
    text-decoration: none; 
    display: inline-block; 
}

.tektonic-show-more-btn:hover { 
    background: #368a3d; 
    color: white; 
}

.tektonic-doc-link { 
    background: #0073aa; 
    color: white; 
    padding: 6px 12px; 
    text-decoration: none; 
    border-radius: 3px; 
    font-size: 13px; 
    white-space: nowrap; 
}

.tektonic-doc-link:hover { 
    background: #005177; 
    color: white; 
}

/* Items and Lists */
.tektonic-shortcode-item { 
    padding: 15px; 
    border: 1px solid #ddd; 
    margin-bottom: 10px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: #f9f9f9; 
    border-radius: 3px; 
}

.tektonic-shortcode-item h4 { 
    margin: 0 0 5px 0; 
}

.tektonic-shortcode-item p { 
    margin: 0; 
    color: #666; 
    font-size: 14px; 
}

.tektonic-customer-actions,
.tektonic-user-actions { 
    display: flex; 
    gap: 8px; 
}

/* Draft Posts */
.tektonic-draft-item { 
    padding: 12px 15px; 
    border: 1px solid #ddd; 
    margin-bottom: 10px; 
    background: #f9f9f9; 
    border-radius: 3px; 
}

.tektonic-draft-row { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    flex-wrap: wrap; 
}

.tektonic-draft-info { 
    flex: 1; 
    min-width: 250px; 
}

.tektonic-draft-info h4 { 
    margin: 0 0 3px 0; 
    font-size: 16px; 
}

.tektonic-draft-info p { 
    margin: 0; 
    color: #666; 
    font-size: 13px; 
}

.tektonic-draft-meta { 
    color: #999; 
}

.tektonic-move-controls { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.tektonic-move-controls select { 
    padding: 6px 8px; 
    border: 1px solid #ddd; 
    border-radius: 3px; 
    font-size: 13px; 
    min-width: 180px; 
}

.tektonic-checkbox-compact { 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    white-space: nowrap; 
}

.tektonic-checkbox-compact input[type="checkbox"] { 
    margin: 0; 
}

.tektonic-checkbox-compact label { 
    margin: 0; 
    font-size: 12px; 
}

/* Document Headers */
.tektonic-doc-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
    flex-wrap: wrap; 
    gap: 15px; 
}

.tektonic-doc-title { 
    margin: 0; 
}

.tektonic-doc-title small { 
    color: #666; 
    font-size: 14px; 
    font-weight: normal; 
}

/* Filter Controls */
.tektonic-filter-controls { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
    flex-wrap: wrap; 
}

.tektonic-filter-controls label { 
    font-weight: 600; 
    margin: 0; 
}

.tektonic-filter-controls select { 
    padding: 6px 12px; 
    border: 1px solid #ddd; 
    border-radius: 3px; 
    font-size: 14px; 
    min-width: 200px; 
}

/* Sort Controls */
.tektonic-sort-controls { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
}

.tektonic-sort-controls label { 
    font-weight: 600; 
    margin: 0; 
}

.tektonic-sort-controls a { 
    padding: 6px 12px; 
    background: #0073aa; 
    color: white; 
    text-decoration: none; 
    border-radius: 3px; 
    font-size: 13px; 
}

.tektonic-sort-controls a:hover { 
    background: #005177; 
}

.tektonic-sort-controls a.active { 
    background: #46b450; 
}

/* Groups */
.tektonic-company-group,
.tektonic-author-group,
.tektonic-month-group { 
    margin-bottom: 30px; 
}

.tektonic-company-header,
.tektonic-author-header,
.tektonic-month-header { 
    background: #0073aa; 
    color: white; 
    padding: 10px 15px; 
    border-radius: 3px; 
    margin-bottom: 10px; 
    font-weight: 600; 
}

/* Document Items */
.tektonic-doc-item { 
    padding: 12px 15px; 
    border: 1px solid #ddd; 
    margin-bottom: 8px; 
    background: #f9f9f9; 
    border-radius: 3px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.tektonic-doc-info h4 { 
    margin: 0 0 5px 0; 
    font-size: 16px; 
}

.tektonic-doc-info p { 
    margin: 0; 
    color: #666; 
    font-size: 13px; 
}

/* Published Posts */
.tektonic-published-item { 
    padding: 15px; 
    border: 1px solid #ddd; 
    margin-bottom: 8px; 
    background: #f9f9f9; 
    border-radius: 3px; 
}

.tektonic-published-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 15px; 
    flex-wrap: wrap; 
}

.tektonic-published-info { 
    flex: 1; 
    min-width: 250px; 
}

.tektonic-published-info h4 { 
    margin: 0 0 5px 0; 
    font-size: 16px; 
}

.tektonic-published-info p { 
    margin: 0; 
    color: #666; 
    font-size: 14px; 
}

.tektonic-published-actions { 
    display: flex; 
    gap: 8px; 
}

/* Empty States */
.tektonic-no-docs,
.tektonic-no-posts { 
    padding: 20px; 
    text-align: center; 
    color: #666; 
    background: #f9f9f9; 
    border: 1px solid #ddd; 
    border-radius: 3px; 
}

/* Show More */
.tektonic-show-more { 
    text-align: center; 
    margin-top: 20px; 
    padding: 20px; 
    background: #f9f9f9; 
    border: 1px solid #ddd; 
    border-radius: 3px; 
}

/* Pagination */
.tektonic-pagination { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 10px; 
    margin-top: 20px; 
    padding: 15px; 
}

.tektonic-pagination a,
.tektonic-pagination span { 
    padding: 8px 12px; 
    border: 1px solid #ddd; 
    border-radius: 3px; 
    text-decoration: none; 
    color: #0073aa; 
}

.tektonic-pagination a:hover { 
    background: #0073aa; 
    color: white; 
}

.tektonic-pagination .current { 
    background: #0073aa; 
    color: white; 
    border-color: #0073aa; 
}

/* Modal */
.tektonic-modal { 
    display: none; 
    position: fixed; 
    z-index: 999999; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); 
}

.tektonic-modal-content { 
    background-color: #fff; 
    margin: 10% auto; 
    padding: 25px; 
    border: 1px solid #888; 
    border-radius: 5px; 
    width: 90%; 
    max-width: 400px; 
}

.tektonic-modal-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
}

.tektonic-modal-header h3 { 
    margin: 0; 
}

.tektonic-modal-close { 
    color: #aaa; 
    font-size: 28px; 
    font-weight: bold; 
    cursor: pointer; 
    line-height: 1; 
}

.tektonic-modal-close:hover { 
    color: #000; 
}

.tektonic-modal-body { 
    margin-bottom: 20px; 
}

.tektonic-modal-footer { 
    display: flex; 
    gap: 10px; 
    justify-content: flex-end; 
}

/* Responsive */
@media (max-width: 768px) {
    .tektonic-split-container { 
        flex-direction: column; 
    }
    
    .tektonic-shortcode-form { 
        position: static; 
    }
    
    .tektonic-draft-row { 
        flex-direction: column; 
        align-items: stretch; 
    }
    
    .tektonic-move-controls { 
        flex-wrap: wrap; 
    }
    
    .tektonic-published-row { 
        flex-direction: column; 
        align-items: stretch; 
    }
    
    .tektonic-published-actions { 
        flex-wrap: wrap; 
    }
    
    .tektonic-doc-header { 
        flex-direction: column; 
        align-items: stretch; 
    }
    
    .tektonic-filter-controls { 
        flex-direction: column; 
        align-items: stretch; 
    }
    
    .tektonic-filter-controls select { 
        width: 100%; 
    }
}