/**
 * Tour Conditions Manager Styles
 * Version: 1.0
 * File: toursure-edit-program-004.css
 */

 
/* ========================================
   Container & Wrapper
   ======================================== */
.conditions-manager-wrapper-qrt456 {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
}

.conditions-error-qrt456 {
    background: #fee;
    border: 1px solid #fcc;
    color: #c00;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
}

/* ========================================
   Header Section
   ======================================== */
.conditions-header-qrt456 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.conditions-title-qrt456 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-mode-badge-qrt456 {
    background: #4CAF50;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: normal;
}

.conditions-actions-qrt456 {
    display: flex;
    gap: 10px;
}

.btn-save-all-qrt456 {
    background: #0073aa !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 4px !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

.btn-save-all-qrt456:hover {
    background: #005a87 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

/* ========================================
   Tabs Layout
   ======================================== */
.conditions-tabs-container-qrt456 {
    margin-top: 20px;
}

.conditions-tabs-nav-qrt456 {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
    gap: 10px;
}

.tab-nav-item-qrt456 {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -2px;
}

.tab-nav-item-qrt456:hover {
    color: #0073aa;
    background: #f5f5f5;
}

.tab-nav-item-qrt456.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    background: white;
}

.tab-nav-item-qrt456 .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.tab-pane-qrt456 {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane-qrt456.active {
    display: block;
}

/* ========================================
   Accordion Layout
   ======================================== */
.conditions-accordion-container-qrt456 {
    margin-top: 20px;
}

.accordion-item-qrt456 {
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-item-qrt456:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.accordion-item-qrt456.active {
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
    border-color: #0073aa;
}

.accordion-header-qrt456 {
    padding: 15px 20px;
    background: #f9f9f9;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    user-select: none;
}

.accordion-header-qrt456:hover {
    background: #f0f0f0;
}

.accordion-item-qrt456.active .accordion-header-qrt456 {
    background: #f0f7ff;
}

.accordion-icon-qrt456 {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.accordion-item-qrt456.active .accordion-icon-qrt456 .dashicons {
    transform: rotate(180deg);
}

.accordion-header-qrt456 h3 {
    margin: 0;
    flex: 1;
    font-size: 16px;
    color: #333;
}

.content-indicator-qrt456 {
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accordion-content-qrt456 {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
}

/* ========================================
   Sections Layout
   ======================================== */
.conditions-sections-container-qrt456 {
    margin-top: 20px;
}

.condition-section-group-qrt456 {
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.section-group-title-qrt456 {
    background: #f5f5f5;
    padding: 15px 20px;
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.section-group-title-qrt456:hover {
    background: #eeeeee;
}

.section-group-title-qrt456 .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #0073aa;
}

.section-group-content-qrt456 {
    padding: 20px;
    background: white;
}

.condition-columns-qrt456 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.condition-column-qrt456 {
    min-width: 0;
}

/* ========================================
   Field Wrapper
   ======================================== */
.condition-field-wrapper-qrt456 {
    margin-bottom: 25px;
    padding: 20px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.condition-field-wrapper-qrt456:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.condition-field-wrapper-qrt456.has-unsaved-changes {
    border-color: #FF9800;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.1);
}

.field-header-qrt456 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.field-label-qrt456 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.field-instruction-qrt456 {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-left: 10px;
}

.btn-edit-field-qrt456 {
    background: white;
    border: 1px solid #0073aa;
    color: #0073aa;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-edit-field-qrt456:hover {
    background: #0073aa;
    color: white;
}

/* ========================================
   Field Content
   ======================================== */
.field-content-qrt456 {
    position: relative;
}

/* Display Mode */
.field-display-qrt456 {
    min-height: 50px;
}

.field-value-qrt456 {
    padding: 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    line-height: 1.6;
    color: #333;
}

.field-value-qrt456 ul,
.field-value-qrt456 ol {
    margin: 10px 0;
    padding-left: 30px;
}

.field-value-qrt456 li {
    margin-bottom: 5px;
}

.field-value-qrt456 p {
    margin: 0 0 10px 0;
}

.field-value-qrt456 p:last-child {
    margin-bottom: 0;
}

.field-value-qrt456 img {
    max-width: 1200px;
    height: auto;
    display: block;
    margin: 15px 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.field-value-qrt456 img.alignleft {
    float: left;
    margin: 5px 20px 15px 0;
}

.field-value-qrt456 img.alignright {
    float: right;
    margin: 5px 0 15px 20px;
}

.field-value-qrt456 img.aligncenter {
    margin-left: auto;
    margin-right: auto;
}

.field-empty-qrt456 {
    padding: 20px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 4px;
    text-align: center;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.field-empty-qrt456 .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Edit Mode */
.field-edit-qrt456 {
    animation: slideDown 0.3s ease;
}

.field-editor-qrt456 {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

.field-actions-qrt456 {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.field-actions-qrt456 .button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-save-field-qrt456 {
    background: #4CAF50 !important;
    border-color: #4CAF50 !important;
    color: white !important;
}

.btn-save-field-qrt456:hover {
    background: #45a049 !important;
}

.btn-cancel-field-qrt456 {
    background: #f44336 !important;
    border-color: #f44336 !important;
    color: white !important;
}

.btn-cancel-field-qrt456:hover {
    background: #da190b !important;
}

.btn-preview-field-qrt456 {
    background: #2196F3 !important;
    border-color: #2196F3 !important;
    color: white !important;
}

.btn-preview-field-qrt456:hover {
    background: #0b7dda !important;
}

.btn-add-media-qrt456 {
    background: #FF9800 !important;
    border-color: #FF9800 !important;
    color: white !important;
}

.btn-add-media-qrt456:hover {
    background: #e68900 !important;
}

.btn-add-media-qrt456 .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Preview Mode */
.field-preview-qrt456 {
    animation: fadeIn 0.3s ease;
}

.preview-content-qrt456 {
    padding: 20px;
    background: white;
    border: 2px solid #2196F3;
    border-radius: 4px;
    margin-bottom: 15px;
    position: relative;
}

.preview-content-qrt456::before {
    content: 'ตัวอย่าง';
    position: absolute;
    top: -10px;
    left: 20px;
    background: #2196F3;
    color: white;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 11px;
}

.preview-actions-qrt456 {
    display: flex;
    justify-content: flex-end;
}

.btn-back-edit-qrt456 {
    background: #666 !important;
    border-color: #666 !important;
    color: white !important;
}

.btn-back-edit-qrt456:hover {
    background: #555 !important;
}

/* ========================================
   WordPress Editor Overrides
   ======================================== */
.wp-editor-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.wp-editor-area {
    border: none !important;
}

.mce-toolbar {
    background: #f5f5f5 !important;
}

.mce-statusbar {
    border-top: 1px solid #ddd !important;
}

/* ========================================
   Loading Overlay
   ======================================== */
.loading-overlay-qrt456 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-qrt456 {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container-qrt456 {
    position: fixed;
    top: 32px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.admin-bar .toast-container-qrt456 {
    top: 52px;
}

.toast-qrt456 {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 400px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    pointer-events: all;
}

.toast-qrt456.show {
    transform: translateX(0);
}

.toast-icon-qrt456 {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-qrt456.toast-success {
    border-left: 4px solid #4CAF50;
}

.toast-qrt456.toast-success .toast-icon-qrt456 {
    background: #4CAF50;
    color: white;
}

.toast-qrt456.toast-error {
    border-left: 4px solid #f44336;
}

.toast-qrt456.toast-error .toast-icon-qrt456 {
    background: #f44336;
    color: white;
}

.toast-qrt456.toast-info {
    border-left: 4px solid #2196F3;
}

.toast-qrt456.toast-info .toast-icon-qrt456 {
    background: #2196F3;
    color: white;
}

.toast-qrt456.toast-warning {
    border-left: 4px solid #FF9800;
}

.toast-qrt456.toast-warning .toast-icon-qrt456 {
    background: #FF9800;
    color: white;
}

.toast-message-qrt456 {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.toast-close-qrt456 {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    transition: color 0.3s ease;
}

.toast-close-qrt456:hover {
    color: #333;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .condition-columns-qrt456 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .conditions-header-qrt456 {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .conditions-tabs-nav-qrt456 {
        flex-wrap: wrap;
    }
    
    .tab-nav-item-qrt456 {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
    
    .field-header-qrt456 {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .field-instruction-qrt456 {
        margin-left: 0;
        display: block;
    }
    
    .btn-edit-field-qrt456 {
        align-self: flex-end;
    }
    
    .field-actions-qrt456 {
        flex-wrap: wrap;
    }
    
    .field-actions-qrt456 .button {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }
    
    .toast-container-qrt456 {
        left: 10px;
        right: 10px;
    }
    
    .toast-qrt456 {
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .conditions-manager-wrapper-qrt456 {
        padding: 15px;
    }
    
    .conditions-title-qrt456 {
        font-size: 20px;
    }
    
    .tab-nav-item-qrt456 {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .condition-field-wrapper-qrt456 {
        padding: 15px;
    }
    
    .field-label-qrt456 {
        font-size: 14px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .conditions-actions-qrt456,
    .btn-edit-field-qrt456,
    .field-edit-qrt456,
    .field-preview-qrt456,
    .toast-container-qrt456,
    .loading-overlay-qrt456,
    .edit-mode-badge-qrt456 {
        display: none !important;
    }
    
    .condition-field-wrapper-qrt456 {
        page-break-inside: avoid;
        border: 1px solid #000;
    }
    
    .field-value-qrt456 {
        border: 1px solid #000;
    }
}

/* ========================================
   Accessibility
   ======================================== */
.conditions-manager-wrapper-qrt456:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.btn-edit-field-qrt456:focus,
.btn-save-field-qrt456:focus,
.btn-cancel-field-qrt456:focus,
.btn-preview-field-qrt456:focus,
.tab-nav-item-qrt456:focus,
.accordion-header-qrt456:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .condition-field-wrapper-qrt456,
    .accordion-item-qrt456 {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .toast-qrt456,
    .tab-pane-qrt456,
    .field-edit-qrt456,
    .accordion-content-qrt456,
    button {
        transition: none;
        animation: none;
    }
}

/* Visual indicator for unsaved changes */
body.has-unsaved-tour-changes::before {
    content: 'มีการเปลี่ยนแปลงที่ยังไม่บันทึก';
    position: fixed;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: #FF9800;
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 9999;
    pointer-events: none;
    animation: pulse 2s ease-in-out infinite;
}

.admin-bar body.has-unsaved-tour-changes::before {
    top: 52px;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}