/**
 * Invoice list page styles
 */

/* App Container */
.einvmylhdn-invoices-app {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Page Title */
.einvmylhdn-page-title {
    font-size: 24px;
    font-weight: 600;
    color: #23282d;
    margin: 0 0 20px 0;
    padding: 0;
    line-height: 1.3;
}

/* Toolbar */
.einvmylhdn-invoices-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.einvmylhdn-toolbar-left,
.einvmylhdn-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.einvmylhdn-search-input {
    width: 250px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.einvmylhdn-status-filter,
.einvmylhdn-platform-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 140px;
}

/* Status Message */
.einvmylhdn-status-message {
    margin: 15px 0;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.einvmylhdn-status-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.einvmylhdn-status-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Loading States */
.einvmylhdn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

.einvmylhdn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: einvmylhdn-spin 1s linear infinite;
}

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

/* Table */
.einvmylhdn-invoices-table-container {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.einvmylhdn-no-invoices {
    text-align: center;
    padding: 40px !important;
    font-style: italic;
    color: #666;
}

.einvmylhdn-order-link {
    font-weight: 600;
    text-decoration: none;
}

.einvmylhdn-order-link:hover {
    text-decoration: underline;
}

/* Invoice Status */
.einvmylhdn-invoice-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.einvmylhdn-invoice-status .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Platform Badge */
.einvmylhdn-platform-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.einvmylhdn-platform-woo {
    background: #7f54b3;
    color: white;
}

.einvmylhdn-platform-unknown {
    background: #6c757d;
    color: white;
}

/* Data Cells */
.einvmylhdn-uid, .einvmylhdn-uuid {
    font-family: Monaco, Consolas, 'Courier New', monospace;
    font-size: 11px;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
    color: #495057;
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.einvmylhdn-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
    background: #e3f2fd !important;
    border-color: #2196f3 !important;
    color: #1976d2 !important;
}

.einvmylhdn-clickable:hover {
    background: #bbdefb !important;
    border-color: #1976d2 !important;
    color: #0d47a1 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.einvmylhdn-no-data {
    color: #6c757d;
    font-style: italic;
}

.einvmylhdn-last-checked {
    font-size: 12px;
    color: #666;
}

/* Action Dropdown */
.einvmylhdn-action-dropdown {
    position: relative;
    display: inline-block;
}

.einvmylhdn-action-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px !important;
    height: auto !important;
    line-height: 1 !important;
    font-size: 12px !important;
    border-radius: 3px;
    cursor: pointer;
    background: #f1f1f1;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.einvmylhdn-action-toggle:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.einvmylhdn-action-toggle.is-open {
    background: #0073aa;
    border-color: #0073aa;
    color: white;
}

.einvmylhdn-action-toggle .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
    line-height: 1;
}

.einvmylhdn-action-toggle .dashicons-arrow-down-alt2 {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.einvmylhdn-action-toggle.is-open .dashicons-arrow-down-alt2 {
    transform: rotate(180deg);
}

.einvmylhdn-action-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    min-width: 180px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-top: 2px;
    padding: 4px 0;
}

.einvmylhdn-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    font-size: 13px;
    line-height: 1.4;
    color: #555;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.einvmylhdn-action-item:hover {
    background-color: #f8f9fa;
    color: #333;
}

.einvmylhdn-action-item .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #666;
}

.einvmylhdn-action-item:hover .dashicons {
    color: #0073aa;
}

/* Pagination */
.einvmylhdn-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    background: #f9f9f9;
}

.einvmylhdn-page-info {
    font-size: 14px;
    color: #666;
}

/* Modal */
.einvmylhdn-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.einvmylhdn-modal-content {
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    max-height: 80vh;
    width: 100%;
    display: flex;
    flex-direction: column;
}

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

.einvmylhdn-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.einvmylhdn-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.einvmylhdn-modal-close:hover {
    background: #f0f0f0;
}

.einvmylhdn-modal-close .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.einvmylhdn-modal-body {
    padding: 20px 24px;
    overflow: auto;
    flex: 1;
}

.einvmylhdn-response-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 16px;
    font-family: Monaco, Consolas, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    max-height: 400px;
}

/* Responsive */
@media (max-width: 782px) {
    .einvmylhdn-invoices-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .einvmylhdn-toolbar-left,
    .einvmylhdn-toolbar-right {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .einvmylhdn-search-input {
        width: 100%;
        max-width: 300px;
    }
    
    .einvmylhdn-pagination {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .einvmylhdn-modal-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    .einvmylhdn-modal-header,
    .einvmylhdn-modal-body {
        padding: 15px;
    }
    
    /* Action dropdown responsive */
    .einvmylhdn-action-menu {
        left: 0;
        right: auto;
        min-width: 160px;
    }
    
    .einvmylhdn-action-toggle {
        font-size: 11px !important;
        padding: 3px 6px !important;
    }
    
    .einvmylhdn-action-toggle .dashicons {
        font-size: 11px;
        width: 11px;
        height: 11px;
    }
}