@charset "UTF-8";
/**
 * Pest Trend Analysis Plugin - Site Manager Styles
 *
 * @package   PestTrendAnalysis
 * @copyright 2025 Havasi Archibald
 * @license   GPL-2.0-or-later
 * @since     1.0.0
 */

/* Site Selector Button */
.pta-site-selector-container {
    margin-bottom: var(--ipm-spacing-lg);
    padding: var(--ipm-spacing-md);
    background: var(--ipm-bg-secondary);
    border-radius: var(--ipm-border-radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--ipm-shadow);
}

#pta-site-selector-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--ipm-spacing-sm);
    padding: var(--ipm-spacing-sm) var(--ipm-spacing-lg);
    background: var(--ipm-bg-primary);
    border: none;
    border-radius: var(--ipm-border-radius);
    cursor: pointer;
    font-size: var(--ipm-font-size-base);
    font-weight: 500;
    box-shadow: var(--ipm-shadow);
    min-height: 48px;
}

#pta-site-selector-btn:hover {
    background: var(--ipm-hover-bg);
    box-shadow: var(--ipm-shadow-hover);
}

#pta-current-site-indicator {
    display: flex;
    align-items: center;
    gap: var(--ipm-spacing-xs);
    color: var(--ipm-text-muted);
    font-size: var(--ipm-font-size-sm);
}

.pta-site-icon {
    font-size: var(--ipm-font-size-lg);
}

/* Modal Styles - Consistent backdrop with document manager */
.pta-site-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

/* Simple display - no unnecessary animation */
.pta-site-selector-modal.is-visible {
    display: flex !important;
}

.pta-site-selector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.pta-site-selector-content {
    position: relative;
    max-width: min(800px, 90vw);
    max-height: 90vh;
    margin: auto;
    background: var(--ipm-bg-primary);
    border-radius: var(--ipm-border-radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


/* Modal Header - Unified design */
.pta-site-selector-header {
    padding: var(--ipm-spacing-lg);
    border-bottom: var(--ipm-border-width) solid var(--ipm-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ipm-bg-gradient);
    border-radius: var(--ipm-border-radius-lg) var(--ipm-border-radius-lg) 0 0;
}

.pta-site-selector-header h3 {
    margin: 0;
    font-size: var(--ipm-font-size-xxl);
    font-weight: 700;
    color: var(--ipm-text-primary);
    display: flex;
    align-items: center;
    gap: var(--ipm-spacing-sm);
}

.pta-site-selector-header h3::before {
    content: '\1F30D'; /* Unicode for Earth Globe emoji */
    font-size: 28px;
    font-family: var(--ipm-emoji-font-family);
    display:none; /* Hidden at user's request */
}

/* Close button unification - same in all modals */
.pta-site-selector-header .pta-close-btn,
.pta-modal-header .pta-close-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ipm-bg-secondary, #f8f9fa);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--ipm-text-muted, #6c757d);
    cursor: pointer;
    z-index: 10;
    transition: var(--ipm-transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
    box-shadow: var(--ipm-shadow, 0 4px 16px rgba(0, 0, 0, 0.08));
}

.pta-site-selector-header .pta-close-btn:hover,
.pta-modal-header .pta-close-btn:hover {
    background: var(--ipm-error-color, #dc3545);
    color: var(--ipm-text-white, #ffffff);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}


/* Search Section */
.pta-site-selector-search {
    padding: var(--ipm-spacing-md) var(--ipm-spacing-lg);
    border-bottom: var(--ipm-border-width) solid var(--ipm-border-color);
    background: var(--ipm-bg-secondary);
}

/* Search input - Combined ID and class selector for safety */
#pta-site-search.pta-site-search-input,
.pta-site-search-input {
    width: 100%;
    padding: var(--ipm-spacing-md);
    border: var(--ipm-border-width) solid var(--ipm-border-color);
    border-radius: var(--ipm-border-radius);
    font-size: var(--ipm-font-size-base);
    font-family: var(--ipm-font-family);
    font-weight: 400;
    line-height: 1.4;
    transition: var(--ipm-transition);
    background: var(--ipm-bg-primary);
    color: var(--ipm-text-primary);
    box-shadow: var(--ipm-shadow);
    min-height: 48px;
    border-radius: var(--ipm-border-radius);
}
   
#pta-site-search.pta-site-search-input:focus,
.pta-site-search-input:focus {
    outline: none;
    border-color: var(--ipm-border-color-focus);
    box-shadow: var(--ipm-focus-shadow);
    background-color: var(--ipm-bg-primary);
}

#pta-site-search.pta-site-search-input:hover,
.pta-site-search-input:hover {
    border-color: var(--ipm-primary-color);
    box-shadow: var(--ipm-shadow);
}

#pta-site-search.pta-site-search-input::placeholder,
.pta-site-search-input::placeholder {
    color: var(--ipm-text-muted);
    font-style: italic;
}

/* Sites List */
.pta-site-selector-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--ipm-spacing-lg);
    min-height: 200px;
    background: var(--ipm-bg-primary);
}

.pta-sites-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--ipm-spacing-xxl);
    color: var(--ipm-text-muted);
    font-size: var(--ipm-font-size-base);
    gap: var(--ipm-spacing-md);
}

.pta-sites-loading .pta-spinner {
    margin-bottom: var(--ipm-spacing-sm);
}

.pta-sites-list {
    display: none;
}

.pta-sites-list.show {
    display: block;
}

.pta-site-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--ipm-spacing-md);
    border-left: 4px solid transparent;
    border-radius: var(--ipm-border-radius);
    margin-bottom: var(--ipm-spacing-sm);
    cursor: pointer;
    background: var(--ipm-bg-primary);
    box-shadow: var(--ipm-shadow);
    position: relative;
    overflow: hidden;
}

.pta-site-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 127, 95, 0.02) 0%, rgba(148, 221, 38, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pta-site-item:hover {
    border-left-color: var(--ipm-primary-color);
    background: var(--ipm-hover-bg);
    box-shadow: var(--ipm-shadow-hover);
}

.pta-site-item:hover::before {
    opacity: 1;
}

.pta-site-item:active {
    box-shadow: var(--ipm-shadow);
}

.pta-site-info {
    flex: 1;
}

.pta-site-title {
    font-size: var(--ipm-font-size-base);
    color: var(--ipm-text-primary);
    margin-bottom: var(--ipm-spacing-xs);
    font-weight: 600;
}

.pta-site-meta {
    display: flex;
    gap: var(--ipm-spacing-md);
    font-size: var(--ipm-font-size-sm);
    color: var(--ipm-text-muted);
}

.pta-site-delete {
    background: none;
    border: none;
    padding: var(--ipm-spacing-xs);
    cursor: pointer;
    opacity: 0.5;
    transition: var(--ipm-transition);
    color: var(--ipm-error-color);
    border-radius: var(--ipm-border-radius);
}

.pta-site-delete:hover {
    opacity: 1;
    background: rgba(220, 53, 69, 0.1);
}

.pta-no-sites {
    text-align: center;
    padding: var(--ipm-spacing-xxl);
    color: var(--ipm-text-muted);
    background: var(--ipm-bg-secondary);
    border-radius: var(--ipm-border-radius);
    border: 2px dashed var(--ipm-border-color);
    box-shadow: none;
}

.pta-no-sites p {
    margin: var(--ipm-spacing-sm) 0;
}

.pta-help-text {
    font-size: var(--ipm-font-size-sm);
    color: var(--ipm-text-muted);
}

/* Modal Footer */
.pta-site-selector-footer {
    padding: var(--ipm-spacing-md) var(--ipm-spacing-lg);
    border-top: var(--ipm-border-width) solid var(--ipm-border-color);
    text-align: center;
    background: var(--ipm-bg-secondary);
    border-radius: 0 0 var(--ipm-border-radius-lg) var(--ipm-border-radius-lg);
}

/* Footer button styling unification */
.pta-site-selector-footer .pta-btn {
    font-family: var(--ipm-font-family);
    font-size: var(--ipm-font-size-base);
    font-weight: 600;
    padding: var(--ipm-spacing-md) var(--ipm-spacing-xl);
    border: none;
    border-radius: var(--ipm-border-radius);
    cursor: pointer;
    transition: var(--ipm-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ipm-spacing-sm);
    text-decoration: none;
    min-height: 48px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pta-site-selector-footer .pta-btn-secondary {
    background: linear-gradient(135deg, var(--ipm-bg-accent) 0%, #dee2e6 100%);
    color: var(--ipm-text-primary);
    border: none;
}

.pta-site-selector-footer .pta-btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #dee2e6 0%, #ced4da 100%);
    box-shadow: var(--ipm-shadow-hover);
}

.pta-site-selector-footer .pta-btn:disabled {
    opacity: var(--ipm-disabled-opacity);
    cursor: not-allowed;
}

.pta-site-selector-footer .pta-btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    font-family: var(--ipm-emoji-font-family);
    font-size: 16px;
}

/* Shimmer effect for buttons */
.pta-site-selector-footer .pta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.pta-site-selector-footer .pta-btn:hover:not(:disabled)::before {
    left: 100%;
}

/* Notifications are now handled by pest-trend-analysis-public.css */

/* Body modal open state */
body.pta-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .pta-site-selector-content {
        margin: var(--ipm-spacing-lg);
        max-height: calc(100vh - var(--ipm-spacing-xxl));
        border-radius: var(--ipm-border-radius);
    }
    
    .pta-site-selector-container {
        flex-direction: column;
        gap: var(--ipm-spacing-sm);
        align-items: flex-start;
    }
    
    #pta-current-site-indicator {
        font-size: var(--ipm-font-size-sm);
    }
    
    .pta-site-meta {
        flex-direction: column;
        gap: var(--ipm-spacing-xs);
    }
    
    .pta-site-selector-header {
        padding: var(--ipm-spacing-md);
        border-radius: var(--ipm-border-radius) var(--ipm-border-radius) 0 0;
    }
    
    .pta-site-selector-footer {
        padding: var(--ipm-spacing-md);
        border-radius: 0 0 var(--ipm-border-radius) var(--ipm-border-radius);
    }
    
    .pta-site-selector-footer .pta-btn {
        width: 100%;
        justify-content: center;
        min-height: 52px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .pta-site-selector-content {
        margin: var(--ipm-spacing-sm);
        max-height: calc(100vh - var(--ipm-spacing-lg));
        border-radius: var(--ipm-border-radius);
    }
    
    .pta-site-selector-header {
        padding: var(--ipm-spacing-sm) var(--ipm-spacing-md);
    }
    
    .pta-site-selector-header h3 {
        font-size: var(--ipm-font-size-xl);
    }
    
    .pta-site-selector-footer {
        padding: var(--ipm-spacing-sm) var(--ipm-spacing-md);
    }
    
    .pta-site-selector-footer .pta-btn {
        padding: var(--ipm-spacing-md) var(--ipm-spacing-lg);
        font-size: 15px;
        min-height: 48px;
    }
}

/* Spinner and Autocomplete styles are now handled by pest-trend-analysis-public.css */

/* Document Manager Modal Styles */
.pta-document-manager-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
}

.pta-document-manager-modal.is-visible {
    display: flex !important;
    opacity: 1;
}

.pta-document-manager-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.pta-modal-content {
    position: relative;
    max-width: min(1400px, 90vw);
    max-height: 90vh;
    margin: auto;
    background: var(--ipm-bg-primary);
    border-radius: var(--ipm-border-radius-lg);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Modal Header */
.pta-modal-header {
    padding: var(--ipm-spacing-lg);
    border-bottom: var(--ipm-border-width) solid var(--ipm-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ipm-bg-gradient);
}

.pta-modal-header .pta-close-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ipm-bg-secondary, #f8f9fa);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--ipm-text-muted, #6c757d);
    cursor: pointer;
    z-index: 10;
    transition: var(--ipm-transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
    box-shadow: var(--ipm-shadow, 0 4px 16px rgba(0, 0, 0, 0.08));
}

.pta-modal-header .pta-close-btn:hover {
    background: var(--ipm-error-color, #dc3545);
    color: var(--ipm-text-white, #ffffff);
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.pta-modal-header h3 {
    margin: 0;
    font-size: var(--ipm-font-size-xxl);
    font-weight: 700;
    color: var(--ipm-text-primary);
    display: flex;
    align-items: center;
    gap: var(--ipm-spacing-sm);
}

/* Unified Close Button Style */
.pta-modal-header .pta-modal-close {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ipm-bg-secondary, #f8f9fa);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--ipm-text-muted, #6c757d);
    cursor: pointer;
    z-index: 10;
    transition: var(--ipm-transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
    box-shadow: var(--ipm-shadow, 0 4px 16px rgba(0, 0, 0, 0.08));
}

.pta-modal-header .pta-modal-close:hover {
    background: var(--ipm-error-color, #dc3545);
    color: var(--ipm-text-white, #ffffff);
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Modal Body */
.pta-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--ipm-spacing-lg);
    background: var(--ipm-bg-primary);
}

/* Document Manager Specific Styles */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--ipm-spacing-lg);
    margin: var(--ipm-spacing-lg) 0;
}

.document-card {
    background: var(--ipm-bg-primary);
    border: none;
    border-radius: var(--ipm-border-radius);
    box-shadow: var(--ipm-shadow);
    transition: var(--ipm-transition);
    overflow: hidden;
    position: relative;
}

.document-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ipm-primary-color) 0%, var(--ipm-secondary-color) 100%);
}

.document-card:hover {
    box-shadow: var(--ipm-shadow-hover);
}

.document-card.validated {
	box-shadow: none;
}

.document-card-header {
    display: flex;
    gap: var(--ipm-spacing-md);
    padding: var(--ipm-spacing-lg);
    background: var(--ipm-bg-secondary);
    border-bottom: var(--ipm-border-width) solid var(--ipm-border-color);
}

.document-icon {
    flex-shrink: 0;
    color: var(--ipm-primary-color);
    font-size: var(--ipm-font-size-lg);
}

.document-info {
    flex: 1;
    min-width: 0;
}

.document-id-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--ipm-primary-color) 0%, var(--ipm-accent-color) 100%);
    color: var(--ipm-text-white);
    padding: var(--ipm-spacing-xs) var(--ipm-spacing-md);
    border-radius: 20px;
    font-size: var(--ipm-font-size-sm);
    font-weight: 600;
    margin-bottom: var(--ipm-spacing-sm);
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 127, 95, 0.2);
}

.document-title {
    margin: 0 0 var(--ipm-spacing-sm) 0;
    font-size: var(--ipm-font-size-lg);
    font-weight: 600;
    color: var(--ipm-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-meta {
    display: flex;
    gap: var(--ipm-spacing-md);
    flex-wrap: wrap;
    font-size: var(--ipm-font-size-sm);
    color: var(--ipm-text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--ipm-spacing-xs);
}

.meta-item .dashicons {
    font-size: var(--ipm-font-size-lg);
    width: var(--ipm-font-size-lg);
    height: var(--ipm-font-size-lg);
    color: var(--ipm-text-muted);
}

.document-card-body {
    padding: var(--ipm-spacing-lg);
    font-size: var(--ipm-font-size-base);
}

.document-card-body > div {
    display: flex;
    align-items: flex-start;
    gap: var(--ipm-spacing-sm);
    margin-bottom: var(--ipm-spacing-md);
    color: var(--ipm-text-secondary);
}

.document-card-body > div:last-child {
    margin-bottom: 0;
}

.document-card-body .dashicons {
    font-size: var(--ipm-font-size-xl);
    width: var(--ipm-font-size-xl);
    height: var(--ipm-font-size-xl);
    color: var(--ipm-text-muted);
    flex-shrink: 0;
    margin-top: 1px;
}

.document-validation {
    color: var(--ipm-primary-color) !important;
}

.document-validation .dashicons {
    color: var(--ipm-primary-color) !important;
}

.document-card-footer {
    padding: var(--ipm-spacing-md) var(--ipm-spacing-lg);
    background: var(--ipm-bg-secondary);
    border-top: var(--ipm-border-width) solid var(--ipm-border-color);
}

/* Loading States */
.documents-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--ipm-spacing-xxl);
    color: var(--ipm-text-muted);
    font-size: var(--ipm-font-size-base);
}

.documents-loading .pta-spinner {
    margin-bottom: var(--ipm-spacing-md);
}

/* Error State */
.documents-error {
    padding: var(--ipm-spacing-xl);
    background: rgba(255, 193, 7, 0.1);
    color: var(--ipm-warning-color);
    /* border: var(--ipm-border-width) solid var(--ipm-warning-color); */
    border-radius: var(--ipm-border-radius);
    text-align: center;
    font-size: var(--ipm-font-size-base);
}

.documents-error .dashicons {
    font-size: var(--ipm-font-size-xxl);
    width: var(--ipm-font-size-xxl);
    height: var(--ipm-font-size-xxl);
    vertical-align: middle;
    margin-right: var(--ipm-spacing-sm);
}

/* No Documents State */
.no-documents {
    padding: var(--ipm-spacing-xxl);
    text-align: center;
    background: var(--ipm-bg-secondary);
    border: 2px dashed var(--ipm-border-color);
    box-shadow: none;
    border-radius: var(--ipm-border-radius);
}

.no-documents svg {
    margin-bottom: var(--ipm-spacing-lg);
}

.no-documents h3 {
    margin: 0 0 var(--ipm-spacing-sm) 0;
    font-size: var(--ipm-font-size-xl);
    color: var(--ipm-text-secondary);
}

.no-documents p {
    margin: 0;
    color: var(--ipm-text-muted);
}

/* Pagination Styles */
.document-pagination {
    margin-top: var(--ipm-spacing-xl);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: var(--ipm-spacing-sm);
}

.page-item a,
.page-item span {
    display: flex;
    align-items: center;
    padding: var(--ipm-spacing-sm) var(--ipm-spacing-md);
    border: none;
    text-decoration: none;
    color: var(--ipm-text-secondary);
    background: var(--ipm-bg-primary);
    border-radius: var(--ipm-border-radius);
    transition: var(--ipm-transition);
    font-size: var(--ipm-font-size-base);
    box-shadow: var(--ipm-shadow);
}

.page-item a:hover {
    background: var(--ipm-hover-bg);
    /* border-color: var(--ipm-primary-color); */
    color: var(--ipm-primary-color);
    box-shadow: var(--ipm-shadow-lg);
}

.page-item.active a {
    background: linear-gradient(135deg, var(--ipm-primary-color) 0%, var(--ipm-accent-color) 100%);
    color: var(--ipm-text-white);
    /* border-color: var(--ipm-primary-color); */
}

.page-item.disabled span {
    color: var(--ipm-text-muted);
    cursor: not-allowed;
    opacity: var(--ipm-disabled-opacity);
}

.pagination-info {
    margin-top: var(--ipm-spacing-md);
    text-align: center;
    color: var(--ipm-text-muted);
    font-size: var(--ipm-font-size-base);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--ipm-spacing-sm);
    padding: var(--ipm-spacing-md) var(--ipm-spacing-xl);
    border: none;
    background: linear-gradient(135deg, var(--ipm-primary-color) 0%, var(--ipm-accent-color) 100%);
    color: var(--ipm-text-white);
    text-decoration: none;
    border-radius: var(--ipm-border-radius);
    cursor: pointer;
    font-size: var(--ipm-font-size-base);
    font-weight: 600;
    transition: var(--ipm-transition);
    width: 100%;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 127, 95, 0.25);
    min-height: 48px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover:not(:disabled)::before {
    left: 100%;
}

.btn:hover {
    background: linear-gradient(135deg, var(--ipm-accent-color) 0%, #003d32 100%);
    box-shadow: 0 6px 16px rgba(0, 127, 95, 0.35);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 127, 95, 0.25);
}

.btn:disabled {
    opacity: var(--ipm-disabled-opacity);
    cursor: not-allowed;
    transform: none !important;
}

.btn .dashicons {
    font-size: var(--ipm-font-size-xl);
    width: var(--ipm-font-size-xl);
    height: var(--ipm-font-size-xl);
    flex-shrink: 0;
}

/* Focus indicators for accessibility */
.pta-focus-indicator {
	outline: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pta-modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: var(--ipm-spacing-sm);
        border-radius: 0;
    }
    
    /* Global responsive styles are now in the core design system css. */
    
    .documents-grid {
        grid-template-columns: 1fr;
        gap: var(--ipm-spacing-md);
    }
    
    .document-card-header {
        padding: var(--ipm-spacing-md);
    }
    
    .document-card-body {
        padding: var(--ipm-spacing-md);
    }
    
    .document-meta {
        flex-direction: column;
        gap: var(--ipm-spacing-sm);
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: var(--ipm-spacing-xs);
    }
    
    .pta-modal-header {
        padding: var(--ipm-spacing-md);
        border-radius: 0;
    }
    
    .pta-modal-body {
        padding: var(--ipm-spacing-md);
    }
}
/* ====================================
   DOCUMENT MANAGER BUTTON STYLES
   ==================================== */
.pta-document-manager-button-container {
    display: flex;
    justify-content: center;
    margin-top: var(--ipm-spacing-lg);
}

#pta-open-document-manager {
    background: linear-gradient(135deg, var(--ipm-primary-color) 0%, var(--ipm-accent-color) 100%);
    color: var(--ipm-text-white);
    box-shadow: 0 4px 12px rgba(0, 127, 95, 0.25);
}

#pta-open-document-manager:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--ipm-accent-color) 0%, #003d32 100%);
    box-shadow: 0 6px 16px rgba(0, 127, 95, 0.35);
}

/* ====================================
   DOCUMENT MANAGER MODAL STYLES
   ==================================== */
#document-manager-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}

#document-manager-modal .pta-modal-content {
    width: min(1200px, 95vw);
    max-height: 90vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: var(--ipm-bg-primary);
    border-radius: var(--ipm-border-radius-lg);
    box-shadow: none;
    position: relative;
}

.pta-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--ipm-spacing-lg);
    border-bottom: 2px solid var(--ipm-border-color);
    background: var(--ipm-bg-gradient);
    border-radius: var(--ipm-border-radius-lg) var(--ipm-border-radius-lg) 0 0;
}

.pta-modal-header h2 {
    margin: 0;
    font-size: var(--ipm-font-size-xxl);
    font-weight: 700;
    color: var(--ipm-text-primary);
    display: flex;
    align-items: center;
    gap: var(--ipm-spacing-sm);
}


.pta-modal-close .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    font-weight: bold;
}

.pta-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--ipm-spacing-lg);
    background: var(--ipm-bg-primary);
}

/* ====================================
   DOCUMENT MANAGER TOOLBAR - OPTIMIZED LAYOUT
   ==================================== */
.pta-documents-toolbar {
    display: flex;
    gap: var(--ipm-spacing-md);
    margin-bottom: var(--ipm-spacing-lg);
    flex-wrap: wrap;
    align-items: stretch; /* Ensure all elements have same height */
    padding: var(--ipm-spacing-sm);
    background: var(--ipm-bg-secondary);
    border-radius: var(--ipm-border-radius);
    box-shadow: var(--ipm-shadow);
    border: 1px solid var(--ipm-border-color);
}

.pta-search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

#document-search.pta-search-input {
    width: 100%;
    padding: var(--ipm-spacing-md);
    padding-left: 40px;
    border: 1px solid var(--ipm-border-color);
    border-radius: var(--ipm-border-radius);
    font-size: var(--ipm-font-size-base);
    background: var(--ipm-bg-primary);
    color: var(--ipm-text-primary);
    transition: var(--ipm-transition);
    min-height: 44px; /* Match other elements */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

#document-search.pta-search-input:focus {
    outline: none;
    border-color: var(--ipm-border-color-focus);
    box-shadow: var(--ipm-focus-shadow);
}

#document-search.pta-search-input:hover {
    border-color: var(--ipm-primary-color);
    box-shadow: var(--ipm-shadow);
}

.pta-search-box .dashicons {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ipm-text-muted);
    pointer-events: none;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.pta-filter-controls {
    display: flex;
    gap: var(--ipm-spacing-sm);
    align-items: stretch; /* Match toolbar alignment */
    flex-wrap: nowrap;
    min-width: fit-content;
}

.pta-documents-toolbar .pta-filter-select {
    padding: var(--ipm-spacing-sm) var(--ipm-spacing-md);
    border: 1px solid var(--ipm-border-color);
    border-radius: var(--ipm-border-radius);
    font-size: var(--ipm-font-size-sm);
    background: var(--ipm-bg-primary);
    color: var(--ipm-text-primary);
    cursor: pointer;
    transition: var(--ipm-transition);
    min-height: 44px; /* Match refresh button height */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.pta-documents-toolbar .pta-filter-select:hover {
    border-color: var(--ipm-primary-color);
    box-shadow: var(--ipm-shadow);
}

.pta-documents-toolbar .pta-filter-select:focus {
    outline: none;
    border-color: var(--ipm-border-color-focus);
    box-shadow: var(--ipm-focus-shadow);
}

/* ====================================
   REFRESH DOCUMENTS BUTTON - OPTIMIZED
   ==================================== */

/* Fix selector specificity - target pta-btn instead of btn */
.pta-documents-toolbar #refresh-documents.pta-btn {
    padding: var(--ipm-spacing-sm) var(--ipm-spacing-md);
    min-width: 44px;
    min-height: 44px;
    width: auto; /* Allow flexible width for text + icon */
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    gap: var(--ipm-spacing-xs);
    white-space: nowrap;
    font-size: var(--ipm-font-size-sm);
    font-weight: 600;
    border-radius: var(--ipm-border-radius);
    transition: var(--ipm-transition);
    position: relative;
    overflow: hidden;
}

/* Icon styling within refresh button */
.pta-documents-toolbar #refresh-documents.pta-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: inherit;
}

/* Hover effects for refresh button */
.pta-documents-toolbar #refresh-documents.pta-btn:hover:not(:disabled) {
    box-shadow: var(--ipm-shadow-hover);
}

/* Loading state for refresh button */
.pta-documents-toolbar #refresh-documents.pta-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.pta-documents-toolbar #refresh-documents.pta-btn.loading .dashicons {
    animation: pta-spin 1s linear infinite;
}

/* ====================================
   ACCESSIBILITY ENHANCEMENTS
   ==================================== */

/* Focus indicators */
.pta-documents-toolbar #refresh-documents.pta-btn:focus-visible {
    outline: 2px solid var(--ipm-border-color-focus);
    outline-offset: 2px;
    box-shadow: var(--ipm-focus-shadow);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pta-documents-toolbar #refresh-documents.pta-btn {
        border: 2px solid currentColor;
        font-weight: 700;
    }
    
    .pta-documents-toolbar {
        border: 2px solid var(--ipm-border-color);
    }
    
    #document-search.pta-search-input,
    .pta-documents-toolbar .pta-filter-select {
        border: 2px solid var(--ipm-border-color);
        font-weight: 600;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .pta-documents-toolbar #refresh-documents.pta-btn.loading .dashicons {
        animation: none;
    }
    
    .pta-documents-toolbar #refresh-documents.pta-btn,
    #document-search.pta-search-input,
    .pta-documents-toolbar .pta-filter-select {
        transition: none;
    }
}

/* Touch target improvements for mobile */
@media (max-width: 768px) {
    .pta-documents-toolbar #refresh-documents.pta-btn,
    #document-search.pta-search-input,
    .pta-documents-toolbar .pta-filter-select {
        min-height: 48px; /* Minimum touch target size */
    }
}

/* Icon-only variant for tablet */
@media (max-width: 768px) and (min-width: 481px) {
    .pta-documents-toolbar #refresh-documents.pta-btn {
        padding: var(--ipm-spacing-sm);
        width: 44px;
        min-width: 44px;
    }
    
    /* Hide text on tablet, keep only icon */
    .pta-documents-toolbar #refresh-documents.pta-btn > span:not(.dashicons) {
        display: none;
    }
}

/* Site Selector styles are already in site-manager.css, so we don't need to move them. */

/* ====================================
   RESPONSIVE DESIGN - OPTIMIZED FOR ALL DEVICES
   ==================================== */
@media (max-width: 1024px) {
    .pta-documents-toolbar {
        gap: var(--ipm-spacing-sm);
        padding: var(--ipm-spacing-sm);
    }
    
    .pta-filter-controls {
        gap: var(--ipm-spacing-xs);
    }
}

@media (max-width: 768px) {
    #document-manager-modal .pta-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .pta-modal-header {
        padding: var(--ipm-spacing-md);
        border-radius: 0;
    }
    
    .pta-modal-body {
        padding: var(--ipm-spacing-md);
    }
    
    .pta-documents-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--ipm-spacing-md);
        padding: var(--ipm-spacing-md);
    }
    
    .pta-search-box {
        min-width: 100%;
        order: 1; /* Search first on mobile */
    }
    
    .pta-filter-controls {
        width: 100%;
        flex-wrap: wrap;
        order: 2; /* Filters second */
        justify-content: space-between;
    }
    
    .pta-filter-select {
        flex: 1;
        min-width: 0;
        margin-right: var(--ipm-spacing-sm);
    }
    
    .pta-filter-select:last-child {
        margin-right: 0;
    }
    
    /* Refresh button gets full row on very small screens */
    .pta-documents-toolbar #refresh-documents.pta-btn {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: var(--ipm-spacing-sm);
    }
    
    /* Show text on mobile when full width */
    .pta-documents-toolbar #refresh-documents.pta-btn > span:not(.dashicons) {
        display: inline;
    }
}

@media (max-width: 480px) {
    .pta-documents-toolbar {
        padding: var(--ipm-spacing-sm);
        gap: var(--ipm-spacing-sm);
    }
    
    .pta-filter-controls {
        flex-direction: column;
        gap: var(--ipm-spacing-sm);
    }
    
    .pta-filter-select {
        margin-right: 0;
        width: 100%;
    }
    
    #document-search.pta-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}