:root {
    --k-primary: #138D3E;         /* สีเขียวกสิกร */
    --k-primary-dark: #0D6B2E;    /* สีเขียวเข้ม */
    --k-primary-light: #E7F4EA;   /* สีเขียวอ่อน */
    --k-secondary: #59B963;       /* สีเขียวรอง */
    --k-gray: #666666;           /* สีเทาข้อความ */
    --k-gray-light: #F5F5F5;     /* สีเทาพื้นหลัง */
    --k-error: #D63031;          /* สีแดง error */
    --k-success: #138D3E;        /* สีเขียวสำเร็จ */
}

/* Main container */
.so-search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'DB Helvethaica X', Helvetica, Arial, sans-serif;
    background-color: #ffffff;
}

/* URL input section */
.url-display {
    margin-bottom: 2rem;
    background-color: var(--k-gray-light);
    padding: 1.5rem;
    border-radius: 12px;
}

.url-display label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--k-gray);
    font-size: 1.1rem;
}

.url-input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.url-input-group input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 2px solid #E5E5E5;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.url-input-group input:focus {
    outline: none;
    border-color: var(--k-primary);
    box-shadow: 0 0 0 4px rgba(19, 141, 62, 0.1);
}

.url-buttons button {
    padding: 1rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.url-buttons button:disabled {
    opacity: 0.6;
    background-color: #cccccc;
}

.btn-secondary {
    background-color: white;
    color: var(--k-primary);
    border: 2px solid var(--k-primary) !important;
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--k-primary-light);
}

.btn-primary {
    background-color: var(--k-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--k-primary-dark);
}

/* Search input */
#so-search-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #E5E5E5;
    border-radius: 8px;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

#so-search-input:focus {
    outline: none;
    border-color: var(--k-primary);
    box-shadow: 0 0 0 4px rgba(19, 141, 62, 0.1);
}

/* Result card */
.so-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Document info section */
.document-info {
    padding: 2rem;
    border-bottom: 1px solid #E5E5E5;
    background-color: var(--k-gray-light);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--k-primary);
    margin-bottom: 1.5rem;
}

.info-row {
    display: flex;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: white;
    border-radius: 8px;
}

.info-label {
    width: 140px;
    color: var(--k-gray);
    font-weight: 500;
}

.info-value {
    color: #333;
    font-weight: 500;
}

/* Staff info section */
.staff-info {
    padding: 2rem;
    background-color: white;
}

/* Employee grid */
.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.employee-item {
    position: relative;
    padding: 1.5rem;
    border: 2px solid #E5E5E5;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.employee-item:hover .employee-image-container {
    border-color: var(--k-primary);
}

.employee-item.selected .employee-image-container {
    border-color: var(--k-primary);
    border-width: 3px;
}

.employee-item:hover {
    border-color: var(--k-primary);
    transform: translateY(-2px);
}

.employee-item.selected {
    border-color: var(--k-primary);
    background-color: var(--k-primary-light);
}

.employee-item.selected .checkbox {
    border-color: var(--k-primary);
    background-color: var(--k-primary);
}

.employee-item.selected .checkbox::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
}

.checkbox {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 20px;
    height: 20px;
    border: 2px solid #E5E5E5;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.employee-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0.75rem 0 0.25rem;
}

.employee-position {
    font-size: 0.95rem;
    color: var(--k-gray);
}


/* Employee image styling */
.employee-image-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
    background-color: #E5E5E5;
    border: 2px solid var(--k-primary-light);
    position: relative;
}

.employee-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
}


/* Fallback for missing images */
.employee-image-container img[src=""],
.employee-image-container img:not([src]) {
    opacity: 0;
}

.employee-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #E5E5E5;
    background-image: url('/wp-content/themes/your-theme/images/placeholder-user.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

/* Update button */
.update-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    background-color: var(--k-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.update-btn:hover:not(:disabled) {
    background-color: var(--k-primary-dark);
}

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

/* Toast notifications */
.toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1000;
    min-width: 300px;
}

.toast-success {
    border-left: 4px solid var(--k-success);
}

.toast-error {
    border-left: 4px solid var(--k-error);
}

.toast i {
    font-size: 1.25rem;
}

.toast-success i {
    color: var(--k-success);
}

.toast-error i {
    color: var(--k-error);
}

/* Loading spinner */
.search-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--k-primary-light);
    border-top: 3px solid var(--k-primary);
    border-radius: 50%;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    animation: spin 1s linear infinite;
}

/* Search error */
.search-error {
    color: var(--k-error);
    background-color: #FFE9E9;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Helper text */
.form-text {
    font-size: 0.95rem;
    color: var(--k-gray);
    margin-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .url-input-group {
        flex-direction: column;
    }
    
    .url-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .info-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .info-label {
        width: 100%;
    }

    .employee-grid {
        grid-template-columns: 1fr;
    }
}