/* Form Styles */
.egp-form-container {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid #e5e7eb;
}

.egp-form-title {
    margin: 0 0 25px 0;
    font-size: 1.5rem;
    color: #1a237e;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.egp-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #00a4e4;
    box-shadow: 0 0 0 3px rgba(0, 164, 228, 0.1);
}

.form-group input[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.required {
    color: #dc3545;
    margin-left: 4px;
}

/* Form Action Buttons */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.egp-submit-button,
.egp-reset-button {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.egp-submit-button {
    background: #00a4e4;
    color: white;
    border: none;
}

.egp-submit-button:hover {
    background: #0082b6;
}

.egp-reset-button {
    background: #fff;
    color: #666;
    border: 1px solid #e0e0e0;
}

.egp-reset-button:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

/* Error States */
.error {
    border-color: #dc3545 !important;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 4px;
}

.egp-no-permission {
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #c62828;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Toast Notification Styles */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    min-width: 300px;
    max-width: 400px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.toast-notification.success {
    border-left: 4px solid #2ecc71;
}

.toast-notification.error {
    border-left: 4px solid #e74c3c;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
}

.toast-icon {
    flex-shrink: 0;
    margin-right: 12px;
    width: 24px;
    height: 24px;
}

.toast-icon.success {
    color: #2ecc71;
}

.toast-icon.error {
    color: #e74c3c;
}

.toast-message {
    flex-grow: 1;
    padding-right: 20px;
}

.toast-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 4px;
}

.toast-text {
    font-size: 0.875rem;
    color: #666666;
    line-height: 1.5;
}

.toast-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #999999;
    cursor: pointer;
    padding: 4px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333333;
}

.toast-actions {
    padding: 12px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 12px 12px;
}

.toast-link {
    display: inline-block;
    color: #00a4e4;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.toast-link:hover {
    color: #0082b6;
    text-decoration: underline;
}

/* Toast Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-notification.show {
    display: block;
}

.toast-notification.hide {
    animation: slideOut 0.3s ease-out forwards;
}

/* Debug message styles */
.egp-error-message {
    background-color: #fff3f3;
    color: #d32f2f;
    padding: 12px 16px;
    border-left: 4px solid #d32f2f;
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 14px;
    border-radius: 4px;
}

/* Loading indicator */
.egp-loading {
    text-align: center;
    padding: 30px;
    border: 1px dashed #e0e0e0;
    border-radius: 8px;
    color: #666;
    background-color: #f9f9f9;
    position: relative;
    min-height: 100px;
}

.egp-loading:before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #2196f3;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success message */
.egp-success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 12px 16px;
    border-left: 4px solid #2e7d32;
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 14px;
    border-radius: 4px;
}

/* Disable text selection for the form during submission */
.form-submitting {
    opacity: 0.8;
    pointer-events: none;
    position: relative;
}

.form-submitting:after {
    content: 'กำลังบันทึกข้อมูล...';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    z-index: 10;
}

/* Modern Pagination Styles */
.egp-pagination {
    margin-top: 2rem;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.egp-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0;
    margin: 0 2px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: #333333;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.egp-pagination .page-numbers.current {
    background-color: #2196f3;
    border-color: #2196f3;
    color: #ffffff;
    font-weight: 600;
}

.egp-pagination .page-numbers:hover:not(.current) {
    background-color: #f5f5f5;
    border-color: #2196f3;
    color: #2196f3;
}

.egp-pagination .prev,
.egp-pagination .next {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    color: #666666;
}

.egp-pagination .prev:hover,
.egp-pagination .next:hover {
    background-color: #f5f5f5;
    border-color: #2196f3;
    color: #2196f3;
}

.egp-pagination .dots {
    border: none;
    background: none;
    pointer-events: none;
    color: #666666;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .egp-pagination .page-numbers {
        min-width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .egp-pagination .dots {
        min-width: 20px;
    }

    .egp-form-container {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .egp-submit-button,
    .egp-reset-button {
        width: 100%;
    }
    
    .toast-notification {
        bottom: 20px;
        right: 20px;
        left: 20px;
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .egp-pagination .page-numbers {
        min-width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    
    .egp-pagination {
        gap: 0.25rem;
    }
}


/* ส่วนที่เพิ่มเติมใน css/egp_carditem.css */

.egp-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 5px;
    background-color: #ffecb3;
    color: #ff8f00;
    border: 1px solid #ffe082;
}

/* เพิ่มสีพื้นหลังต่างกันสำหรับ card ที่เป็น option vs post */
.egp-card-link:not([href^="http"]) .egp-card {
    background-color: #fff8e1;
    border-left: 3px solid #ffc107;
}

.egp-card-link:not([href^="http"]) .egp-card-main {
    background-color: #fffde7;
}

/* เพิ่มไอคอนหรือตัวชี้ว่าสามารถคลิกเพื่อเผยแพร่ได้ */
.egp-card-link:not([href^="http"]) .egp-card:after {
    content: "คลิกเพื่อเผยแพร่";
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ff9800;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.egp-card-link:not([href^="http"]) .egp-card:hover:after {
    opacity: 1;
}

/* เพิ่ม position relative เพื่อให้ absolute positioning ทำงานได้ */
.egp-card {
    position: relative;
}