/* Purchase Order Modal Styles */

.po-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.po-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.po-modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.po-modal-header h2 i {
    margin-right: 8px;
    color: #95a5a6;
}

.po-modal .po-modal-close {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    font-size: 1.5rem !important;
    color: #95a5a6 !important;
    cursor: pointer !important;
    padding: 8px !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    font-weight: normal !important;
    min-height: auto !important;
    min-width: auto !important;
    width: auto !important;
    height: auto !important;
}

.po-modal .po-modal-close:hover {
    background-color: #f8f9fa !important;
    color: #e74c3c !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.po-modal .po-modal-close:focus {
    background-color: #f8f9fa !important;
    color: #e74c3c !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.po-modal .po-modal-close:active {
    background-color: #f8f9fa !important;
    color: #e74c3c !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.po-form {
    padding: 0 24px 24px 24px;
}

.po-form-section {
    margin-bottom: 24px;
}

.po-form-section h3 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #95a5a6;
}

.po-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: end;
}

.po-form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.po-form-group-half {
    flex: 2;
}

.po-form-group-quarter {
    flex: 1;
}

.po-form-group label {
    margin-bottom: 6px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
}

/* Aggressive styling for ALL form fields to override WordPress */
.po-modal .po-form-group input,
.po-modal .po-form-group select {
    padding: 12px !important;
    border: 2px solid #e9ecef !important;
    border-radius: 6px !important;
    font-size: 1rem !important;
    transition: border-color 0.2s ease !important;
    background-color: white !important;
    background-image: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    height: auto !important;
    min-height: auto !important;
    line-height: normal !important;
    color: #2c3e50 !important;
    font-family: inherit !important;
    font-weight: normal !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    margin: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

/* Select specific styling for dropdown arrow */
.po-modal .po-form-group select {
    cursor: pointer !important;
    /* Add custom dropdown arrow */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 12px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px 12px !important;
    padding-right: 40px !important;
}

/* Focus styling - changed from blue to grey */
.po-modal .po-form-group input:focus,
.po-modal .po-form-group select:focus {
    outline: none !important;
    border-color: #95a5a6 !important;
    box-shadow: 0 0 0 3px rgba(149, 165, 166, 0.1) !important;
    background-color: white !important;
}

.po-form-group input::placeholder {
    color: #95a5a6;
}

.po-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.po-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.po-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.po-btn-primary {
    background-color: #28a745;
    color: white;
}

.po-btn-primary:hover:not(:disabled) {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.po-btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.po-btn-secondary:hover:not(:disabled) {
    background-color: #7f8c8d;
}

/* Finalize button in main UI */
.finalize-load-btn {
    background: none !important;
    border: 1px solid #e9ecef !important;
    border-radius: 6px !important;
    color: #666 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: color 0.2s ease !important;
    padding: 10px 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    text-decoration: none !important;
    font-family: inherit !important;
    line-height: 1 !important;
    margin-top: 10px !important;
    width: auto !important;
    justify-content: flex-start !important;
}

.finalize-load-btn:hover {
    color: #495057 !important;
    background: #f8f9fa !important;
}

.finalize-load-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.finalize-load-btn:focus {
    outline: none !important;
    border: 1px solid #e9ecef !important;
}

.finalize-load-btn:active {
    border: 1px solid #e9ecef !important;
}

.finalize-load-btn i {
    color: #28a745 !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .po-modal {
        padding: 10px;
    }
    
    .po-modal-content {
        max-height: 95vh;
    }
    
    .po-modal-header {
        padding: 16px 16px 0 16px;
    }
    
    .po-form {
        padding: 0 16px 16px 16px;
    }
    
    .po-form-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .po-form-group-half,
    .po-form-group-quarter {
        flex: 1;
    }
    
    .po-form-actions {
        flex-direction: column;
    }
    
    .po-btn {
        width: 100%;
    }
}

/* Form validation styles */
.po-form-group input:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.po-form-group input:valid:not(:placeholder-shown) {
    border-color: #27ae60;
}

.po-form-group select:valid:not([value=""]) {
    border-color: #27ae60;
}

/* Loading spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

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