/* Order Requirement Form Styles - Excel Style Spreadsheet */

/* Main Container */
.orf-spreadsheet-container, .orf-admin-spreadsheet-container {
    margin: 0px!important;
    background: transparent;
    border-radius: 8px;
    box-shadow: none;
}

/* Header Row with Export Button */
.orf-header-row, .orf-admin-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: justify!important;
}

.orf-header-row h2{
    color: #fff!important;
}

.orf-header-row h2, .orf-admin-header-row h3 {
    margin: 0;
    font-size: 1.5em;
    color: #fff;
    flex: 1;
}

.orf-notes-textarea::placeholder{
    color: black!important;
}

.orf-export-btn {
    background: #0073aa;
    color: #fff !important;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.orf-export-btn:hover {
    background: #005a87 !important;
    color: #fff !important;
}

/* Legacy header styles for backwards compatibility */
.orf-spreadsheet-container h2, .orf-admin-spreadsheet-container h2 {
    margin-bottom: 15px;
    font-size: 1.5em;
    color: #333;
}

.orf-instructions, .orf-admin-instructions {
    background: #e7f3ff;
    padding: 12px 15px;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
    margin-bottom: 20px;
    font-size: 14px;
    color: #333;
}

/* Spreadsheet Wrapper */
.orf-spreadsheet-wrapper, .orf-admin-spreadsheet-wrapper {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: auto;
    max-height: 600px;
    border: 1px solid #ddd;
}

/* Spreadsheet Table */
.orf-spreadsheet, .orf-admin-spreadsheet {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
}

/* Table Headers */
.orf-spreadsheet thead th, .orf-admin-spreadsheet thead th {
    background: #8C8C8C;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.orf-spreadsheet thead th, .orf-admin-spreadsheet thead tr{
    border: none!important;
}

.orf-spreadsheet thead th:first-child, .orf-admin-spreadsheet thead th:first-child {
    background: linear-gradient(to bottom, #f0f0f0, #d8d8d8);
    text-align: center;
    font-weight: bold;
    color: #666;
}

/* Table Rows */
.orf-spreadsheet tbody tr, .orf-admin-spreadsheet tbody tr {
    background: #fff;
}

.orf-spreadsheet tbody tr:nth-child(even), .orf-admin-spreadsheet tbody tr:nth-child(even) {
    background: #fff;
}

.orf-spreadsheet tbody tr:hover, .orf-admin-spreadsheet tbody tr:hover {
    background: #f0f8ff;
}

.orf-admin-spreadsheet tbody tr.has-data {
    border-left: 3px solid #46b450;
}

.orf-admin-spreadsheet tbody tr.no-data {
    border-left: 3px solid #dc3232;
}

/* Table Cells */
.orf-spreadsheet td, .orf-admin-spreadsheet td {
    border: 1px solid #ececec;
    padding: 0px;
    position: relative;
    vertical-align: middle;
}

.row-number {
    background: linear-gradient(to bottom, #f5f5f5, #e8e8e8);
    text-align: center;
    font-weight: bold;
    color: #666;
    min-width: 40px;
    padding: 8px 6px !important;
}

/* Input Fields */
.orf-cell, .orf-admin-cell {
    width: 100%;
    border: none;
    padding: 25px 12px;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    outline: none;
    box-sizing: border-box;
    height: 100%;
}

.orf-cell:focus, .orf-admin-cell:focus {
    background: #fff;
}

/* Readonly/Admin Only Fields */
.orf-cell.readonly, .orf-admin-cell.readonly {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

.orf-cell.admin-only, .orf-admin-cell.admin-only-field {
    background: #fff8dc;
    border-left: 3px solid #ff9900;
}

/* Admin Only Badge */
.admin-only-badge {
    background: #ff9900;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    font-weight: normal;
}

/* Actions */
.orf-actions, .orf-admin-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
    align-items: center;
}

.orf-save-btn, .orf-admin-save-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.orf-save-btn:hover, .orf-admin-save-btn:hover {
    background: #005a87;
}

.orf-clear-btn, .orf-admin-export-btn {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.orf-clear-btn:hover, .orf-admin-export-btn:hover {
    background: #e0e0e0;
}

/* Actions Cell */
.actions-cell {
    text-align: center;
    padding: 8px !important;
}

/* Copy/Paste Highlighting */
.orf-cell.copying, .orf-admin-cell.copying {
    background: #e7f3ff !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

/* Enhanced Selection Styles for Better Copy Behavior */
.orf-excel-selection {
    position: relative;
}

.orf-excel-selection:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #1f7ce8;
    pointer-events: none;
    box-sizing: border-box;
}

.orf-excel-primary-selection:after {
    border-color: #0066cc;
    border-width: 3px;
    box-shadow: none;
}

/* Visual feedback for vertical selection */
.orf-vertical-selection {
    border: none;
}

/* Visual feedback for horizontal selection */
.orf-horizontal-selection {
border: none;
}

/* Improve table cell user selection for copy operations */
.orf-spreadsheet td, .orf-admin-spreadsheet td {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Ensure DA display content is selectable for copying */
.orf-da-display {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.orf-da-display .orf-product-name,
.orf-da-display .orf-attribute-line {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    cursor: text;
}

/* Selection Styles */
.orf-cell.selected, .orf-admin-cell.selected {
    background: #0073aa !important;
    color: #fff;
}

/* Error States */
.orf-cell.error, .orf-admin-cell.error {
border: none;
}

/* Success States */
.orf-cell.success, .orf-admin-cell.success {
    border: none;
}

/* No Data Messages */
.orf-no-admin-data {
display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .orf-spreadsheet-wrapper, .orf-admin-spreadsheet-wrapper {
        max-height: 400px;
    }
    
    .orf-spreadsheet, .orf-admin-spreadsheet {
        font-size: 12px;
    }
    
    .orf-actions, .orf-admin-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .orf-actions button, .orf-admin-actions button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Responsive header row */
    .orf-header-row, .orf-admin-header-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    
    .orf-header-row h2, .orf-admin-header-row h3 {
        margin-bottom: 0;
        flex: 1;
        font-size: 1.2em;
    }
    
    .orf-export-btn {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }
}

/* Loading States */
.orf-loading {
    position: relative;
}

.orf-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tooltips */
.orf-tooltip {
    position: relative;
    cursor: help;
}

.orf-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.orf-tooltip:hover::after {
    opacity: 1;
}

/* WooCommerce Integration */
.woocommerce .orf-spreadsheet-container {
    margin: 20px 0;
}

/* Admin Specific Styles */
.orf-admin-spreadsheet-container .widefat {
    border: none;
    box-shadow: none;
}

.orf-admin-spreadsheet-container .button-primary {
    background: #2271b1;
    border-color: #2271b1;
}

.orf-admin-spreadsheet-container .button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

/* Order Requirement Form Styles */

.orf-forms-container {
    margin: 30px 0;
    padding: 20px;
    background: #f7f7f7;
    border-radius: 5px;
}

.orf-forms-container h2 {
    margin-bottom: 20px;
    font-size: 1.5em;
}

.orf-form-group {
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.orf-form-group h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.orf-form-table {
    width: 100%;
    border-collapse: collapse;
}

.orf-form-table th {
    width: 30%;
    text-align: left;
    padding: 10px 0;
    vertical-align: top;
}

.orf-form-table td {
    width: 70%;
    padding: 8px 0;
}

.orf-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.orf-admin-table {
    margin-top: 10px;
}

.orf-admin-table th {
    padding: 10px;
    background: #f4f4f4;
}

.orf-admin-table td {
    padding: 10px;
}

/* Style the submit button */
#orf-requirement-forms button[type="submit"] {
    margin-top: 15px;
    background-color: #2271b1;
    color: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 3px;
}

#orf-requirement-forms button[type="submit"]:hover {
    background-color: #135e96;
}

/* Admin styles */
.orf-no-data {
    padding: 15px;
    background-color: #f8f8f8;
    border-left: 4px solid #dc3232;
    color: #777;
    font-style: italic;
}

.orf-no-data-message {
    padding: 20px;
    background-color: #f8f8f8;
    border-left: 4px solid #dc3232;
    font-size: 14px;
    color: #555;
}

/* Order details admin dashboard */
.order_data_column .dashicons {
    line-height: 1.5;
}

/* Admin order requirement summary */
.orf-admin-summary-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.orf-admin-summary-item:last-child {
    border-bottom: none;
}

.orf-admin-details {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.orf-admin-details div {
    margin-bottom: 5px;
}

/* Direct display of requirements in My Account page */
.woocommerce-order-details .orf-admin-summary-item {
    background-color: #f7f7f7;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.woocommerce-order-details .orf-admin-details {
    border-left: 3px solid #2271b1;
    background-color: #fff;
}

/* Existing data display */
.orf-existing-data {
    margin-bottom: 30px;
}

.orf-existing-data .orf-admin-summary-item {
    background-color: #f7f7f7;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #2271b1;
}

.orf-edit-notice {
    background-color: #f0f8ff;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid #007cba;
    color: #333;
}

/* Read-only for customer styling */
.orf-cell.readonly-for-customer {
    background: #f0f8ff;
    color: #666;
    border-left: 3px solid #0073aa;
}

/* Notes field styling */
.orf-notes-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
}

.orf-notes-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.orf-notes-textarea {
    transition: border-color 0.2s, box-shadow 0.2s;
}

.orf-notes-textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
    outline: none;
}

.orf-notes-textarea[readonly] {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
    border-left: 3px solid #dc3232;
}

/* Confirmation section styling */
.orf-confirmation-section {
    border-left: 4px solid #ff00c3;
}


#orf-confirm-submission[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Last customer note styling */
.orf-last-note {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Submission Control Styles */

/* Locked Form Styles */
.orf-form-locked {
    position: relative;
    opacity: 0.9;
}

.orf-cell.locked-submission {
    background: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed !important;
    border-left: 3px solid #dc3232;
}

/* Submitted Form Styles */
.orf-form-submitted {
    position: relative;
}

.orf-cell.submitted-readonly {
    background: #f0f8ff !important;
    color: #666 !important;
    border-left: 3px solid #0073aa;
    cursor: not-allowed;
}

.orf-save-btn:disabled {
    background: #999 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* Lock Notice */
.orf-lock-notice {
    background: linear-gradient(135deg, #fff5f5, #ffe6e6);
    border: 2px solid #dc3232;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(220, 50, 50, 0.1);
}

.orf-lock-icon {
    font-size: 2em;
    opacity: 0.8;
}

.orf-lock-content h3 {
    margin: 0 0 10px 0;
    color: #dc3232;
    font-size: 1.2em;
}

.orf-lock-content p {
    margin: 5px 0;
    color: #666;
    line-height: 1.5;
}

/* Re-Edit Notice */
.orf-re-edit-notice {
    background: linear-gradient(135deg, #f0fff0, #e6ffe6);
    border: 2px solid #46b450;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(70, 180, 80, 0.1);
}

.orf-re-edit-icon {
    font-size: 2em;
    opacity: 0.8;
}

.orf-re-edit-content h3 {
    margin: 0 0 10px 0;
    color: #46b450;
    font-size: 1.2em;
}

.orf-re-edit-content p {
    margin: 5px 0;
    color: #666;
    line-height: 1.5;
}

/* Submission Progress */
.orf-submitting {
    position: relative;
    pointer-events: none;
}

.orf-submission-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

.orf-submission-progress {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 300px;
}

.orf-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.orf-submission-progress h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1em;
}

.orf-submission-progress p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

/* Admin Submission Controls */
.orf-admin-submission-controls {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.orf-admin-submission-controls h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

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

.orf-control-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 250px;
}

.orf-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.orf-status-badge.can-edit {
    background: #28a745;
    border: 1px solid #1e7e34;
}

.orf-status-badge.locked {
    background: #dc3545;
    border: 1px solid #bd2130;
}

.orf-control-label {
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.4;
}

.orf-control-actions {
    flex-shrink: 0;
}

.orf-unlock-customer-edit,
.orf-lock-customer-edit {
    min-width: 120px;
    font-weight: 500;
}

.orf-unlock-customer-edit {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.orf-unlock-customer-edit:hover {
    background: #218838;
    border-color: #1e7e34;
}

.orf-lock-customer-edit {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.orf-lock-customer-edit:hover {
    background: #c82333;
    border-color: #bd2130;
}

/* Mobile Responsiveness for Submission Controls */
@media (max-width: 768px) {
    .orf-lock-notice,
    .orf-re-edit-notice {
        flex-direction: column;
        text-align: center;
    }
    
    .orf-lock-icon,
    .orf-re-edit-icon {
        font-size: 1.5em;
    }
    
    .orf-control-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .orf-control-info {
        flex-direction: column;
        text-align: center;
        min-width: auto;
    }
    
    .orf-control-actions {
        align-self: stretch;
    }
    
    .orf-unlock-customer-edit,
    .orf-lock-customer-edit {
        width: 100%;
    }
    
    .orf-submission-progress {
        padding: 30px 20px;
        margin: 20px;
    }
}

/* Status Indicators */
.orf-submission-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 600;
}

.orf-submission-status.first-time {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.orf-submission-status.locked {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.orf-submission-status.re-edit {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Live Link Styling */
.orf-live-link {
    display: inline-block;
    padding: 8px 12px;
    color: #ff0055!important;
    text-decoration: none;
    background: #f0f8ff;
    border: 1px solid #0073aa;
    border-radius: 3px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    height: 100%;
    line-height: 1.4;
    word-break: break-all;
}

.orf-live-link:hover {
    background: #e6f3ff;
    color: #005a87;
    text-decoration: underline;
}

.orf-live-link-placeholder {
    display: inline-block;
    padding: 8px 12px;
    color: #999;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    font-style: italic;
    width: 100%;
    box-sizing: border-box;
    height: 100%;
    line-height: 1.4;
}

/* Fill Requirements Button Styling */
.orf-fill-requirements-notice {
    text-align: center;
    margin-bottom: 60px;
}

.orf-fill-requirements-notice h3 {
    margin: 0 0 15px 0;
    color: #0073aa;
    font-size: 1.3em;
}

.orf-fill-requirements-notice p {
    margin: 0 0 15px 0;
    color: #333;
    line-height: 1.5;
}

.orf-fill-requirements-notice .button {
    background: linear-gradient(90deg, #ff0055 0%, #008cff 100%) !important;
    color: #fff !important;
    padding: 20px 24px!important;
    font-size: 22px;
    border-radius: 20px!important;
    text-decoration: none;
    font-weight: 600;
    border: none;
    display: inline-block;
}


/* Customer My Account Orders Export Button */
.woocommerce-account .woocommerce-orders-table .button.orf_export,
.woocommerce-MyAccount-content .woocommerce-orders-table .button.orf_export {
    background: linear-gradient(135deg, #e91e63 0%, #673ab7 50%, #2196f3 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    margin: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.woocommerce-account .woocommerce-orders-table .button.orf_export:before,
.woocommerce-MyAccount-content .woocommerce-orders-table .button.orf_export:before {
    content: ''; /* Remove download icon */
    display: none;
}

.woocommerce-account .woocommerce-orders-table .button.orf_export:hover,
.woocommerce-MyAccount-content .woocommerce-orders-table .button.orf_export:hover {
    /* background: #005a87 !important;
    border-color: #005a87 !important; */
    color: #fff !important;
}

/* Ensure buttons align properly in the actions column */
.woocommerce-orders-table__cell-order-actions .button {
    margin: 0 2px !important;
    vertical-align: middle !important;
}

/* Order Actions Export Button (Original admin styles - keeping for backward compatibility) */
.wc-action-button-orf_export::after {
    content: ''; /* Remove download icon */
    display: none;
}

.wc-action-button-orf_export:hover::after {
    color: #005a87;
}

/* Additional styling for order actions */
a.button.wc-action-button-orf_export {
    background: #0073aa !important;
    color: #fff !important;
    border: 1px solid #0073aa !important;
    padding: 4px 8px !important;
    margin: 0 2px !important;
    border-radius: 3px !important;
    text-decoration: none !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    display: inline-block !important;
}

a.button.wc-action-button-orf_export:hover {
    background: #005a87 !important;
    border-color: #005a87 !important;
    color: #fff !important;
}

/* For HPOS orders table */
.woocommerce_page_wc-orders .wc-action-button-orf_export {
    background: #0073aa !important;
    color: #fff !important;
    border: 1px solid #0073aa !important;
    padding: 4px 8px !important;
    margin: 0 2px !important;
    border-radius: 3px !important;
    text-decoration: none !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    display: inline-block !important;
}

.woocommerce_page_wc-orders .wc-action-button-orf_export:hover {
    background: #005a87 !important;
    border-color: #005a87 !important;
    color: #fff !important;
}

/* Ensure export button appears in traditional orders table */
.wp-admin.post-type-shop_order .wc-action-button-orf_export {
    background: #0073aa !important;
    color: #fff !important;
    border: 1px solid #0073aa !important;
    padding: 4px 8px !important;
    margin: 0 2px !important;
    border-radius: 3px !important;
    text-decoration: none !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    display: inline-block !important;
}

.wp-admin.post-type-shop_order .wc-action-button-orf_export:hover {
    background: #005a87 !important;
    border-color: #005a87 !important;
    color: #fff !important;
}

/* Debug styles for troubleshooting */
.orf-debug-export-button {
    background: red !important;
    color: white !important;
    padding: 10px !important;
    margin: 5px !important;
    border: 2px solid yellow !important;
    font-weight: bold !important;
}

/* Responsive styling for customer orders table */
@media (max-width: 768px) {
    .woocommerce-account .woocommerce-orders-table .button.orf_export,
    .woocommerce-MyAccount-content .woocommerce-orders-table .button.orf_export {
        font-size: 11px !important;
        padding: 4px 8px 4px 24px !important; /* Adjust padding for smaller icon */
    }
    
    .woocommerce-account .woocommerce-orders-table .button.orf_export:before,
    .woocommerce-MyAccount-content .woocommerce-orders-table .button.orf_export:before {
        display: none;
    }
    
    .woocommerce-orders-table__cell-order-actions .button {
        display: block !important;
        margin: 2px 0 !important;
        width: 100% !important;
    }
}

/* Responsive Design for Fill Requirements Notice */
@media (max-width: 768px) {
    .orf-fill-requirements-notice {
        padding: 15px;
        margin: 15px 0;
    }
    
    .orf-fill-requirements-notice h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .orf-fill-requirements-notice p {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .orf-fill-requirements-notice .button {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
    }
}

/* Subscription Requirements Admin Styles */

.orf-admin-container {
    background: #fff;
    margin: 20px 0;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.orf-products-filter {
    padding: 20px;
    border-bottom: 1px solid #e1e1e1;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.orf-products-filter h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.3em;
}

.orf-products-filter p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.orf-products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.orf-products-table th,
.orf-products-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
    vertical-align: middle;
}

.orf-products-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e1e1e1;
}

.orf-products-table tbody tr {
    transition: background-color 0.2s;
}

.orf-products-table tbody tr:hover {
    background: #f8f9fa;
}

.orf-expand-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.orf-expand-toggle:hover {
    background: #e9ecef;
}

.orf-expand-icon {
    font-size: 14px;
    color: #0073aa;
    transition: transform 0.2s;
    width: 16px;
    text-align: center;
}

.orf-expand-icon.expanded {
    transform: rotate(90deg);
}

.orf-product-fields {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.orf-product-fields.show {
    display: table-row;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.orf-field-config {
    background: #f9f9f9;
    padding: 20px;
    margin: 0;
    border-left: 4px solid #0073aa;
}

.orf-field-config h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.1em;
    border-bottom: 1px solid #e1e1e1;
    padding-bottom: 10px;
}

.orf-field-row {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    background: #fff;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e1e1e1;
}

.orf-field-row label {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    display: block;
}

.orf-field-row input,
.orf-field-row select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.orf-field-row input:focus,
.orf-field-row select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.orf-field-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e1e1e1;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.orf-add-field-form {
    background: #e7f3ff;
    padding: 20px;
    margin-top: 15px;
    border-radius: 6px;
    border: 1px solid #0073aa;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.1);
}

.orf-add-field-form h4 {
    margin: 0 0 15px 0;
    color: #0073aa;
    font-size: 1.1em;
}

/* .button-primary.orf-save-btn {
    background: #0073aa!important;
    border-color: #0073aa;
    box-shadow: none;
    text-shadow: none;
    padding: 8px 16px;
    font-weight: 500;
} */

button.button.orf-save-btn{
    background: linear-gradient(90deg, #ff0055 0%, #008cff 100%)!important;
    border-color: #0073aa;
    box-shadow: none;
    text-shadow: none;
    padding: 8px 16px;
    font-weight: 400!important;
    font-size: 15px!important;
    width: auto!important;
    border-radius: 12px!important;
}

.button-primary.orf-save-btn:hover {
    background: #005a87;
    border-color: #005a87;
}

.button-secondary.orf-delete-btn {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
    box-shadow: none;
    text-shadow: none;
    padding: 6px 12px;
    font-size: 12px;
}

.button-secondary.orf-delete-btn:hover {
    background: #c82333;
    border-color: #bd2130;
    color: #fff;
}

.orf-no-products {
    padding: 60px 40px;
    text-align: center;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px;
}

.orf-no-products::before {
    content: "📦";
    font-size: 3em;
    display: block;
    margin-bottom: 15px;
}

/* Status indicators */
.orf-products-table td:last-child {
    font-weight: 500;
}

.orf-products-table td:last-child span {
    margin-right: 5px;
}

/* Responsive Design for Subscription Admin */
@media (max-width: 1200px) {
    .orf-field-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .orf-field-row > div {
        flex: 1 1 auto;
    }
}

@media (max-width: 768px) {
    .orf-products-table {
        font-size: 12px;
    }
    
    .orf-products-table th,
    .orf-products-table td {
        padding: 8px 10px;
    }
    
    .orf-field-config {
        padding: 15px;
    }
    
    .orf-field-row {
        padding: 10px;
    }
    
    .orf-field-actions {
        flex-direction: column;
    }
    
    .orf-field-actions button {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .orf-add-field-form {
        padding: 15px;
    }
}

/* Admin Notice Styling */
.orf-subscription-notice {
    border-left-color: #0073aa !important;
}

.orf-subscription-notice p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.orf-subscription-notice .button {
    margin: 0 !important;
}

/* Loading states for admin */
.orf-admin-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.orf-admin-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Success and error states */
.orf-field-row.success {
    border-color: #46b450;
    background: #f0fff0;
}

.orf-field-row.error {
    border-color: #dc3232;
    background: #fff2f2;
}

/* Additional Subscription Requirements Admin Styles */

.orf-requirement-preview {
    margin: 20px 0;
}

.orf-requirement-preview h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1em;
}

.orf-preview-table-wrapper {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.orf-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    table-layout: fixed; /* Makes columns distribute evenly */
}

.orf-preview-table thead th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.orf-preview-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.orf-preview-table .row-number {
    background: #f8f9fa;
    text-align: center;
    font-weight: 600;
    color: #666;
    width: 40px;
}

.orf-preview-table input {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 3px;
    padding: 6px 8px;
    font-size: 13px;
    box-sizing: border-box;
}

.orf-preview-table input[readonly] {
    background: #f8f9fa;
    color: #6c757d;
}

.orf-preview-table .row-actions {
    text-align: center;
    width: 60px;
}

/* DA Field Styling */
.orf-da-display {
    padding: 10px;
    line-height: 1.4;
    font-family: "Exo 2", sans-serif;
    font-size: 13px;
    word-wrap: break-word;
    color: #000000;
}

.orf-product-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.orf-attribute-line {
    color: #666;
    font-size: 12px;
    margin-bottom: 2px;
    line-height: 1.3;
}

.orf-attribute-line:last-child {
    margin-bottom: 0;
}

.orf-da-display span {
    white-space: nowrap;
}

.orf-remove-row {
    color: #dc3545;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.orf-remove-row:hover {
    background: #dc3545;
    color: #fff;
}

.orf-add-row-section {
    margin: 15px 0;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 4px;
    transition: all 0.2s;
}

.orf-add-row-section:hover {
    background: #e9ecef;
    border-color: #0073aa;
}

.orf-add-row {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #0073aa;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
}

.orf-add-row:hover {
    background: #005a87;
    border-color: #005a87;
    color: #fff;
}

.orf-save-note {
    margin-top: 10px;
}

.orf-requirement-row {
    transition: all 0.2s;
}

.orf-requirement-row:nth-child(even) {
    background: #f8f9fa;
}

.orf-requirement-row:hover {
    background: #e3f2fd;
}

.orf-expand-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    color: #0073aa;
    font-weight: bold;
}

.orf-expand-icon.expanded {
    transform: rotate(90deg);
}

.orf-products-table .orf-expand-toggle {
    cursor: default;
    padding: 5px;
    border-radius: 3px;
    display: inline-block;
    transition: background-color 0.2s;
}

.orf-products-table .orf-expand-toggle:hover {
    background: #f0f0f0;
}

@media (max-width: 768px) {
    .orf-preview-table {
        font-size: 12px;
    }
    
    .orf-preview-table input {
        padding: 4px 6px;
        font-size: 12px;
    }
    
    .orf-add-row {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Order Requirement Rows Configuration Specific Styles */
.orf-rows-config-container {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.orf-rows-config-container .orf-field-config h4 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #23282d;
    font-weight: 600;
}

.orf-rows-config-container .orf-preview-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
}

.orf-rows-config-container .orf-preview-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}

.orf-rows-config-container .orf-preview-table th,
.orf-rows-config-container .orf-preview-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.orf-rows-config-container .orf-preview-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
}

.orf-rows-config-container .orf-preview-table input {
    width: 100%;
    min-width: 120px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
}

.orf-rows-config-container .orf-field-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e1e1e1;
}

.orf-rows-config-container .orf-save-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.orf-rows-config-container .orf-save-btn:hover {
    background: #005a87;
}

.orf-rows-config-container .orf-save-note {
    margin-top: 10px;
}

.orf-rows-config-container .orf-add-row-section {
    margin-top: 15px;
    padding: 10px 0;
}

.orf-rows-config-container .orf-add-row {
    background: #f7f7f7;
    color: #0073aa;
    border: 1px solid #0073aa;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.orf-rows-config-container .orf-add-row:hover {
    background: #0073aa;
    color: #fff;
}

.orf-rows-config-container .orf-remove-row {
    background: transparent;
    border: none;
    color: #dc3232;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background 0.2s;
}

.orf-rows-config-container .orf-remove-row:hover {
    background: #dc3232;
    color: #fff;
}

/* Responsive adjustments for the configuration */
@media (max-width: 1200px) {
    .orf-rows-config-container .orf-preview-table {
        min-width: 600px;
    }
    
    .orf-rows-config-container .orf-preview-table input {
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .orf-rows-config-container .orf-preview-table {
        min-width: 500px;
        font-size: 12px;
    }
    
    .orf-rows-config-container .orf-preview-table th,
    .orf-rows-config-container .orf-preview-table td {
        padding: 6px 8px;
    }
    
    .orf-rows-config-container .orf-preview-table input {
        min-width: 80px;
        padding: 4px 6px;
        font-size: 12px;
    }
}

/* Anchor Button Styles */
.orf-anchor-button-container {
    text-align: center;
}

#orf-anchor-to-requirements {
    background: #FF0075 !important;
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: 'Exo 2', sans-serif;
    font-size: 17px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 0, 117, 0.3);
    position: relative;
    overflow: hidden;
}


/* Responsive adjustments for anchor button */
@media (max-width: 768px) {
    .orf-anchor-button-container {
        margin-bottom: 15px;
        padding: 10px 0;
    }
    
    #orf-anchor-to-requirements {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    #orf-anchor-to-requirements::before {
        font-size: 14px;
        margin-right: 6px;
    }
} 

/* WooCommerce Integration Styles */
.orf-wc-integrated {
    border-top: none !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.orf-integration-notice {
    display: inline-block;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 3px;
    font-size: 12px;
}

/* Make sure debug info has proper styling */
.orf-admin-spreadsheet-container div[style*="background: #e7f3ff"] {
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    border-radius: 3px;
}

/* Match WooCommerce admin styling */
.orf-admin-spreadsheet-container {
    margin-top: 0;
}

/* Improve spreadsheet container appearance */
.orf-admin-spreadsheet-wrapper {
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Ensure export button matches WooCommerce style */
.orf-admin-export-btn {
    background: #f6f7f7 !important;
    border-color: #ddd !important;
    color: #50575e !important;
}

.orf-admin-export-btn:hover {
    background: #f0f0f1 !important;
    border-color: #c3c4c7 !important;
}

/* Notifications */
.orf-notification {
    z-index: 100000 !important;
} 


input.orf-admin-cell {
    padding: 30px 10px;
    border-radius: 0px;
}

select#orf-customer-edit-permission{
    width: 100%;
}

/* Fill Handle Styles */
.orf-fill-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #1f7ce8;
    border: 2px solid #fff;
    border-radius: 2px;
    cursor: crosshair;
    z-index: 1000;
    display: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: all 0.1s ease;
}

.orf-fill-handle:hover {
    background: #0066cc;
    transform: scale(1.2);
}

.orf-fill-handle.dragging {
    background: #0066cc;
    transform: scale(1.3);
}

.orf-fill-preview {
    background: rgba(31, 124, 232, 0.15) !important;
    border: 1px dashed #1f7ce8 !important;
}

.orf-fill-target {
    background: rgba(31, 124, 232, 0.25) !important;
    box-shadow: inset 0 0 0 2px #1f7ce8 !important;
}

/* Enhanced selection styles for fill handle */
.orf-spreadsheet-wrapper,
.orf-admin-spreadsheet-wrapper {
    position: relative;
}

.orf-cell-container {
    position: relative;
}

/* Smart fill preview styles */
.orf-smart-fill-preview {
    background: rgba(40, 167, 69, 0.15) !important;
    border: 1px dashed #28a745 !important;
}

.orf-series-fill-preview {
    background: rgba(255, 193, 7, 0.15) !important;
    border: 1px dashed #ffc107 !important;
}

/* Prevent text selection during fill drag */
.orf-no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}