/**
 * WooCommerce Order Editor Widget Styles
 * Provides comprehensive styling for the order editing interface
 */

/* Main Container */
.hep-order-editor {
    direction: rtl;
    background: #f8fafc;
    min-height: 100vh;
    padding: 2rem 0;
}

/* Header Section */
.hep-order-editor-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.hep-order-editor-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    text-align: center;
}

.hep-order-editor-header .hep-order-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.hep-order-info-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.hep-order-info-label {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.hep-order-info-value {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Form Container */
.hep-order-editor-form {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

/* Form Sections */
.hep-form-section {
    padding: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.hep-form-section:last-child {
    border-bottom: none;
}

.hep-form-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hep-form-section-title i {
    color: #667eea;
    font-size: 1.25rem;
}

/* Form Fields */
.hep-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.hep-form-field {
    display: flex;
    flex-direction: column;
}

.hep-form-field label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.hep-form-field.required label::after {
    content: ' *';
    color: #ef4444;
}

.hep-form-input,
.hep-form-select,
.hep-form-textarea {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.hep-form-input:focus,
.hep-form-select:focus,
.hep-form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.hep-form-input.error,
.hep-form-select.error,
.hep-form-textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.hep-form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Product Items Section */
.hep-product-items {
    background: #f8fafc;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.hep-product-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.hep-product-item:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.hep-product-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.hep-product-item-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.125rem;
}

.hep-remove-item-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hep-remove-item-btn:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.hep-remove-item-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.hep-product-item-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
    align-items: end;
}

/* Add Item Button */
.hep-add-item-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
}

.hep-add-item-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.hep-add-item-btn i {
    font-size: 1.125rem;
}

/* Form Actions */
.hep-form-actions {
    background: #f8fafc;
    padding: 2rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.hep-save-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 3rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hep-save-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.hep-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.hep-cancel-btn {
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hep-cancel-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

/* Messages */
.hep-message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.hep-message-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.hep-message-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Loading State */
.hep-loading {
    background: #3b82f6;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hep-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hep-order-editor {
        padding: 1rem 0;
    }
    
    .hep-order-editor-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .hep-order-editor-header h1 {
        font-size: 2rem;
    }
    
    .hep-order-editor-header .hep-order-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hep-form-section {
        padding: 1.5rem;
    }
    
    .hep-form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .hep-product-item-fields {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .hep-form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hep-save-btn,
    .hep-cancel-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hep-order-editor-header {
        padding: 1rem;
    }
    
    .hep-order-editor-header h1 {
        font-size: 1.75rem;
    }
    
    .hep-form-section {
        padding: 1rem;
    }
    
    .hep-product-items {
        padding: 1rem;
    }
    
    .hep-product-item {
        padding: 1rem;
    }
}

/* RTL Specific Adjustments */
.hep-order-editor {
    text-align: right;
}

.hep-form-field label {
    text-align: right;
}

.hep-product-item-header {
    flex-direction: row-reverse;
}

.hep-form-actions {
    flex-direction: row-reverse;
}

/* Focus States for Accessibility */
.hep-form-input:focus,
.hep-form-select:focus,
.hep-form-textarea:focus,
.hep-add-item-btn:focus,
.hep-save-btn:focus,
.hep-cancel-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .hep-order-editor {
        background: white;
        padding: 0;
    }
    
    .hep-form-actions,
    .hep-add-item-btn,
    .hep-remove-item-btn {
        display: none;
    }
    
    .hep-order-editor-header {
        background: white !important;
        color: black !important;
        box-shadow: none;
    }
} 