/**
 * User Export Management Styles
 * Professional and clean design for user management interface
 */

/* Main Container */
.tempario-user-export {
    margin: 20px 20px 20px 0;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Filters Section */
.tempario-filters-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.tempario-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    flex: 1;
    min-width: 0;
    align-items: flex-end;
}

.tempario-filters-row input {
	width: 100%;
}

.tempario-filter-group {
    flex: 1;
    min-width: 200px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tempario-filters-section {
        padding: 15px;
        gap: 15px;
    }
    
    .tempario-filters-row {
        gap: 15px;
    }
    
    .tempario-filter-group {
        min-width: 150px;
    }
    
    .tempario-filter-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .tempario-filter-actions .button {
        width: 100%;
    }
}

.tempario-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.tempario-filter-actions {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}

/* Actions Bar */
.tempario-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.tempario-actions-left,
.tempario-actions-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.tempario-select-info {
    font-weight: 600;
    padding: 8px 12px;
    background: #fff;
    border-radius: 3px;
    border: 1px solid #c3c4c7;
}

.tempario-select-info span {
    color: #2271b1;
    font-size: 1.1em;
}

/* Table Container */
.tempario-table-container {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    overflow-x: auto;
}

.tempario-users-table {
    margin: 0 !important;
}

.tempario-users-table thead th {
    background: #f6f7f7;
    border-bottom: 2px solid #c3c4c7;
    padding: 16px 12px;
    font-weight: 600;
}

.tempario-users-table tbody tr:hover {
    background: #f6f7f7;
}

.tempario-users-table tbody td {
    padding: 16px 12px;
    vertical-align: middle;
}

/* Sortable Columns */
.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.sortable:hover {
    background: #e8e8e8;
}

.sorting-indicator {
    display: inline-block;
    margin-left: 5px;
    opacity: 0.3;
}

.sorting-indicator::before {
    content: '↕';
}

.sortable.asc .sorting-indicator::before {
    content: '↑';
    opacity: 1;
}

.sortable.desc .sorting-indicator::before {
    content: '↓';
    opacity: 1;
}

/* Table Columns */
.column-username {
    min-width: 150px;
}

.column-role {
    width: 120px;
}

.column-registered {
    width: 150px;
}

.column-info {
    width: 150px;
}

.check-column {
    width: 40px;
    text-align: center;
}

/* User Info Rows */
.user-info-row {
    background: #f9f9f9;
}

.user-info-box {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 8px 20px;
    padding: 20px;
    max-width: 800px;
}

.info-row {
    display: contents;
}

.info-label {
    font-weight: 600;
    color: #333;
}

.info-value {
    color: #555;
}

.info-value em {
    color: #999;
}

/* Pagination */
.tempario-pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-top: none;
    border-radius: 0 0 4px 4px;
    flex-wrap: wrap;
    gap: 15px;
}

.tempario-pagination-info {
    font-weight: 600;
    color: #50575e;
}

.tempario-pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

#per-page-select {
    padding: 6px 32px 6px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    line-height: 1.2;
    min-height: 32px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m1 3.5 4 4 4-4' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
}

.tablenav-pages {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-links {
    display: flex;
    gap: 5px;
}

.pagination-links button {
    min-width: 32px;
    height: 32px;
}

.paging-input {
    display: flex;
    align-items: center;
    gap: 5px;
}

#current-page-input {
    width: 60px;
    text-align: center;
    padding: 4px;
}

/* Loading States */
.tempario-spinner {
    text-align: center;
    padding: 40px 20px;
}

.tempario-spinner .spinner {
    float: none;
    margin: 0 auto 10px;
}

.tempario-loading-row td,
.tempario-no-results,
.tempario-error {
    text-align: center;
    padding: 40px 20px !important;
    font-size: 1.1em;
}

.tempario-error {
    color: #d63638;
}

.tempario-error .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-right: 5px;
    vertical-align: middle;
}

/* Modal */
.tempario-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
}

.tempario-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.tempario-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.tempario-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.tempario-modal-header h2 {
    margin: 0;
    font-size: 1.3em;
}

.tempario-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 24px;
    color: #666;
    transition: color 0.2s;
}

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

.tempario-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.meta-fields-list h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f1;
}

.meta-field-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
    padding: 12px;
    border-bottom: 1px solid #f0f0f1;
}

.meta-field-row:last-child {
    border-bottom: none;
}

.meta-field-key {
    color: #1d2327;
    word-break: break-word;
}

.meta-field-value {
    color: #50575e;
    word-break: break-all;
}

.meta-field-value pre {
    background: #f6f7f7;
    padding: 10px;
    border-radius: 3px;
    overflow-x: auto;
    font-size: 0.9em;
}

/* Export Overlay */
.tempario-export-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tempario-export-spinner {
    text-align: center;
}

.tempario-export-spinner .spinner {
    float: none;
    margin: 0 auto 15px;
}

.tempario-export-spinner p {
    font-size: 1.2em;
    font-weight: 600;
    color: #1d2327;
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .tempario-filters-row {
        flex-direction: column;
    }
    
    .tempario-filter-group {
        width: 100%;
    }
    
    .tempario-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tempario-actions-left,
    .tempario-actions-right {
        justify-content: center;
    }
}

@media screen and (max-width: 782px) {
    .tempario-users-table {
        font-size: 0.9em;
    }
    
    .tempario-users-table tbody td,
    .tempario-users-table thead th {
        padding: 8px;
    }
    
    .meta-field-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .tempario-pagination-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tempario-pagination-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tablenav-pages {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* WordPress Admin Notices Integration */
.tempario-user-export .notice {
    margin: 15px 0;
}

/* Button Enhancements */
.button-primary.button-hero {
    padding: 12px 24px;
    font-size: 16px;
}

/* Accessibility */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Smooth Transitions */
.tempario-users-table tbody tr,
.button,
.sortable {
    transition: background-color 0.2s ease;
}

/* Print Styles */
@media print {
    .tempario-filters-section,
    .tempario-actions-bar,
    .tempario-pagination-container {
        display: none;
    }
    
    .tempario-users-table {
        border: 1px solid #000;
    }
}
