/**
 * Employee Form Styles - sj-add-emp.css
 * Modern Blue & Orange Theme with Inline Flex Layout
 */

/* Container หลัก */
.sj-emp-form-container-sj42 {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

/* ฟอร์มหลัก */
.sj-emp-form-sj42 {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 15px;
    padding: 25px;
    background: linear-gradient(135deg, #f8fafe 0%, #e3f2fd 100%);
    border: 2px solid #1565c0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(21, 101, 192, 0.1);
    transition: all 0.3s ease;
}

.sj-emp-form-sj42:hover {
    box-shadow: 0 6px 25px rgba(21, 101, 192, 0.15);
}

/* Field containers */
.sj-emp-field-sj42 {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    flex: 1;
}

.sj-emp-field-sj42 label {
    font-size: 14px;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 5px;
    white-space: nowrap;
}

/* Input และ Select styles */
.sj-emp-field-sj42 input,
.sj-emp-field-sj42 select {
    padding: 10px 12px;
    border: 2px solid #bbdefb;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    color: #333;
    transition: all 0.3s ease;
    min-height: 20px;
}

.sj-emp-field-sj42 input:focus,
.sj-emp-field-sj42 select:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
    transform: translateY(-1px);
}

.sj-emp-field-sj42 input:hover,
.sj-emp-field-sj42 select:hover {
    border-color: #1976d2;
}

/* Error state */
.sj-emp-field-sj42 input.sj-emp-error-sj42,
.sj-emp-field-sj42 select.sj-emp-error-sj42 {
    border-color: #e53935;
    background-color: #ffebee;
    animation: shake-sj42 0.5s ease-in-out;
}

@keyframes shake-sj42 {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Date selector container */
.sj-emp-date-sj42 {
    display: flex;
    gap: 8px;
}

.sj-emp-date-sj42 select {
    flex: 1;
    min-width: 60px;
}

/* Submit button */
.sj-emp-submit-sj42 {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 44px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sj-emp-submit-sj42:hover:not(:disabled) {
    background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 124, 0, 0.3);
}

.sj-emp-submit-sj42:active:not(:disabled) {
    transform: translateY(0);
}

.sj-emp-submit-sj42:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading spinner */
.sj-emp-loading-sj42 {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Animation class for spinner */
.sj-emp-loading-sj42.sj-spinning-sj42 {
    animation: spin-sj42 1s linear infinite;
}

/* Button loading state (ไม่มี animation) */
.sj-emp-submit-sj42.sj-btn-loading-state-sj42 {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
}

@keyframes spin-sj42 {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Message styles */
.sj-emp-message-sj42 {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn-sj42 0.3s ease-out;
}

.sj-emp-success-sj42 {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
    border: 2px solid #4caf50;
}

.sj-emp-error-sj42 {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border: 2px solid #f44336;
}

@keyframes slideIn-sj42 {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sj-emp-form-sj42 {
        flex-direction: column;
        gap: 20px;
        padding: 20px 15px;
    }
    
    .sj-emp-field-sj42 {
        min-width: 100%;
    }
    
    .sj-emp-date-sj42 {
        flex-direction: row;
    }
    
    .sj-emp-date-sj42 select {
        min-width: 80px;
    }
    
    .sj-emp-submit-sj42 {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .sj-emp-form-container-sj42 {
        margin: 10px 0;
    }
    
    .sj-emp-form-sj42 {
        padding: 15px 10px;
        gap: 15px;
    }
    
    .sj-emp-field-sj42 label {
        font-size: 13px;
    }
    
    .sj-emp-field-sj42 input,
    .sj-emp-field-sj42 select {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .sj-emp-submit-sj42 {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .sj-emp-form-sj42,
    .sj-emp-field-sj42 input,
    .sj-emp-field-sj42 select,
    .sj-emp-submit-sj42,
    .sj-emp-message-sj42 {
        transition: none;
        animation: none;
    }
}

/* Focus visible for keyboard navigation */
.sj-emp-field-sj42 input:focus-visible,
.sj-emp-field-sj42 select:focus-visible,
.sj-emp-submit-sj42:focus-visible {
    outline: 2px solid #ff9800;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sj-emp-form-sj42 {
        border-width: 3px;
    }
    
    .sj-emp-field-sj42 input,
    .sj-emp-field-sj42 select {
        border-width: 2px;
    }
}

/* Edit Mode Styles */
.sj-emp-form-sj42.sj-edit-mode-sj42 {
    border-color: #ff9800;
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    box-shadow: 0 4px 25px rgba(255, 152, 0, 0.15);
}

.sj-emp-form-sj42.sj-edit-mode-sj42::before {
    content: "โหมดแก้ไขข้อมูล";
    position: absolute;
    top: -15px;
    left: 20px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.sj-emp-form-sj42 {
    position: relative;
}

/* Update Button Styles */
.sj-emp-submit-sj42.sj-update-mode-sj42 {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}

.sj-emp-submit-sj42.sj-update-mode-sj42:hover:not(:disabled) {
    background: linear-gradient(135deg, #388e3c 0%, #2e7d32 100%);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

/* Cancel Button */
.sj-emp-cancel-sj42 {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
    min-width: 80px;
    height: 44px;
}

.sj-emp-cancel-sj42:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

/* Info Message */
.sj-emp-info-sj42 {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    border: 2px solid #2196f3;
}

/* Mobile adjustments for edit mode */
@media (max-width: 768px) {
    .sj-emp-form-sj42.sj-edit-mode-sj42::before {
        top: -12px;
        left: 15px;
        font-size: 11px;
        padding: 4px 12px;
    }
    
    .sj-emp-cancel-sj42 {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
}