/**
 * TourSure Promotion - Add/Edit Form Styles
 */

/* Container */
.tspro-add-container-pm01 {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--tspro-space-6);
    font-family: var(--tspro-font);
    position: relative;
}

.tspro-form-header-pm01 h2 {
    font-size: var(--tspro-font-size-2xl);
    font-weight: 700;
    color: var(--tspro-gray-900);
    margin: 0 0 var(--tspro-space-6);
}

.tspro-notice-pm01 {
    padding: var(--tspro-space-4);
    background: var(--tspro-gray-50);
    border-radius: var(--tspro-radius);
    color: var(--tspro-gray-600);
    text-align: center;
}

/* Sections */
.tspro-form-section-pm01 {
    background: var(--tspro-white);
    border: 1px solid var(--tspro-gray-200);
    border-radius: var(--tspro-radius);
    padding: var(--tspro-space-6);
    margin-bottom: var(--tspro-space-6);
}

.tspro-section-title-pm01 {
    font-size: var(--tspro-font-size-lg);
    font-weight: 600;
    color: var(--tspro-gray-800);
    margin: 0 0 var(--tspro-space-5);
    padding-bottom: var(--tspro-space-3);
    border-bottom: 1px solid var(--tspro-gray-100);
}

/* Fields */
.tspro-field-pm01 {
    margin-bottom: var(--tspro-space-4);
}

.tspro-field-pm01 label {
    display: block;
    font-size: var(--tspro-font-size-sm);
    font-weight: 500;
    color: var(--tspro-gray-700);
    margin-bottom: var(--tspro-space-1);
}

.tspro-field-pm01 label .required {
    color: var(--tspro-danger);
}

.tspro-field-hint-pm01 {
    font-size: var(--tspro-font-size-xs);
    color: var(--tspro-gray-400);
    margin: 0 0 var(--tspro-space-2);
}

.tspro-field-pm01 input[type="text"],
.tspro-field-pm01 input[type="url"],
.tspro-field-pm01 input[type="number"],
.tspro-field-pm01 input[type="date"],
.tspro-field-pm01 select,
.tspro-field-pm01 textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--tspro-gray-300);
    border-radius: var(--tspro-radius-sm);
    font-size: var(--tspro-font-size-base);
    font-family: var(--tspro-font);
    color: var(--tspro-gray-800);
    background: var(--tspro-white);
    transition: border-color var(--tspro-transition-fast), box-shadow var(--tspro-transition-fast);
    box-sizing: border-box;
}

.tspro-field-pm01 input:focus,
.tspro-field-pm01 select:focus,
.tspro-field-pm01 textarea:focus {
    outline: none;
    border-color: var(--tspro-primary);
    box-shadow: 0 0 0 3px var(--tspro-primary-bg);
}

.tspro-field-pm01 input[type="color"] {
    width: 50px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--tspro-gray-300);
    border-radius: var(--tspro-radius-sm);
    cursor: pointer;
}

/* Field Rows */
.tspro-field-row-pm01 {
    display: flex;
    gap: var(--tspro-space-4);
    flex-wrap: wrap;
}

.tspro-field-half-pm01 { flex: 1 1 calc(50% - var(--tspro-space-4)); min-width: 250px; }
.tspro-field-third-pm01 { flex: 1 1 calc(33.33% - var(--tspro-space-4)); min-width: 200px; }
.tspro-field-quarter-pm01 { flex: 1 1 calc(25% - var(--tspro-space-4)); min-width: 150px; }

/* Toggle Switch */
.tspro-toggle-pm01 {
    display: flex;
    align-items: center;
    gap: var(--tspro-space-2);
    cursor: pointer;
}

.tspro-toggle-pm01 input { display: none; }

.tspro-toggle-slider-pm01 {
    width: 44px;
    height: 24px;
    background: var(--tspro-gray-300);
    border-radius: var(--tspro-radius-full);
    position: relative;
    transition: background var(--tspro-transition-fast);
    flex-shrink: 0;
}

.tspro-toggle-slider-pm01::after {
    content: '';
    width: 20px;
    height: 20px;
    background: var(--tspro-white);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--tspro-transition-fast);
    box-shadow: var(--tspro-shadow-sm);
}

.tspro-toggle-pm01 input:checked + .tspro-toggle-slider-pm01 {
    background: var(--tspro-primary);
}

.tspro-toggle-pm01 input:checked + .tspro-toggle-slider-pm01::after {
    transform: translateX(20px);
}

.tspro-toggle-label-pm01 {
    font-size: var(--tspro-font-size-sm);
    color: var(--tspro-gray-600);
}

/* Image Upload */
.tspro-image-upload-pm01 {
    cursor: pointer;
}

.tspro-image-preview-pm01 {
    width: 100%;
    aspect-ratio: auto;
    min-height: 150px;
    border: 2px dashed var(--tspro-gray-300);
    border-radius: var(--tspro-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color var(--tspro-transition-fast);
    background: var(--tspro-gray-50);
}

.tspro-image-preview-pm01:hover {
    border-color: var(--tspro-primary);
}

.tspro-image-preview-pm01 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tspro-upload-placeholder-pm01 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--tspro-space-2);
    color: var(--tspro-gray-400);
    font-size: var(--tspro-font-size-sm);
}

.tspro-btn-remove-image-pm01 {
    display: block;
    margin-top: var(--tspro-space-2);
    padding: 4px 12px;
    background: none;
    border: 1px solid var(--tspro-danger);
    color: var(--tspro-danger);
    border-radius: var(--tspro-radius-sm);
    font-size: var(--tspro-font-size-xs);
    cursor: pointer;
    transition: all var(--tspro-transition-fast);
}

.tspro-btn-remove-image-pm01:hover {
    background: var(--tspro-danger);
    color: var(--tspro-white);
}

/* Cross-Plugin Tagging */
.tspro-tag-section-pm01 {}

.tspro-tag-tabs-pm01 {
    display: flex;
    gap: var(--tspro-space-2);
    margin-bottom: var(--tspro-space-4);
    border-bottom: 2px solid var(--tspro-gray-100);
    padding-bottom: var(--tspro-space-2);
}

.tspro-tag-tab-pm01 {
    padding: 8px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--tspro-gray-500);
    font-size: var(--tspro-font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--tspro-transition-fast);
    margin-bottom: -4px;
}

.tspro-tag-tab-pm01:hover {
    color: var(--tspro-gray-700);
}

.tspro-tag-tab-pm01.active {
    color: var(--tspro-primary);
    border-bottom-color: var(--tspro-primary);
}

.tspro-tag-search-wrapper-pm01 {
    position: relative;
    margin-bottom: var(--tspro-space-4);
}

.tspro-tag-search-pm01 {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--tspro-gray-300);
    border-radius: var(--tspro-radius-sm);
    font-size: var(--tspro-font-size-base);
    box-sizing: border-box;
}

.tspro-tag-search-pm01:focus {
    outline: none;
    border-color: var(--tspro-primary);
    box-shadow: 0 0 0 3px var(--tspro-primary-bg);
}

.tspro-tag-search-icon-pm01 {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tspro-gray-400);
}

.tspro-tag-results-pm01 {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--tspro-gray-200);
    border-radius: var(--tspro-radius-sm);
    margin-bottom: var(--tspro-space-4);
}

.tspro-tag-hint-pm01,
.tspro-tag-loading-pm01 {
    padding: var(--tspro-space-4);
    text-align: center;
    color: var(--tspro-gray-400);
    font-size: var(--tspro-font-size-sm);
    margin: 0;
}

.tspro-tag-item-pm01 {
    display: flex;
    align-items: center;
    gap: var(--tspro-space-3);
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--tspro-transition-fast);
    border-bottom: 1px solid var(--tspro-gray-100);
}

.tspro-tag-item-pm01:last-child { border-bottom: none; }

.tspro-tag-item-pm01:hover { background: var(--tspro-gray-50); }

.tspro-tag-item-pm01.selected {
    background: var(--tspro-primary-bg);
}

.tspro-tag-item-thumb-pm01 {
    width: 40px;
    height: 40px;
    border-radius: var(--tspro-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--tspro-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tspro-tag-item-thumb-pm01 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tspro-tag-item-icon-pm01 {
    font-size: 20px;
}

.tspro-tag-item-info-pm01 {
    flex: 1;
    min-width: 0;
}

.tspro-tag-item-info-pm01 strong {
    display: block;
    font-size: var(--tspro-font-size-sm);
    color: var(--tspro-gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tspro-tag-item-info-pm01 small {
    color: var(--tspro-gray-500);
    font-size: var(--tspro-font-size-xs);
}

.tspro-tag-item-check-pm01 {
    color: var(--tspro-gray-300);
    flex-shrink: 0;
}

.tspro-tag-item-pm01.selected .tspro-tag-item-check-pm01 {
    color: var(--tspro-primary);
}

/* Selected Pills */
.tspro-tag-selected-pm01 {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: var(--tspro-gray-50);
    border-radius: var(--tspro-radius-sm);
    min-height: 20px;
}

.tspro-tag-selected-pm01:empty {
    display: none;
}

.tspro-tag-pill-pm01 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--tspro-white);
    color: var(--tspro-gray-800);
    border: 1px solid var(--tspro-gray-200);
    border-radius: var(--tspro-radius-full);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 320px;
    line-height: 1.3;
    transition: all var(--tspro-transition-fast);
}

.tspro-tag-pill-pm01:hover {
    border-color: var(--tspro-primary);
    background: var(--tspro-primary-bg);
}

/* Force WordPress Twemoji <img> inside pills to be small inline */
.tspro-tag-pill-pm01 img.emoji,
.tspro-tag-pill-pm01 img.wp-smiley,
.tspro-tag-pill-pm01 img[src*="twemoji"],
.tspro-tag-pill-pm01 img {
    width: 16px !important;
    height: 16px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    max-width: 16px !important;
}

.tspro-tag-pill-icon-pm01 {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tspro-tag-pill-text-pm01 {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 230px;
}

.tspro-tag-pill-type-pm01 {
    font-size: 11px;
    color: var(--tspro-gray-400);
    font-weight: 400;
}

.tspro-tag-pill-remove-pm01 {
    background: none;
    border: none;
    color: var(--tspro-gray-400);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
    line-height: 1;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--tspro-transition-fast);
}

.tspro-tag-pill-remove-pm01:hover {
    background: var(--tspro-danger);
    color: var(--tspro-white);
}

/* Also constrain emoji in search results */
.tspro-tag-item-icon-pm01 img.emoji,
.tspro-tag-item-icon-pm01 img.wp-smiley,
.tspro-tag-item-icon-pm01 img[src*="twemoji"],
.tspro-tag-item-icon-pm01 img {
    width: 20px !important;
    height: 20px !important;
}

/* Constrain emoji in tab buttons too */
.tspro-tag-tab-pm01 img.emoji,
.tspro-tag-tab-pm01 img.wp-smiley,
.tspro-tag-tab-pm01 img {
    width: 16px !important;
    height: 16px !important;
    vertical-align: middle !important;
    margin: 0 2px 0 0 !important;
}

/* Form Actions */
.tspro-form-actions-pm01 {
    display: flex;
    justify-content: flex-end;
    gap: var(--tspro-space-3);
    padding-top: var(--tspro-space-4);
}

.tspro-btn-primary-pm01,
.tspro-btn-secondary-pm01 {
    padding: 12px 28px;
    border: none;
    border-radius: var(--tspro-radius-sm);
    font-size: var(--tspro-font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--tspro-transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.tspro-btn-primary-pm01:hover {
    background: var(--tspro-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--tspro-shadow);
}

.tspro-btn-primary-pm01:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tspro-btn-secondary-pm01 {
    background: var(--tspro-white);
    color: var(--tspro-gray-700);
    border: 1px solid var(--tspro-gray-300);
}

.tspro-btn-secondary-pm01:hover {
    background: var(--tspro-gray-50);
    border-color: var(--tspro-gray-400);
}

/* Loading Overlay */
.tspro-loading-overlay-pm01 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--tspro-z-overlay);
    border-radius: var(--tspro-radius);
}

.tspro-spinner-pm01 {
    width: 40px;
    height: 40px;
    border: 3px solid var(--tspro-gray-200);
    border-top-color: var(--tspro-primary);
    border-radius: 50%;
    animation: tspro-spin 0.8s linear infinite;
}

@keyframes tspro-spin {
    to { transform: rotate(360deg); }
}

/* Success Message */
.tspro-success-msg-pm01 {
    text-align: center;
    padding: var(--tspro-space-8) var(--tspro-space-4);
}

.tspro-success-msg-pm01 h3 {
    font-size: var(--tspro-font-size-xl);
    color: var(--tspro-gray-800);
    margin: var(--tspro-space-4) 0;
}

.tspro-success-actions-pm01 {
    display: flex;
    justify-content: center;
    gap: var(--tspro-space-3);
    margin-top: var(--tspro-space-5);
}

/* Responsive */
@media (max-width: 768px) {
    .tspro-add-container-pm01 { padding: var(--tspro-space-4); }
    .tspro-field-half-pm01,
    .tspro-field-third-pm01,
    .tspro-field-quarter-pm01 { flex: 1 1 100%; min-width: 0; }
    .tspro-form-actions-pm01 { flex-direction: column; }
    .tspro-btn-primary-pm01,
    .tspro-btn-secondary-pm01 { width: 100%; }
    .tspro-tag-tabs-pm01 { overflow-x: auto; }
}
