/* Review Modal Styles */
.ss-review-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100000;
  display: none;
}

.ss-review-modal {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 100001;
  width: 320px;
  padding: 20px;
  border: 1px solid #e1e5e9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: none;
}

.ss-review-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ss-review-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.ss-review-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.ss-review-modal-close:hover {
  background-color: #f5f5f5;
  color: #333;
}

.ss-review-modal-content {
  margin-bottom: 16px;
}

.ss-review-modal-text {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 12px;
}

.ss-review-modal-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
}

.ss-review-modal-star {
  font-size: 18px;
  color: #ffc107;
  cursor: pointer;
  transition: transform 0.2s;
}

.ss-review-modal-star:hover {
  transform: scale(1.1);
}

.ss-review-modal-actions {
  display: flex;
  gap: 8px;
}

.ss-review-modal-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
  display: inline-block;
}

.ss-review-modal-btn-primary {
  background: #0073aa;
  color: #fff;
}

.ss-review-modal-btn-primary:hover {
  background: #005a87;
  color: #fff;
}

.ss-review-modal-btn-secondary {
  background: #f6f7f7;
  color: #555;
  border: 1px solid #ddd;
}

.ss-review-modal-btn-secondary:hover {
  background: #e8e8e8;
  color: #333;
}

.ss-review-modal-dismiss {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #666;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.ss-review-modal-dismiss:hover {
  background: #333;
}

/* Compact email template sections */
.email-template-section {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px 12px 6px;
  margin: 12px 0;
}
.email-template-section h4 {
  margin: 0 0 8px;
}
.email-template-section .form-table th,
.email-template-section .form-table td {
  padding-top: 6px;
  padding-bottom: 6px;
}
.template-tags-documentation.compact code {
  white-space: nowrap;
}
.template-tags-documentation.compact td {
  line-height: 1.6;
}

/* Preview modal */
.ss-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100000; /* above WP admin */
  display: none;
}
.ss-modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 100001;
  width: min(1000px, 90vw);
  height: min(720px, 85vh);
  display: none;
}
.ss-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}
.ss-modal-title { font-weight: 600; margin: 0; }
.ss-modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
}
.ss-modal-body { height: calc(100% - 45px); }
.ss-modal-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
/* Smart Support Admin Styles */

/* =======================
   GENERAL ADMIN STYLES
   ======================= */

/* =======================
   INLINE STYLE REPLACEMENTS
   ======================= */

/* Display utilities */
.hidden { display: none !important; }
.flex { display: flex !important; }
.inline { display: inline !important; }
.inline-block { display: inline-block !important; }

/* Flex utilities */
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; }
.flex-end { display: flex; justify-content: flex-end; }
.flex-gap-10 { display: flex; gap: 10px; }
.flex-gap-15 { display: flex; gap: 15px; }
.flex-gap-20 { display: flex; gap: 20px; }

/* Margin utilities */
.margin-top-10 { margin-top: 10px !important; }
.margin-top-15 { margin-top: 15px !important; }
.margin-top-18 { margin-top: 18px !important; }
.margin-bottom-10 { margin-bottom: 10px !important; }
.margin-bottom-15 { margin-bottom: 15px !important; }
.margin-bottom-18 { margin-bottom: 18px !important; }
.margin-0 { margin: 0 !important; }

/* Padding utilities */
.padding-0 { padding: 0 !important; }

/* Width utilities */
.width-100 { width: 100% !important; }
.width-100vw { width: 100vw !important; }
.min-width-320 { min-width: 320px !important; }

/* Height utilities */
.height-100vh { height: 100vh !important; }

/* Position utilities */
.position-fixed { position: fixed !important; }
.position-absolute { position: absolute !important; }
.top-0 { top: 0 !important; }
.left-0 { left: 0 !important; }
.top-10 { top: 10px !important; }
.right-10 { right: 10px !important; }
.top-50 { top: 50% !important; }
.left-50 { left: 50% !important; }

/* Transform utilities */
.transform-center { transform: translate(-50%, -50%) !important; }

/* Z-index utilities */
.z-index-1000 { z-index: 1000 !important; }
.z-index-1001 { z-index: 1001 !important; }

/* Background utilities */
.bg-white { background: #fff !important; }
.bg-none { background: none !important; }
.bg-rgba-black-35 { background: rgba(0,0,0,0.35) !important; }

/* Border utilities */
.border-none { border: none !important; }
.border-radius-8 { border-radius: 8px !important; }
.border-radius-3 { border-radius: 3px !important; }

/* Box shadow utilities */
.box-shadow-modal { box-shadow: 0 4px 24px rgba(0,0,0,0.18) !important; }

/* Font utilities */
.font-size-12 { font-size: 12px !important; }
.font-size-15 { font-size: 15px !important; }
.font-size-16 { font-size: 16px !important; }
.font-size-20 { font-size: 20px !important; }
.font-size-22 { font-size: 22px !important; }

/* Font weight utilities */
.font-weight-600 { font-weight: 600 !important; }

/* Color utilities */
.color-888 { color: #888 !important; }
.color-23282d { color: #23282d !important; }
.color-646970 { color: #646970 !important; }
.color-00a32a { color: #00a32a !important; }
.color-d63638 { color: #d63638 !important; }
.color-f0f0f1 { color: #f0f0f1 !important; }

/* Cursor utilities */
.cursor-pointer { cursor: pointer !important; }

/* Flex utilities for specific components */
.flex-1 { flex: 1 !important; }

/* =======================
   COMPONENT-SPECIFIC STYLES
   ======================= */

/* Dashboard Settings Modal */
.dashboard-settings-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
}

.dashboard-settings-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
}

.dashboard-settings-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.35);
    z-index: 1000;
}

.dashboard-settings-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    z-index: 1001;
    min-width: 320px;
    max-width: 90vw;
    padding: 20px;
}

.dashboard-settings-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #888;
}

.dashboard-settings-title {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 20px;
    font-weight: 600;
    color: #23282d;
}

.dashboard-settings-form {
    margin-bottom: 0;
}

.dashboard-settings-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.dashboard-settings-submit {
    margin-top: 18px;
    width: 100%;
    font-size: 15px;
}

/* Status badges */
.status-active {
    color: #00a32a;
    font-weight: 600;
}

.status-inactive {
    color: #d63638;
    font-weight: 600;
}

/* Department badges */
.department-badge {
    background: #f0f0f1;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
}

/* Color preview */
.color-preview {
    background-color: var(--color);
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Progress bars */
.progress-bar {
    width: var(--width);
    background-color: var(--color);
}

/* Priority colors */
.priority-color {
    background-color: var(--color);
}

/* Description text */
.description {
    color: #d63638;
}

/* Getting started sections */
.products-getting-started {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
}

/* Form elements */
.delete-product-form,
.delete-department-form {
    display: inline;
}

/* Customer info */
.customer-info {
    margin: 0 0 5px 0;
}

.customer-email {
    margin: 0 0 5px 0;
    color: #646970;
}

.customer-since {
    margin: 0;
    font-size: 12px;
    color: #646970;
}

/* Widget actions */
.widget-actions {
    margin-top: 15px;
}

/* Custom fields actions */
.custom-fields-actions {
    margin-top: 15px;
}

/* Reply type menu */
.reply-type-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.reply-type-menu > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Submit actions */
.submit-actions {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.submit-actions > div {
    flex: 1;
}

.submit-actions label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Ticket meta sidebar */
.ticket-meta-sidebar {
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
}

.meta-item {
    flex: 1;
}

/* Customer search results */
.customer-search-results {
    display: none;
}

/* Add user link */
.add-user-link {
    font-size: 12px;
}

/* Widget actions */
.widget-actions {
    margin-top: 15px;
}

/* File input elements */
.file-input-text {
    display: none;
}

.selected-files {
    display: none;
}

.btn-loading {
    display: none;
}

.preview-modal {
    display: none;
}

/* Attachment list */
.attachment-list {
    display: none;
}

/* Customer info display */
.customer-info {
    display: none;
}

.agent-info {
    display: none;
}

/* Department color options */
.department-color-option {
    color: var(--color);
}

/* =======================
   GENERAL ADMIN STYLES
   ======================= */

.smart-support-admin {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* =======================
   SETTINGS PAGE STYLES
   ======================= */

/* Settings Section Dividers */
.settings-section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
    margin: 30px 0;
    border: none;
    position: relative;
}

.settings-section-divider::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #f0f0f0, transparent);
}

.settings-section-divider::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #f0f0f0, transparent);
}

/* Enhanced divider styling for better visual separation */
.settings-content h3 + .settings-section-divider {
    margin-top: 25px;
}

.settings-section-divider + h3 {
    margin-top: 25px;
}

/* Alternative divider style for different sections */
.settings-section-divider.strong {
    background: linear-gradient(to right, transparent, #007cba, transparent);
    height: 2px;
    margin: 35px 0;
}

.settings-section-divider.strong::before,
.settings-section-divider.strong::after {
    background: linear-gradient(to right, transparent, rgba(0, 124, 186, 0.3), transparent);
}

/* Section grouping for better organization */
.settings-section-group {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.settings-section-group h3 {
    margin-top: 0;
    color: #007cba;
    border-bottom-color: #007cba;
}

.settings-section-group .settings-section-divider {
    margin: 20px 0;
    background: linear-gradient(to right, transparent, #c1c1c1, transparent);
}

/* Improved spacing around dividers */
.settings-content .form-table:last-of-type + .settings-section-divider {
    margin-top: 25px;
}

.settings-section-divider + .form-table {
    margin-top: 25px;
}

/* Settings Navigation */
.smart-support-settings {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.settings-navigation {
    width: 250px;
    flex-shrink: 0;
}

.settings-content {
    flex: 1;
    min-width: 0;
}

.settings-tabs {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.settings-tabs .tab {
    border-bottom: 1px solid #f0f0f0;
}

.settings-tabs .tab:last-child {
    border-bottom: none;
}

.settings-tabs .tab a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    text-decoration: none;
    color: #666;
    transition: all 0.2s ease;
    font-weight: 500;
}

.settings-tabs .tab a:hover {
    background: #f8f9fa;
    color: #007cba;
}

.settings-tabs .tab.active a {
    background: #007cba;
    color: #fff;
    border-left: 4px solid #005a87;
}

.settings-tabs .tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Settings Content Styling */
.settings-content h3 {
    margin: 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
    color: #1d2327;
    font-size: 1.3em;
    font-weight: 600;
}

/* Advanced settings subtabs */
.smart-support-subtabs {
    margin-top: 10px;
    margin-bottom: 24px;
}

.settings-content .form-table {
    margin-top: 0;
}

.settings-content .form-table th {
    padding: 15px 10px 15px 0;
    width: 200px;
    font-weight: 600;
    color: #1d2327;
    vertical-align: top;
}

.settings-content .form-table td {
    padding: 15px 0;
    vertical-align: top;
}

.settings-content .form-table input[type="text"],
.settings-content .form-table input[type="number"],
.settings-content .form-table input[type="email"],
.settings-content .form-table select,
.settings-content .form-table textarea {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.settings-content .form-table input:focus,
.settings-content .form-table select:focus,
.settings-content .form-table textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px rgba(0, 124, 186, 0.2);
}

.settings-content .form-table .description {
    margin-top: 5px;
    color: #666;
    font-style: italic;
    font-size: 13px;
}

.settings-content .form-table label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.settings-content .form-table input[type="checkbox"],
.settings-content .form-table input[type="radio"] {
    margin: 0;
    width: auto;
}

/* Settings Section Groups */
.settings-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.settings-section h4 {
    margin: 0 0 15px 0;
    color: #1d2327;
    font-size: 1.1em;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

/* Responsive Settings Layout */
@media (max-width: 1200px) {
    .smart-support-settings {
        flex-direction: column;
        gap: 20px;
    }
    
    .settings-navigation {
        width: 100%;
    }
    
    .settings-tabs {
        display: flex;
        flex-wrap: wrap;
        border: none;
        background: none;
    }
    
    .settings-tabs .tab {
        border: 1px solid #ddd;
        border-radius: 4px;
        margin: 0 5px 5px 0;
        flex: 1;
        min-width: 120px;
    }
    
    .settings-tabs .tab:last-child {
        border-bottom: 1px solid #ddd;
    }
}

@media (max-width: 768px) {
    .settings-content .form-table th,
    .settings-content .form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .settings-content .form-table th {
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 5px;
        margin-bottom: 5px;
    }
    
    .settings-section-divider {
        margin: 20px 0;
    }
}

/* =======================
   MAIN LAYOUT STRUCTURE
   ======================= */

.smart-support-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.smart-support-main {
    flex: 1;
    min-width: 0;
}

.smart-support-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* =======================
   TICKET VIEW LAYOUT
   ======================= */

.smart-support-ticket-view {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.smart-support-ticket-view .ticket-main {
    flex: 1;
    min-width: 0;
}

.smart-support-ticket-view .ticket-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* =======================
   FORM LAYOUT (CREATE/EDIT)
   ======================= */

.smart-support-form-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    margin-left: 0;
}

.smart-support-form-layout .form-main {
    flex: 1;
    min-width: 0;
    width: 75%;
    float: left;
    margin-right: 20px;
}

/* =======================
   TICKETS SIDEBAR
   ======================= */

.tickets-sidebar-toggle {
    position: fixed;
    left: 160px;
    top: 32px;
    z-index: 100000;
    background: #f0f0f1;
    color: #646970;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 12px;
    font-weight: 600;
}

.tickets-sidebar-toggle:hover {
    background: #e0e0e0;
    color: #1d2327;
}

.tickets-sidebar-toggle .dashicons {
    display: none;
}

.tickets-sidebar-toggle::before {
    content: '▶';
    font-size: 12px;
    line-height: 1;
}

/* Hide toggle button when sidebar is open */
body.tickets-sidebar-open .tickets-sidebar-toggle {
    display: none;
}

/* When admin menu is collapsed */
.folded .tickets-sidebar-toggle {
    left: 36px;
}

/* When sidebar is open, move toggle button */
body.tickets-sidebar-open .tickets-sidebar-toggle {
    left: 480px;
}

body.tickets-sidebar-open.folded .tickets-sidebar-toggle {
    left: 356px;
}

@media screen and (max-width: 782px) {
    .tickets-sidebar-toggle {
        top: 46px;
    }
}

.tickets-sidebar {
    position: fixed;
    left: -320px;
    top: 32px;
    bottom: 0;
    width: 320px;
    background: #fff;
    border-right: 1px solid #e1e1e1;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    z-index: 99999;
    display: flex;
    flex-direction: column;
}

@media screen and (max-width: 782px) {
    .tickets-sidebar {
        top: 46px;
    }
}

.tickets-sidebar.open {
    left: 160px;
}

/* When admin menu is collapsed */
.folded .tickets-sidebar.open {
    left: 36px;
}

.tickets-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e1e1;
    background: #fafafa;
}

.tickets-sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.tickets-sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tickets-sidebar-filter-toggle,
.tickets-sidebar-close {
    background: none;
    border: none;
    color: #646970;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tickets-sidebar-filter-toggle:hover,
.tickets-sidebar-close:hover {
    color: #1d2327;
}

.tickets-sidebar-filter-toggle .dashicons,
.tickets-sidebar-close .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.tickets-sidebar-filter-toggle.active {
    color: #0073aa;
}

.tickets-sidebar-filter-dropdown {
    position: relative;
}

.filter-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 150px;
    z-index: 1000;
    padding: 4px 0;
}

.filter-dropdown-menu.show {
    display: block;
}

.filter-dropdown-menu .filter-option {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: #1d2327;
    text-decoration: none;
    cursor: pointer;
}

.filter-dropdown-menu .filter-option:hover {
    background: #f6f7f7;
}

.filter-dropdown-menu .filter-option[data-active="1"] {
    background: #e7f5fe;
    color: #0073aa;
    font-weight: 600;
}

.tickets-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.tickets-list {
    padding: 0;
}

.ticket-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f1;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.ticket-item:hover {
    background: #f6f7f7;
}

.ticket-item.active {
    background: #e7f5fe;
    border-left: 3px solid #0073aa;
}

.ticket-item-avatar {
    flex-shrink: 0;
}

.ticket-item-avatar img {
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.ticket-item-content {
    flex: 1;
    min-width: 0;
}

.ticket-item-name {
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-item-subject {
    font-size: 12px;
    color: #646970;
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticket-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.ticket-item-time {
    color: #8c8f94;
}

.ticket-item-state {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-item-state.state-opened {
    background: #e7f5fe;
    color: #0073aa;
}

.ticket-item-state.state-closed {
    background: #f0f0f1;
    color: #646970;
}

.ticket-item-state.state-delayed {
    background: #fff3e0;
    color: #f57c00;
}

.no-tickets {
    padding: 40px 20px;
    text-align: center;
    color: #646970;
    font-size: 14px;
}

/* Adjust form layout when sidebar is open - only apply when sidebar-open class is present */
.smart-support-form-layout.sidebar-open {
    margin-left: 320px;
}

/* When admin menu is folded */
.folded .smart-support-form-layout.sidebar-open {
    margin-left: 320px;
}

.smart-support-form-layout .form-sidebar {
    width: 300px;
    flex-shrink: 0;
    width: 22%;
    float: right;
}

/* Clear floats for form layout */
.smart-support-form-layout::after {
    content: "";
    display: table;
    clear: both;
}

/* =======================
   TICKET HEADER STYLES
   ======================= */

.ticket-header {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

/* Ticket meta grid layout for overview */
.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.meta-item strong {
    color: #1d2327;
    font-weight: 600;
}

/* Grid layout meta items */
.meta-grid .meta-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
}

.meta-grid .meta-item strong {
    font-size: 12px;
    color: #646970;
    text-transform: uppercase;
}

/* =======================
   STATUS & PRIORITY BADGES
   ======================= */

.status-badge, .state-badge, .priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 6px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-sizing: border-box;
    vertical-align: middle;
}

/* Status badges */
.status-new { background: #f0f6fc; color: #0d47a1; }
.status-working_on { background: #fff8e1; color: #e65100; }
.status-on_hold { background: #ffeaa7; color: #880e4f; }
.status-reopened { background: #d63638; color: #fff; }

/* State badges */
.state-opened { background: #e8f5e8; color: #2e7d32; }
.state-closed { background: #ffebee; color: #d32f2f; }
.state-delayed { background: #fff8e1; color: #f9a825; }

/* Priority badges */
.priority-low { background: #f3e5f5; color: #7b1fa2; }
.priority-medium { background: #e0f2f1; color: #00695c; }
.priority-high { background: #fff3e0; color: #ef6c00; }
.priority-urgent { background: #ffebee; color: #c62828; animation: pulse 2s infinite; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(214, 54, 56, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(214, 54, 56, 0); }
    100% { box-shadow: 0 0 0 0 rgba(214, 54, 56, 0); }
}

/* =======================
   MESSAGE & REPLY STYLES
   ======================= */

.ticket-message, .reply-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

.ticket-message.original-ticket {
    border-left: 4px solid #0073aa;
}

.reply-item.internal-reply {
    background: #f8f9fa;
    border: none;
    border-left: 4px solid #856404;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.reply-item.internal-reply .message-content {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
}

.reply-item.agent-reply {
    border-left: 4px solid #00a32a;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f1;
    background: #fafafa;
}

.author-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.author-details {
    flex: 1;
    min-width: 0;
}

.author-name-role {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.author-name-role strong {
    color: #1d2327;
    font-weight: 600;
}

.author-role {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

.customer-role {
    background: #e3f2fd;
    color: #1976d2;
}

.agent-role {
    background: #f3e5f5;
    color: #7b1fa2;
}

.internal-role {
    background: #fff3e0;
    color: #f57c00;
}

.message-meta {
    font-size: 12px;
    color: #646970;
    margin-top: 4px;
}

.message-separator {
    margin: 0 6px;
    color: #c3c4c7;
}

.message-subject, .reply-context {
    color: #646970;
    font-style: italic;
}

.message-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.internal-indicator {
    font-size: 14px;
    color: #d63638;
    margin-left: 8px;
}

.message-content {
    padding: 15px 20px;
    line-height: 1.6;
    position: relative;
    background: #fff;
}

.message-content.expanded {
    max-height: none;
}

/* Lists styling in message content */
.message-content ul,
.message-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.message-content ul {
    list-style-type: disc;
}

.message-content ol {
    list-style-type: decimal;
}

.message-content li {
    margin: 0.5em 0;
    line-height: 1.6;
}

.message-content ul ul,
.message-content ol ol,
.message-content ul ol,
.message-content ol ul {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.message-content ul ul {
    list-style-type: circle;
}

.message-content ul ul ul {
    list-style-type: square;
}

/* Text alignment in message content */
.message-content p[style*="text-align: left"],
.message-content .alignleft {
    text-align: left;
}

.message-content p[style*="text-align: center"],
.message-content .aligncenter {
    text-align: center;
}

.message-content p[style*="text-align: right"],
.message-content .alignright {
    text-align: right;
}

.message-content p[style*="text-align: justify"],
.message-content .alignjustify {
    text-align: justify;
}

/* Support for inline style attributes */
.message-content [style*="text-align"] {
    display: block;
}

/* Ensure alignment works on divs and other block elements */
.message-content div[style*="text-align"] {
    display: block;
}

/* =======================
   TICKET MESSAGE TABS
   ======================= */

.ticket-message-tabs {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

.ticket-tabs-nav {
    display: flex;
    border-bottom: 1px solid #e1e1e1;
    background: #fafafa;
    margin: 0;
    padding: 0;
}

.ticket-tab-button {
    background: transparent;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #646970;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    margin: 0;
}

.ticket-tab-button:hover {
    color: #1d2327;
    background: #f0f0f1;
}

.ticket-tab-button.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    background: #fff;
}

.ticket-tab-content {
    display: none;
    padding: 0;
}

.ticket-tab-content.active {
    display: block;
}

.ticket-tab-content .ticket-message {
    border: none;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
}

.ticket-tab-content .custom-fields-widget {
    padding: 20px;
}

/* =======================
   TICKET DETAILS WIDGETS
   ======================= */

.ticket-details-widget .detail-row,
.custom-fields-widget .detail-row {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f1;
}

.ticket-details-widget .detail-row:last-of-type,
.custom-fields-widget .detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.ticket-details-widget .detail-label,
.custom-fields-widget .detail-label {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
    color: #1d2327;
    font-size: 12px;
}

.ticket-details-widget .detail-value,
.custom-fields-widget .detail-value {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ticket-details-widget .detail-value small {
    color: #646970;
    font-size: 12px;
}

.ticket-details-widget .detail-value select,
.ticket-details-widget .detail-value input,
.custom-fields-widget .detail-value select,
.custom-fields-widget .detail-value input {
    font-size: 12px;
    padding: 4px 8px;
    line-height: 1.4;
}

.ticket-details-widget .add-user-link {
    font-size: 12px;
    text-decoration: none;
    color: #0073aa;
    margin-top: 5px;
}

.ticket-details-widget .add-user-link:hover {
    text-decoration: underline;
}

.ticket-details-widget .widget-actions,
.custom-fields-widget .custom-fields-actions {
    margin-top: 10px;
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}

.ticket-details-widget .update-ticket-btn,
.custom-fields-widget .update-custom-fields-btn {
    flex: 1;
    text-align: center;
    padding: 6px 12px;
    font-size: 12px;
    margin-bottom: 0;
}

/* =======================
   REPLY FORM SECTION
   ======================= */

.reply-form-section {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.reply-form-section h3 {
    margin: 0 0 15px 0;
    padding: 0;
    font-size: 16px;
    color: #1d2327;
    border-bottom: 1px solid #e1e1e1;
    padding-bottom: 10px;
}

.reply-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

.reply-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #1d2327;
    cursor: pointer;
}

.reply-options input[type="checkbox"] {
    margin: 0;
    transform: scale(1.1);
}

/* =======================
   ATTACHMENT STYLES
   ======================= */

.message-attachments {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e1e1;
}

.message-attachments h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
}

.attachment-item:last-child {
    border-bottom: none;
}

.attachment-icon {
    font-size: 16px;
}

.attachment-item a {
    color: #0073aa;
    text-decoration: none;
}

.attachment-item a:hover {
    text-decoration: underline;
}

.attachment-item small {
    color: #646970;
    font-size: 12px;
}

/* =======================
   UPLOAD DROPZONE
   ======================= */

.upload-dropzone {
    border: 2px dashed #c3c4c7;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.upload-placeholder h3 {
    margin: 10px 0;
    color: #1d2327;
    font-size: 16px;
}

.upload-placeholder p {
    color: #646970;
    margin: 5px 0;
}

.files-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

/* =======================
   DASHBOARD STATS
   ======================= */

.smart-support-stats {
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 8px;
    display: block;
}

.stat-label {
    font-size: 14px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* =======================
   FORM FIELDS
   ======================= */

.custom-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d2327;
}

.field-group .required {
    color: #d63638;
}

.subject-field input {
    font-size: 18px;
    padding: 12px;
    height: auto;
    line-height: 1.4;
}

.subject-field .description {
    font-size: 13px;
    color: #646970;
    margin-top: 5px;
    font-style: italic;
}

.customer-search {
    /* Custom styles for searchable customer dropdown */
}

.customer-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    margin-top: 10px;
}

/* =======================
   INTERACTIVE ELEMENTS
   ======================= */

.toggle-message {
    cursor: pointer;
}

.copy-text {
    cursor: pointer;
}

.copy-text.copied {
    background: #00a32a !important;
    color: #fff !important;
    border-color: #00a32a !important;
}

.copy-text.copied::after {
    content: " ✓";
}

/* =======================
   DEPARTMENT STYLING
   ======================= */

.department-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
}

/* =======================
   TABLE COLUMN WIDTHS
   ======================= */
   
/* Tickets list table styles moved to tickets-list.css */

/* =======================
   RESPONSIVE DESIGN
   ======================= */

@media (max-width: 1200px) {
    .smart-support-layout,
    .smart-support-ticket-view,
    .smart-support-form-layout {
        flex-direction: column;
    }

    .smart-support-sidebar,
    .ticket-sidebar,
    .form-sidebar {
        width: 100%;
        order: -1;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ticket-meta {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .message-header {
        flex-direction: column;
        gap: 10px;
    }

    .message-actions {
        justify-content: flex-start;
    }

    .custom-fields-grid {
        grid-template-columns: 1fr;
    }

    .reply-options {
        flex-direction: column;
        gap: 12px;
    }

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

/* =======================
   LOADING STATES
   ======================= */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ccc;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

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

/* =======================
   EDITOR CUSTOMIZATIONS
   ======================= */

.ticket-editor {
    margin-top: 10px;
}

.ticket-editor .wp-editor-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

/* =======================
   POSTBOX CUSTOMIZATIONS
   ======================= */

.smart-support-admin .postbox {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 10px;
}

.smart-support-admin .postbox .postbox-header {
    background: #f9f9f9;
    border-bottom: 1px solid #e1e1e1;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.smart-support-admin .postbox .postbox-header h2 {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
    cursor: move;
}

.smart-support-admin .postbox .postbox-header .handle-actions {
    display: flex;
    align-items: center;
}

.smart-support-admin .postbox .postbox-header .handlediv {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-support-admin .postbox .postbox-header .toggle-indicator {
    width: 10px;
    height: 10px;
    border-right: 2px solid #646970;
    border-bottom: 2px solid #646970;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.smart-support-admin .postbox.closed .toggle-indicator {
    transform: rotate(-135deg);
}

.smart-support-admin .postbox .inside {
    padding: 10px 12px;
    background: #fff;
    border-radius: 0 0 6px 6px;
}

/* Sortable placeholder */
.postbox-placeholder {
    border: 2px dashed #0073aa;
    background: #f0f8ff;
    height: 50px;
    margin-bottom: 20px;
    border-radius: 6px;
}

/* Drag and drop visual feedback */
.ui-sortable-helper {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: rotate(2deg);
}

.ui-sortable-placeholder {
    visibility: visible !important;
    background: #f0f8ff;
    border: 2px dashed #0073aa;
    border-radius: 6px;
    height: 50px;
    margin-bottom: 20px;
}

/* =======================
   CUSTOMER INFO STYLES
   ======================= */

.customer-info {
    padding: 0;
    background: transparent;
    border: none;
}

.customer-info img {
    border-radius: 50%;
    flex-shrink: 0;
}

.customer-details h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.customer-details p {
    margin: 0 0 3px 0;
    font-size: 13px;
    color: #646970;
}

.customer-since {
    font-size: 12px;
    color: #646970;
    font-style: italic;
}

/* =======================
   CUSTOMER SEARCH INPUT
   ======================= */

.customer-search-container {
    position: relative;
}

.customer-search-input {
    width: 100%;
    height: 36px;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    color: #2c3338;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.customer-search-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.customer-search-input::placeholder {
    color: #646970;
    font-style: italic;
}

.customer-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 2px;
}

.customer-result-item {
    padding: 12px;
    border-bottom: 1px solid #f0f0f1;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.customer-result-item:last-child {
    border-bottom: none;
}

.customer-result-item:hover,
.customer-result-item.highlighted {
    background-color: #0073aa;
    color: #fff;
}

.customer-result-item .customer-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.customer-result-item .customer-result-name {
    font-weight: 500;
    font-size: 14px;
}

.customer-result-item .customer-result-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.customer-result-item .approved-status {
    background-color: #00a32a;
    color: #fff;
}

.customer-result-item:hover .approved-status,
.customer-result-item.highlighted .approved-status {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.customer-result-item .customer-result-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.customer-result-item .customer-result-email {
    font-size: 13px;
    color: #646970;
}

.customer-result-item .customer-result-approval {
    font-size: 11px;
    color: #646970;
    font-style: italic;
}

.customer-result-item:hover .customer-result-email,
.customer-result-item:hover .customer-result-approval,
.customer-result-item.highlighted .customer-result-email,
.customer-result-item.highlighted .customer-result-approval {
    color: rgba(255, 255, 255, 0.8);
}


/* =======================
   CUSTOMER TICKETS LIST
   ======================= */

.customer-tickets-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
}

.customer-tickets-section h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #1d2327;
    font-weight: 600;
}

.customer-tickets-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
}

.ticket-status-section {
    margin-bottom: 15px;
}

.ticket-status-section:last-child {
    margin-bottom: 0;
}

.status-header {
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 0;
    border-bottom: 1px solid #e1e1e1;
}

.current-header {
    color: #0073aa;
}

.opened-header {
    color: #155724;
}

.closed-header {
    color: #721c24;
}

.ticket-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.customer-ticket-item {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.customer-ticket-item.current-ticket {
    background: #f0f8ff;
    padding: 4px 8px;
    border-radius: 3px;
    margin: 0 -8px;
}

.customer-ticket-item .ticket-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
    flex: 1;
}

.customer-ticket-item .ticket-link:hover {
    color: #005a87;
    text-decoration: underline;
}

.customer-tickets-footer {
    margin-top: 10px;
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid #f0f0f1;
}

.customer-tickets-footer .button {
    font-size: 11px;
    padding: 4px 8px;
    height: auto;
    line-height: 1.4;
}

.no-tickets {
    text-align: center;
    padding: 20px;
    color: #646970;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 4px;
}

/* =======================
   SUBJECT EDITING
   ======================= */

.standalone-subject {
    margin-bottom: 20px;
}

.standalone-subject .subject-display,
.subject-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.subject-display strong {
    font-weight: 600;
    color: #1d2327;
    margin-right: 10px;
}

.subject-text {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    flex: 1;
}

.edit-subject-btn {
    margin-left: 10px;
    font-size: 12px;
}

.subject-edit-form {
    margin-top: 10px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.subject-input {
    font-size: 16px;
    padding: 12px;
    height: auto;
    line-height: 1.4;
    width: 100%;
    margin-bottom: 10px;
}

.subject-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* =======================
   METADATA WIDGETS
   ======================= */

.ticket-metadata-widget .metadata-badges {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.metadata-item:last-child {
    border-bottom: none;
}

.metadata-label {
    font-weight: 600;
    color: #1d2327;
    font-size: 13px;
}

.status-badge, .state-badge, .priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 6px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-sizing: border-box;
    vertical-align: middle;
}

.status-badge.status-new { background: #f0f6fc; color: #0d47a1; }
.status-badge.status-working_on { background: #fff8e1; color: #e65100; }
.status-badge.status-on_hold { background: #ffeaa7; color: #880e4f; }

.state-badge.state-opened { background: #d4edda; color: #155724; }
.state-badge.state-closed { background: #f8d7da; color: #721c24; }
.state-badge.state-delayed { background: #fff3cd; color: #856404; }

.priority-badge.priority-low { background: #d1ecf1; color: #0c5460; }
.priority-badge.priority-medium { background: #fff3cd; color: #856404; }
.priority-badge.priority-high { background: #f8d7da; color: #721c24; }
.priority-badge.priority-urgent { background: #f5c6cb; color: #721c24; animation: pulse 2s infinite; }

.created-info {
    font-size: 12px;
    color: #646970;
}

/* Creation info styling */
.creation-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.creation-time {
    font-weight: 500;
    color: #0073aa;
}

.creation-note {
    color: #646970;
    font-size: 12px;
}

/* =======================
   CUSTOM FIELDS MAIN VIEW
   ======================= */

.custom-fields-main .custom-fields-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 15px;
}

.custom-fields-main .field-group {
    display: flex;
    flex-direction: column;
}

.custom-fields-main .field-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d2327;
    font-size: 13px;
}

.custom-fields-main select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.custom-fields-main select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.custom-fields-actions {
    margin-top: 15px;
    text-align: center;
}

.fields-updated {
    background: #d4edda;
    color: #155724;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 13px;
}

/* =======================
   RESPONSIVE ADJUSTMENTS
   ======================= */

@media (max-width: 1200px) {
    .subject-edit-form {
        padding: 10px;
    }

    .subject-edit-form .button {
        font-size: 12px;
        padding: 6px 10px;
    }

    .custom-fields-main .custom-fields-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .smart-support-form-layout .form-main,
    .smart-support-form-layout .form-sidebar {
        width: 100%;
        float: none;
        margin-right: 0;
    }
}

/* =======================
   ADDITIONAL WIDGET STYLES
   ======================= */

.custom-fields-widget .detail-row {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f1;
}

.custom-fields-widget .detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Loading and update states */
.loading-field {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.loading-field::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

.field-updated {
    background: #d4edda !important;
    transition: background 0.3s ease;
}

@keyframes loading-stripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 40px 40px;
    }
}

/* =======================
   FINAL RESPONSIVE RULES
   ======================= */

@media (max-width: 1200px) {
    .customer-info {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
} 

/* Ticket Metadata Widget */
.ticket-metadata-widget {
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.metadata-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metadata-label {
    font-weight: 500;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.created-info {
    color: #666;
    font-size: 13px;
}

@media (max-width: 768px) {
    .metadata-badges {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Meta Grid Layout */ 

/* Create Actions Widget */
.create-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.create-actions .button-large {
    width: 100%;
    text-align: center;
    padding: 8px 16px;
}

.publishing-action .button-primary {
    background: #00a32a;
    border-color: #00a32a;
}

.publishing-action .button-primary:hover {
    background: #008a20;
    border-color: #008a20;
}

/* File Attachment Upload Area */
.attachment-upload-area {
    margin-top: 10px;
}

.upload-dropzone {
    border: 2px dashed #c3c4c7;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.upload-placeholder h3 {
    margin: 10px 0;
    color: #1d2327;
    font-size: 16px;
}

.upload-placeholder .dashicons {
    font-size: 48px;
    color: #c3c4c7;
}

.attachment-list {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.files-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon {
    font-size: 20px;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
    color: #1d2327;
}

.file-size {
    font-size: 12px;
    color: #646970;
}

.file-remove {
    color: #d63638;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.file-remove:hover {
    color: #8f0000;
}

/* Subject Field Enhancement */
.subject-field .subject-input {
    font-size: 18px;
    padding: 12px;
    height: auto;
    line-height: 1.4;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.subject-field .subject-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.subject-field .subject-input.updating {
    opacity: 0.7;
    pointer-events: none;
}

.subject-field .subject-input::placeholder {
    color: #999;
    font-style: italic;
}

/* Reply Type Selector */
.reply-type-selector {
    margin-bottom: 15px;
}

.reply-type-menu {
    display: flex;
    gap: 30px;
    background: transparent;
    border-bottom: 1px solid #e1e5e9;
    padding: 0;
    margin-bottom: 20px;
}

.reply-type-btn {
    display: inline-block;
    padding: 12px 0;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #646970;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.reply-type-btn:hover {
    color: #1d2327;
}

.reply-type-btn.active {
    color: #1d2327;
}

.reply-type-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #00a32a;
}

/* Internal Note Styling */
.reply-form-section.internal-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.reply-form-section.internal-note .reply-type-selector {
    margin-bottom: 10px;
}

.reply-form-section.internal-note .reply-type-select {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.reply-form-section.internal-note .reply-type-select:focus {
    border-color: #856404;
    box-shadow: 0 0 0 1px #856404;
}

/* Internal Note Visual Indicator */
.reply-form-section.internal-note::before {
    content: "📝 Internal Note";
    display: block;
    font-weight: bold;
    color: #856404;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Helper Text Styling */
.customer-info,
.agent-info,
.status-help {
    color: #646970;
    font-size: 12px;
    margin-top: 5px;
}

.required {
    color: #d63638;
}

.add-user-link {
    font-size: 12px;
    text-decoration: none;
    color: #0073aa;
    margin-top: 5px;
    display: inline-block;
}

.add-user-link:hover {
    color: #005a87;
} 

/* Select2 Integration for Admin */
.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single {
    height: 36px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background-color: #fff;
}

.select2-container .select2-selection--single:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 34px;
    padding-left: 12px;
    color: #2c3338;
}

.select2-container .select2-selection--single .select2-selection__arrow {
    height: 34px;
    right: 10px;
}

.select2-container .select2-selection--single .select2-selection__placeholder {
    color: #646970;
}

/* Select2 Dropdown */
.select2-dropdown {
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background-color: #fff;
}

.select2-container--default .select2-results__option {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f1;
}

.select2-container--default .select2-results__option:last-child {
    border-bottom: none;
}

.select2-container--default .select2-results__option--highlighted {
    background-color: #0073aa;
    color: #fff;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #f0f8ff;
    color: #0073aa;
}

/* Custom User and Agent Option Templates */
.user-option,
.agent-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name,
.agent-name {
    font-weight: 500;
    color: #2c3338;
    font-size: 14px;
}

.user-email,
.agent-role {
    font-size: 12px;
    color: #646970;
}

.select2-container--default .select2-results__option--highlighted .user-name,
.select2-container--default .select2-results__option--highlighted .agent-name {
    color: #fff;
}

.select2-container--default .select2-results__option--highlighted .user-email,
.select2-container--default .select2-results__option--highlighted .agent-role {
    color: rgba(255, 255, 255, 0.8);
}

/* Select2 Search Input */
.select2-search--dropdown .select2-search__field {
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Select2 Results Container */
.select2-results__options {
    max-height: 300px;
}

/* Select2 "Clear" button */
.select2-selection__clear {
    color: #646970;
    font-size: 16px;
    line-height: 1;
    margin-right: 10px;
}

.select2-selection__clear:hover {
    color: #d63638;
}

/* Fix for WordPress admin compatibility */
.smart-support-form-layout .select2-container {
    z-index: 999999;
}

.smart-support-form-layout .select2-dropdown {
    z-index: 999999;
} 

/* Enhanced Customer Option Templates */
.customer-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 2px 0;
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customer-name {
    font-weight: 500;
    color: #2c3338;
    font-size: 14px;
}

.customer-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.approved-status {
    background-color: #00a32a;
    color: #fff;
}

.customer-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.customer-email {
    font-size: 13px;
    color: #646970;
}

.customer-approval {
    font-size: 11px;
    color: #646970;
    font-style: italic;
}

/* Highlighted state */
.select2-container--default .select2-results__option--highlighted .customer-name {
    color: #fff;
}

.select2-container--default .select2-results__option--highlighted .customer-email,
.select2-container--default .select2-results__option--highlighted .customer-approval {
    color: rgba(255, 255, 255, 0.8);
}

.select2-container--default .select2-results__option--highlighted .approved-status {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Customer Info Display */
.customer-info {
    margin-top: 8px;
    padding: 10px;
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
}

.customer-info strong {
    color: #0073aa;
}

.status-approved {
    color: #00a32a;
    font-weight: 600;
}

/* Customer Actions */
.customer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f1;
}

.customers-count {
    font-size: 11px;
    color: #646970;
    font-style: italic;
} 

/* No Customers Notice */
.no-customers-notice {
    margin-top: 5px;
}

.no-customers-notice .notice.inline {
    margin: 0;
    padding: 15px;
}

.customer-management-links {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.customer-management-links .button {
    padding: 6px 12px;
    height: auto;
    line-height: 1.4;
}

/* =======================
   TICKET CLOSING BUTTONS
   ======================= */

.ticket-details-widget .close-ticket-btn,
.ticket-details-widget .reopen-ticket-btn {
    flex: 1;
    margin-bottom: 0;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
}

.ticket-details-widget .close-ticket-btn {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.ticket-details-widget .close-ticket-btn:hover {
    background: #c82333;
    border-color: #bd2130;
}

.ticket-details-widget .reopen-ticket-btn {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.ticket-details-widget .reopen-ticket-btn:hover {
    background: #218838;
    border-color: #1e7e34;
}

/* =======================
   AUTO-CLOSE SETTINGS
   ======================= */

#trigger-auto-close {
    background: #17a2b8;
    border-color: #17a2b8;
    color: #fff;
}

#trigger-auto-close:hover {
    background: #138496;
    border-color: #117a8b;
}

#auto-close-result {
    margin-top: 10px;
}

#auto-close-result .notice {
    margin: 0;
    padding: 8px 12px;
    border-radius: 4px;
}

#auto-close-result .notice-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

#auto-close-result .notice-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

#auto-close-result .notice-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
} 

/* =======================
   TICKETS LIST STYLES IMPORT
   ======================= */
   
/* Tickets list styles are now in separate file: tickets-list.css */

/* Filter styles */
.tablenav-pages .tablenav-pages-navspan {
    padding: 0 4px;
}

.tablenav-pages .tablenav-pages-navspan.button {
    cursor: pointer;
}

.tablenav-pages .tablenav-pages-navspan.button:hover {
    background-color: #0073aa;
    color: #fff;
}

/* Screen options compatibility */
.screen-options-wrap {
    margin-top: 10px;
}

.screen-options-wrap .metabox-prefs {
    margin-bottom: 10px;
}

.screen-options-wrap .metabox-prefs label {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 5px;
}

/* Column preferences styling */
.screen-options-wrap .column-prefs {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.screen-options-wrap .column-prefs h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.screen-options-wrap .column-prefs label {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
    min-width: 120px;
}

.screen-options-wrap .column-prefs input[type="checkbox"] {
    margin-right: 8px;
}

.screen-options-wrap .column-prefs label:hover {
    color: #0073aa;
}

/* Enhanced screen options for horizontal layout */
#screen-options-wrap .metabox-prefs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

#screen-options-wrap .metabox-prefs label {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 5px 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#screen-options-wrap .metabox-prefs label:hover {
    background: #f0f0f0;
    border-color: #0073aa;
}

#screen-options-wrap .metabox-prefs input[type="checkbox"] {
    margin-right: 8px;
}

#screen-options-wrap .metabox-prefs label:hover {
    color: #0073aa;
}

/* Column preferences in horizontal layout */
#screen-options-wrap .metabox-prefs .column-prefs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

#screen-options-wrap .metabox-prefs .column-prefs label {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 5px 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

#screen-options-wrap .metabox-prefs .column-prefs label:hover {
    background: #f0f0f0;
    border-color: #0073aa;
    color: #0073aa;
}

/* Enhanced filter dropdowns */
.tablenav {
    overflow: visible;
    width: 100%;
}

.tablenav .actions {
    overflow: visible;
    width: 100%;
}

.tablenav .actions select {
    min-width: 120px;
    margin-right: 8px;
}

.tablenav .actions select:last-child {
    margin-right: 0;
}

/* Bulk actions styling */
.bulk-actions {
    margin-right: 10px;
}

.bulk-actions select {
    min-width: 100px;
}

/* Search box styling */
.tablenav .actions input[type="search"] {
    min-width: 200px;
}

/* Responsive adjustments for list table */
/* Responsive adjustments for list table moved to tickets-list.css */
    
    .tablenav .actions select {
        min-width: 100px;
        margin-bottom: 5px;
    }
    
    .tablenav .actions input[type="search"] {
        min-width: 150px;
    }
}

/* Color Picker Styling for Settings */
.settings-content .wp-color-result {
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.settings-content .wp-color-result:hover {
    border-color: #007cba;
}

.settings-content .wp-color-result .wp-color-result-text {
    line-height: 28px;
    padding: 0 12px;
    font-size: 13px;
    color: #666;
}

.settings-content .wp-picker-container {
    display: inline-block;
    vertical-align: middle;
}

.settings-content .wp-picker-container .wp-color-result {
    margin-right: 6px;
}

.settings-content .wp-picker-container .wp-picker-input-wrap {
    display: inline-block;
    margin-left: 6px;
}

.settings-content .wp-picker-container input[type="text"].wp-color-picker {
    width: 65px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.settings-content .wp-picker-container input[type="text"].wp-color-picker:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px rgba(0, 124, 186, 0.2);
    outline: none;
}

/* Simple color input styling */
.simple-color-field {
    width: 60px;
    height: 35px;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.simple-color-field:hover {
    border-color: #007cba;
}

.simple-color-field:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px rgba(0, 124, 186, 0.2);
    outline: none;
}

.settings-content .wp-picker-container .button {
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
    line-height: 28px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    color: #666;
}

.settings-content .wp-picker-container .button:hover {
    background: #e9ecef;
    border-color: #007cba;
    color: #007cba;
}

/* Color picker styling for all admin pages */
.wp-color-result {
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0;
    margin: 0;
    box-shadow: none;
    transition: border-color 0.2s ease;
}

.wp-color-result:hover {
    border-color: #007cba;
}

.wp-color-result .wp-color-result-text {
    line-height: 28px;
    padding: 0 12px;
    font-size: 13px;
    color: #666;
}

.wp-picker-container {
    display: inline-block;
    vertical-align: middle;
}

.wp-picker-container .wp-color-result {
    margin-right: 6px;
}

.wp-picker-container .wp-picker-input-wrap {
    display: inline-block;
    margin-left: 6px;
}

.wp-picker-container input[type="text"].wp-color-picker {
    width: 65px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wp-picker-container input[type="text"].wp-color-picker:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px rgba(0, 124, 186, 0.2);
    outline: none;
}

.wp-picker-container .button {
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
    line-height: 28px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    color: #666;
    transition: all 0.2s ease;
}

.wp-picker-container .button:hover {
    background: #e9ecef;
    border-color: #007cba;
    color: #007cba;
}

/* Color preview styling */
.color-preview {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #ddd;
    margin-right: 8px;
    vertical-align: middle;
}

/* Enhanced color picker for form tables */
.form-table .wp-picker-container {
    margin-top: 5px;
}

.form-table .wp-picker-container .wp-color-result {
    margin-bottom: 5px;
}

/* Responsive color picker */
@media (max-width: 768px) {
    .wp-picker-container {
        display: block;
        margin-top: 10px;
    }
    
    .wp-picker-container .wp-color-result {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .wp-picker-container .wp-picker-input-wrap {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Compact Admin Search */
/* Note: Compact search bar removed - search is now inline with filters */

/* Search Results Info */
.admin-search-results-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #1976d2;
}

.admin-search-results-info p {
    margin: 0;
    font-weight: 500;
    font-size: 14px;
}

.admin-search-results-info .search-term {
    font-weight: 600;
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 3px;
    margin: 0 2px;
}

/* Search Results Highlighting moved to tickets-list.css */

/* Inline Search Input Styling */
.admin-search-input {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-left: 8px;
    min-width: 200px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-search-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px rgba(0, 124, 186, 0.2);
}

.admin-search-input::placeholder {
    color: #999;
    font-style: italic;
}

/* Ensure proper spacing between search and filters */
.alignleft.actions .admin-search-input {
    margin-bottom: 0;
    vertical-align: middle;
}

/* Responsive Design for Admin Filters */
@media (max-width: 1200px) {
    .admin-filter-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .admin-filter-group {
        min-width: auto;
        width: 100%;
    }
    
    .admin-filter-group.admin-search-group {
        min-width: auto;
    }
    
    .admin-filter-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .admin-search-input {
        min-width: auto;
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }
}

@media (max-width: 782px) {
    .alignleft.actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        overflow: visible;
    }
    
    .alignleft.actions select,
    .alignleft.actions .admin-search-input {
        flex: 1 1 100%;
        min-width: 100%;
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 0;
    }
    
    .alignleft.actions .button {
        flex: 1 1 auto;
        min-width: auto;
        align-self: flex-start;
    }
}

@media (max-width: 768px) {
    .admin-quick-search-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .admin-quick-search-input-group input[type="text"] {
        min-width: auto;
    }
    
    .admin-quick-search-btn {
        width: 100%;
        padding: 10px;
    }
    
    .admin-search-filters {
        padding: 15px;
    }
    
    .admin-filter-group label {
        font-size: 12px;
    }
    
    .admin-filter-group input[type="text"],
    .admin-filter-group select {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* WordPress Admin Integration */
.wp-admin .admin-quick-search-section {
    margin-top: 0;
}

.wp-admin .admin-search-filters {
    margin-top: 15px;
}

/* Enhanced List Table Styling */
/* Enhanced List Table Styling moved to tickets-list.css */

/* Responsive Compact Search */
@media (max-width: 768px) {
    .admin-compact-search {
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .admin-compact-search-box {
        max-width: 100%;
        min-width: 250px;
    }
    
    .admin-compact-search-input {
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .admin-compact-search-box {
        min-width: 200px;
    }
    
    .admin-compact-search-input {
        min-width: 150px;
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .admin-compact-search-btn {
        padding: 6px 10px;
        min-width: 35px;
    }
    
    .admin-compact-search-btn .dashicons {
        font-size: 12px;
        width: 12px;
        height: 12px;
    }
}

/* Admin Filter Buttons */
.alignleft.actions .button {
    margin-right: 5px;
}

.alignleft.actions .button:last-child {
    margin-right: 0;
}

.alignleft.actions .button-secondary {
    background: #f7f7f7;
    border-color: #ccc;
    color: #555;
}

.alignleft.actions .button-secondary:hover {
    background: #f1f1f1;
    border-color: #999;
    color: #23282d;
}

/* Screen Options Column Preferences */
#screen-options-wrap .metabox-prefs h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #23282d;
}

#screen-options-wrap .metabox-prefs label {
    display: block;
    margin: 5px 0;
    font-size: 13px;
    line-height: 1.4;
}

#screen-options-wrap .metabox-prefs input[type="checkbox"] {
    margin-right: 8px;
}

#screen-options-wrap .metabox-prefs label:hover {
    color: #0073aa;
}

/* Column visibility states moved to tickets-list.css */

/* Ensure proper spacing in screen options */
#screen-options-wrap .metabox-prefs {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

#screen-options-wrap .metabox-prefs:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Force horizontal layout for column options */
#screen-options-wrap .metabox-prefs .column-prefs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#screen-options-wrap .metabox-prefs .column-prefs label {
    flex: 0 0 auto;
    margin: 2px 10px 2px 0;
    white-space: nowrap;
}

/* Admin Rating System */
.reply-rating-display {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.rating-stars-display {
    display: flex;
    gap: 2px;
}

.rating-stars-display .star {
    font-size: 16px;
    color: #ddd;
}

.rating-stars-display .star.filled {
    color: #ffd700;
}

.reply-rating-display .rating-info {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.reply-rating-display .average-rating {
    font-weight: 600;
    color: #333;
}

.reply-rating-display .total-ratings {
    color: #999;
}

/* Rating Display in Tickets List */
.rating-display {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #666;
}

.rating-display .rating-value {
    font-weight: 600;
    color: #333;
}

.rating-display.no-rating {
    color: #999;
    font-style: italic;
}

/* Rating Stars */
.rating-display {
    color: #ffd700;
    letter-spacing: 1px;
}

.no-ratings {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

/* =======================
   EMAIL TEMPLATE STYLES
   ======================= */

.email-template-section {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    position: relative;
}

.email-template-section h4 {
    margin: 0 0 10px 0;
    color: #007cba;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #007cba;
    padding-bottom: 8px;
}

.template-description {
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
    font-size: 14px;
}

.email-template-section .form-table {
    margin-top: 20px;
}

.email-template-section .form-table th {
    width: 150px;
    padding: 15px 10px 15px 0;
    vertical-align: top;
}

.email-template-section .form-table td {
    padding: 15px 0;
}

.email-template-section .form-table input[type="text"] {
    width: 100%;
    max-width: 500px;
}

.email-template-section .form-table label {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 5px;
}

.email-template-section .form-table input[type="checkbox"] {
    margin-right: 8px;
}

.template-tags-documentation {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 20px;
}

.template-tags-documentation th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.template-tags-documentation td {
    padding: 15px;
    line-height: 1.6;
}

.template-tags-documentation code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #d73a49;
}

/* Template section states */
.email-template-section.enabled {
    border-left: 4px solid #00a32a;
}

.email-template-section.disabled {
    border-left: 4px solid #d63638;
    opacity: 0.7;
}

.email-template-section.disabled h4 {
    color: #666;
    border-bottom-color: #666;
}

/* WordPress editor customization for email templates */
.email-template-section .wp-editor-container {
    border: 1px solid #ddd;
    border-radius: 4px;
}

.email-template-section .wp-editor-area {
    min-height: 200px;
}

.email-template-section .wp-editor-tools {
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 8px;
}

/* Template tag insertion buttons */
.template-tag-buttons {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.template-tag-button {
    display: inline-block;
    margin: 2px;
    padding: 4px 8px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
}

.template-tag-button:hover {
    background: #005a87;
    color: #fff;
}

/* Responsive design for email templates */
@media (max-width: 768px) {
    .email-template-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .email-template-section h4 {
        font-size: 16px;
    }
    
    .email-template-section .form-table th {
        width: auto;
        display: block;
        padding: 10px 0 5px 0;
    }
    
    .email-template-section .form-table td {
        padding: 5px 0 15px 0;
    }
    
    .email-template-section .form-table input[type="text"] {
        max-width: 100%;
    }
    
    .template-tags-documentation {
        font-size: 14px;
    }
    
    .template-tags-documentation td {
        padding: 10px;
    }
}

/* Assign Dialog Styles */
#assign-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.assign-dialog-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    position: relative;
}

.assign-dialog-content h3 {
    margin: 0 0 20px 0;
    color: #23282d;
    font-size: 18px;
    font-weight: 600;
}

#assign-agent-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 20px;
}

.assign-dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.assign-dialog-buttons .button {
    min-width: 80px;
}

/* Bulk action count indicator */
.bulk-action-count {
    font-weight: bold;
    color: #0073aa;
}

/* AJAX Bulk Actions */
.bulk-action-processing {
    opacity: 0.6;
    pointer-events: none;
}

.bulk-action-processing .button {
    background: #ccc !important;
    color: #666 !important;
}

/* Notice positioning for bulk actions */
.wrap .notice {
    margin: 15px 0;
}

/* Loading indicator for bulk actions */
.bulk-action-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* style of support page */

/* Smart Support Support Page Styles */
.smart-support-support-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.support-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.support-title {
    font-size: 2.5em;
    font-weight: 300;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.support-title .dashicons {
    font-size: 1.2em;
    width: auto;
    height: auto;
}

.support-subtitle {
    font-size: 1.1em;
    margin: 0;
    opacity: 0.9;
    font-weight: 300;
}

/* Content Layout */
.support-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.support-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Card Styles */
.support-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e1e5e9;
    overflow: hidden;
    transition: all 0.3s ease;
}

.support-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px 30px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    align-items: center;
    gap: 15px;
}

.card-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.card-icon .dashicons {
    font-size: 24px;
    width: auto;
    height: auto;
}

.card-header h2 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    color: #2c3e50;
}

.card-content {
    padding: 30px;
}

/* Shortcode Styles */
.shortcode-item {
    margin-bottom: 30px;
}

.shortcode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.shortcode-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
}

.shortcode-header code {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1em;
    color: #e74c3c;
    border: 1px solid #e1e5e9;
}

.shortcode-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
}

.shortcode-description {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 20px;
}

.shortcode-usage h4,
.shortcode-features h4 {
    font-size: 1em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.code-block {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.code-block code {
    background: none;
    border: none;
    padding: 0;
    color: #495057;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.copy-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-button:hover {
    background: #495057;
}

.copy-button .dashicons {
    font-size: 16px;
    width: auto;
    height: auto;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #495057;
}

.feature-list .dashicons {
    color: #28a745;
    font-size: 18px;
    width: auto;
    height: auto;
}

/* Roles Styles */
.roles-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.role-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e1e5e9;
}

.role-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.role-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

.role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    color: white;
}

.role-badge.agent {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.role-badge.supervisor {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.role-badge.customer {
    background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%);
}

.role-permissions {
    list-style: none;
    padding: 0;
    margin: 0;
}

.role-permissions li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    color: #495057;
}

.role-permissions .dashicons {
    color: #28a745;
    font-size: 16px;
    width: auto;
    height: auto;
}

/* Contact Section */
.support-contact {
    margin-top: 20px;
}

.contact-card {
    text-align: center;
}

.contact-description {
    font-size: 1.1em;
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.6;
}

.contact-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.contact-button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.contact-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.contact-button.secondary {
    background: white;
    color: #495057;
    border-color: #e1e5e9;
}

.contact-button.secondary:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.contact-button .dashicons {
    font-size: 18px;
    width: auto;
    height: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .support-grid {
        grid-template-columns: 1fr;
    }
    
    .support-title {
        font-size: 2em;
    }
    
    .card-header {
        padding: 20px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .contact-options {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-button {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .smart-support-support-page {
        padding: 10px;
    }
    
    .support-header {
        padding: 20px 0;
    }
    
    .support-title {
        font-size: 1.8em;
        flex-direction: column;
        gap: 10px;
    }
    
    .card-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .shortcode-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .code-block {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* =======================
   TICKET REPLY NOTIFICATIONS
   ======================= */

.smart-support-notifications {
    margin: 20px 0;
    padding: 20px;
    border-left: 4px solid #0073aa;
    background: #f8f9fa;
}

.smart-support-notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.smart-support-notifications-header h3 {
    margin: 0;
    color: #0073aa;
    font-size: 16px;
    font-weight: 600;
}

.smart-support-mark-all-read {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.smart-support-mark-all-read:hover {
    background: #005a87;
}

.smart-support-notifications-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.smart-support-notification-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.smart-support-notification-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.1);
}

.notification-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.notification-content strong {
    color: #0073aa;
    font-weight: 600;
}

.notification-content a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.notification-content a:hover {
    text-decoration: underline;
}

.notification-time {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.notification-actions {
    display: flex;
    gap: 8px;
}

.smart-support-mark-read {
    background: #f0f0f1;
    color: #50575e;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.smart-support-mark-read:hover {
    background: #e5e5e5;
    border-color: #999;
}

/* Responsive design for notifications */
@media (max-width: 768px) {
    .smart-support-notifications-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .smart-support-notification-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .notification-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .notification-actions {
        align-self: flex-end;
    }
}

/* =======================
   WAITING ICON STYLES
   ======================= */

.waiting-icon {
    display: inline-block;
    vertical-align: middle;
    animation: pulse-waiting 2s infinite;
}

@keyframes pulse-waiting {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hover effect for waiting icon */
.waiting-icon:hover {
    animation-play-state: paused;
    transform: scale(1.2);
}

/* Waiting icon styles moved to tickets-list.css */

/* =======================
   INLINE FILTERS LAYOUT
   ======================= */
#smart-support-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

#smart-support-filters select,
#smart-support-filters .filter-search,
#smart-support-filters .button,
#smart-support-filters input[type="text"],
#smart-support-filters input[type="search"] {
    margin: 0;
    flex: 1 1 160px;
    min-width: 150px;
    max-width: 100%;
}

#smart-support-filters select {
    min-width: 150px;
}

#smart-support-filters .filter-search {
    min-width: 180px;
}

#smart-support-filters .button {
    flex: 0 1 auto;
    min-width: auto;
    white-space: nowrap;
}

/* Ensure form container doesn't overflow */
.alignleft.actions {
    overflow: visible;
    width: 100%;
}

/* Prevent horizontal scrolling on smaller screens */
@media (max-width: 1200px) {
    #smart-support-filters select,
    #smart-support-filters input[type="text"],
    #smart-support-filters input[type="search"] {
        flex: 1 1 150px;
        min-width: 150px;
    }
}

@media (max-width: 782px) {
    #smart-support-filters {
        gap: 8px;
    }
    
    #smart-support-filters select,
    #smart-support-filters input[type="text"],
    #smart-support-filters input[type="search"] {
        flex: 1 1 100%;
        min-width: 100%;
        max-width: 100%;
    }
    
    #smart-support-filters .button {
        flex: 1 1 auto;
        min-width: auto;
    }
}

/* Searchable select dropdown styles */
.ss-searchable-select {
    position: relative;
    min-width: 200px;
    width: 200px;
}
.ss-select-toggle {
    display: inline-block;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #8c8f94;
    border-radius: 2px;
    min-height: 30px;
    cursor: pointer;
    width: 100%;
    text-align: left;
}
.ss-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    z-index: 10000;
    display: none;
}
.ss-select-search {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #e2e4e7;
    padding: 6px 8px;
    outline: none;
}
.ss-select-options {
    max-height: 260px;
    overflow: auto;
}
.ss-select-option {
    padding: 6px 8px;
    cursor: pointer;
}
.ss-select-option:hover,
.ss-select-option.selected {
    background: #f0f0f1;
}

/* =======================
   INTERNAL NOTE MODAL
   ======================= */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e5e5e5;
    color: #333;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body .form-field {
    margin-bottom: 20px;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #23282d;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.modal-actions .button {
    min-width: 100px;
}



/* Modal Animation */
.modal-backdrop {
    animation: fadeIn 0.3s ease;
}

.modal-content {
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .button {
        width: 100%;
        justify-content: center;
    }
}

/* Prevent body scrolling when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Ensure modal is always on top */
#internal-note-modal {
    z-index: 100001;
}

/* Filter form styling */
.alignleft.actions form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    width: 100%;
    overflow: visible;
}

.alignleft.actions form select {
    flex: 1 1 160px;
    min-width: 150px;
    max-width: 100%;
}

.alignleft.actions form input[type="text"],
.alignleft.actions form input[type="search"] {
    flex: 1 1 180px;
    min-width: 150px;
    max-width: 100%;
}

.alignleft.actions form .button {
    margin: 0;
    flex: 0 1 auto;
    min-width: auto;
    white-space: nowrap;
}

/* Ensure filters are visible on mobile */
@media (max-width: 782px) {
    .alignleft.actions form {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    
    .alignleft.actions form select,
    .alignleft.actions form input[type="text"],
    .alignleft.actions form input[type="search"] {
        flex: 1 1 100%;
        min-width: 100%;
        max-width: 100%;
        margin-bottom: 0;
    }
    
    .alignleft.actions form .button {
        flex: 1 1 auto;
        min-width: auto;
        margin-bottom: 0;
    }
}

#screen-options-wrap .metabox-prefs label:hover {
    background: #f0f0f0;
    border-color: #0073aa;
}

#screen-options-wrap .metabox-prefs label.selected {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

#screen-options-wrap .metabox-prefs input[type="checkbox"] {
    margin-right: 8px;
}

#screen-options-wrap .metabox-prefs .column-prefs label:hover {
    background: #f0f0f0;
    border-color: #0073aa;
    color: #0073aa;
}

#screen-options-wrap .metabox-prefs .column-prefs label.selected {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* =======================
   CUSTOM MENU ICON STYLES
   ======================= */



/* =======================
   SHORTCODE INFO SECTION STYLES
   ======================= */

.shortcode-info-section {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.shortcode-info-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 600;
}

.shortcode-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.shortcode-code {
    background: #2c3e50;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    font-weight: 600;
}

.copy-shortcode-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-shortcode-button:hover {
    background: #005a87;
}

.copy-shortcode-button.copied {
    background: #28a745 !important;
}

.copy-shortcode-button .dashicons {
    font-size: 12px;
    width: auto;
    height: auto;
}

.shortcode-description {
    font-size: 0.95em;
    line-height: 1.4;
    color: #6c757d;
    flex: 1;
    min-width: 300px;
}



/* =======================
   ADD-ONS SUBMENU STYLES
   ======================= */

/* Add-ons submenu item styling */
#adminmenu .wp-submenu a[href*="smart-support-addons"] {
    color: #ff6b35 !important;
    font-weight: 600;
}


/* =======================
   ADD-ONS PAGE STYLES
   ======================= */

.smart-support-addons-page {
    max-width: 1200px;
    margin: 0 auto;
}

.addons-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 15px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.addons-title {
    font-size: 1.8em;
    margin: 0 0 8px 0;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.addons-title .dashicons {
    font-size: 1.2em;
    width: auto;
    height: auto;
}

.addons-subtitle {
    font-size: 1em;
    margin: 0;
    opacity: 0.9;
    font-weight: 300;
}

.addons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.addon-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.addon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #0073aa;
}

.addon-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-bottom: 1px solid #e1e5e9;
    position: relative;
}

.addon-icon {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    margin-bottom: 10px;
}

.addon-icon .dashicons {
    font-size: 20px;
    width: auto;
    height: auto;
    color: white;
}

.addon-header h2 {
    margin: 0 0 8px 0;
    font-size: 1.3em;
    color: #2c3e50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.addon-badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.addon-badge.free-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* Free Tag Styles */
.free-tag {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 3px 6px rgba(220, 53, 69, 0.3);
    border: 2px solid #fff;
}

.free-tag::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    border: 1px solid #ddd;
}

.free-tag::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 8px;
    background: #333;
    border-radius: 1px;
}

.free-tag-text {
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transform: rotate(-15deg);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}



.addon-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.addon-description {
    font-size: 0.95em;
    line-height: 1.5;
    color: #6c757d;
    margin-bottom: 15px;
    font-weight: 400;
}

.addon-features,
.addon-benefits {
    margin-bottom: 15px;
}

.addon-features h4,
.addon-benefits h4 {
    color: #2c3e50;
    font-size: 1em;
    margin: 0 0 10px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.feature-list,
.benefit-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.feature-list li,
.benefit-list li {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 0;
    line-height: 1.4;
    color: #495057;
}

.feature-list .dashicons,
.benefit-list .dashicons {
    color: #28a745;
    font-size: 14px;
    width: auto;
    height: auto;
    margin-top: 1px;
    flex-shrink: 0;
}

.benefit-list .dashicons {
    color: #ffc107;
}

.addon-cta {
    text-align: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.get-now-button {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%) !important;
    border: none !important;
    color: white !important;
    padding: 8px 20px !important;
    font-size: 0.95em !important;
    font-weight: 600 !important;
    border-radius: 20px !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3) !important;
}

.get-now-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004a73 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4) !important;
    color: white !important;
}

.get-now-button .dashicons {
    font-size: 14px;
    width: auto;
    height: auto;
}

.addons-cta-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    border: 1px solid #e1e5e9;
}

.cta-content h2 {
    color: #2c3e50;
    font-size: 1.5em;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.cta-content p {
    font-size: 1em;
    color: #6c757d;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .button {
    padding: 10px 20px !important;
    font-size: 0.95em !important;
    font-weight: 600 !important;
    border-radius: 20px !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.cta-buttons .button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

.cta-buttons .button-secondary {
    background: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

.cta-buttons .button-secondary:hover {
    background: #5a6268 !important;
    border-color: #5a6268 !important;
}

.cta-buttons .button-primary {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%) !important;
    border: none !important;
    color: white !important;
}

.cta-buttons .button-primary:hover {
    background: linear-gradient(135deg, #005a87 0%, #004a73 100%) !important;
}

.cta-buttons .dashicons {
    font-size: 14px;
    width: auto;
    height: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .addons-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .addon-card {
        margin: 0 10px;
    }
    
    .addons-header {
        margin: 0 10px 30px 10px;
        padding: 10px 15px;
    }
    
    .addons-title {
        font-size: 1.5em;
        flex-direction: column;
        gap: 10px;
    }
    
    .addon-header {
        padding: 12px;
    }
    
    .addon-content {
        padding: 12px;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }
    
    .addons-cta-section {
        margin: 0 10px;
        padding: 20px 15px;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .button {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .addons-title {
        font-size: 1.4em;
    }
    
    .addon-header h2 {
        font-size: 1.5em;
    }
    
    .cta-content h2 {
        font-size: 1.6em;
    }
    
    .addon-description {
        font-size: 1em;
    }
}

/* Email Templates List Styles */
.email-templates-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.email-template-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.email-template-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.template-info h4 {
    margin: 0 0 8px 0;
    color: #23282d;
    font-size: 16px;
}

.template-description {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.template-status {
    margin-bottom: 15px;
}

.status-indicator {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-indicator.enabled {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-indicator.disabled {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.template-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.template-actions .button {
    flex: 1;
    text-align: center;
}

/* Email Template Modal Styles */
.email-template-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 95vw;
    width: auto;
    min-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    border: 1px solid #e1e1e1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #23282d;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 300;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
    transform: scale(1.1);
}

.modal-body {
    padding: 20px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

/* TinyMCE Editor Fixes for Modals */
.email-template-modal .wp-editor-wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 10px;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.email-template-modal .wp-editor-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.email-template-modal .mce-tinymce {
    width: 100% !important;
    max-width: 100% !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    margin: 0 !important;
}

.email-template-modal .mce-edit-area {
    width: 100% !important;
    max-width: none !important;
    min-height: 300px !important;
    max-height: 600px !important;
    min-width: 800px !important;
}

.email-template-modal .mce-tinymce .mce-container-body {
    width: 100% !important;
    max-width: 100% !important;
}


/* TinyMCE Toolbar adjustments for modal */
.email-template-modal .mce-toolbar {
    border-bottom: 1px solid #ddd !important;
    background: #f8f9fa !important;
    width: 100% !important;
    padding: 8px !important;
}

.email-template-modal .mce-toolbar .mce-btn {
    border-radius: 3px !important;
}

/* Enhanced content editor visibility and positioning */
.email-template-modal .mce-edit-area iframe {
    width: 100% !important;
    min-height: 300px !important;
    max-height: 600px !important;
    min-width: 800px !important;
}

/* Ensure proper spacing around content editor */
.email-template-modal .template-editor-container {
    margin: 10px 0 !important;
    padding: 0 !important;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Content editor label styling */
.email-template-modal .form-table tr:has(.template-editor-container) th {
    background: #f8f9fa;
    padding: 12px 15px !important;
    margin: 0 !important;
    border-bottom: 1px solid #e1e1e1;
    border-radius: 6px 6px 0 0;
    font-weight: 600 !important;
    color: #23282d !important;
}

/* Modal Form Table Improvements */
.email-template-modal .form-table {
    margin: 0;
    width: 100%;
    border-collapse: collapse;
}

.email-template-modal .form-table th {
    width: 20%;
    padding: 6px 15px 6px 0;
    vertical-align: top;
    font-weight: 600;
    color: #23282d;
    font-size: 14px;
}

.email-template-modal .form-table td {
    padding: 6px 0;
    width: 80%;
}

/* Special styling for content editor row - give it maximum space */
.email-template-modal .form-table tr:has(.wp-editor-wrap) th {
    width: 10%;
    vertical-align: top;
    padding-top: 10px;
}

.email-template-modal .form-table tr:has(.wp-editor-wrap) td {
    width: 90%;
    min-width: 800px;
}

.email-template-modal .form-table tr {
    border-bottom: 1px solid #f0f0f0;
    min-height: 40px;
}

.email-template-modal .form-table tr:last-child {
    border-bottom: none;
}

/* Reduce spacing between form rows */
.email-template-modal .form-table tr + tr {
    margin-top: 0;
}

.email-template-modal .form-table input[type="text"],
.email-template-modal .form-table input[type="email"],
.email-template-modal .form-table .large-text {
    width: 100%;
    max-width: 100%;
    height: 32px;
    padding: 6px 10px;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.email-template-modal .form-table .regular-text {
    width: 100%;
    max-width: 300px;
    height: 32px;
    padding: 6px 10px;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Textarea fields - more compact */
.email-template-modal .form-table textarea {
    width: 100%;
    max-width: 100%;
    min-height: 60px;
    max-height: 120px;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    resize: vertical;
    font-family: inherit;
}

/* Select fields - more compact */
.email-template-modal .form-table select {
    width: 100%;
    max-width: 100%;
    height: 32px;
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #fff;
}

/* Modal Content Improvements */
.email-template-modal .modal-body {
    padding: 15px 20px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

/* Give more space to content editor in modal body */
.email-template-modal .modal-body .form-table {
    margin-bottom: 20px;
}

/* Ensure content editor gets maximum available space */
.email-template-modal .modal-body .form-table tr:has(.template-editor-container) {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e1e1;
}

.email-template-modal .modal-header {
    padding: 15px 25px;
    border-bottom: 1px solid #e1e1e1;
    background: #fafafa;
    border-radius: 8px 8px 0 0;
}

.email-template-modal .modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
    margin: 0;
}

.email-template-modal .modal-actions {
    padding: 15px 25px;
    margin-top: 0;
    border-top: 1px solid #e1e1e1;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
}

/* Description Text Improvements */
.email-template-modal .description {
    font-size: 12px;
    color: #666;
    margin: 4px 0 0 0;
    line-height: 1.3;
    font-style: italic;
}

/* Checkbox and Label Improvements */
.email-template-modal label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #23282d;
    font-size: 14px;
}

.email-template-modal input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
    vertical-align: top;
}

/* Focus states for better UX */
.email-template-modal .form-table input:focus,
.email-template-modal .form-table textarea:focus,
.email-template-modal .form-table select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

/* Template Editor Container */
.template-editor-container {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Content editor specific improvements */
.email-template-modal .template-editor-container .wp-editor-wrap {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}


.template-tags-button-container {
    margin-top: 8px;
    text-align: right;
}

.template-tags-btn {
    background: #f7f7f7;
    border: 1px solid #ddd;
    color: #555;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-tags-btn:hover {
    background: #e1e1e1;
    border-color: #999;
    color: #333;
}

.template-tags-btn .dashicons {
    font-size: 14px;
    margin-right: 4px;
    vertical-align: middle;
}

/* Responsive Modal Design */
@media (max-width: 1400px) {
    .modal-content {
        max-width: 95vw;
        margin: 10px;
        min-width: 900px;
    }
}

@media (max-width: 1000px) {
    .modal-content {
        max-width: 98vw;
        margin: 5px;
        min-width: 95vw;
        max-height: 95vh;
    }
    
    .email-template-modal .form-table tr:has(.wp-editor-wrap) td {
        min-width: 600px;
    }
    
    .email-template-modal .mce-edit-area {
        min-width: 600px !important;
    }
    
    .email-template-modal .mce-edit-area iframe {
        min-width: 600px !important;
    }
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 98vw;
        margin: 5px;
        min-width: 95vw;
        max-height: 95vh;
    }
    
    .email-template-modal .form-table th {
        width: 100%;
        display: block;
        padding: 8px 0 4px 0;
    }
    
    .email-template-modal .form-table td {
        width: 100%;
        display: block;
        padding: 0 0 12px 0;
        min-width: auto;
    }
    
    .email-template-modal .mce-edit-area {
        min-width: 100% !important;
    }
    
    .email-template-modal .mce-edit-area iframe {
        min-width: 100% !important;
    }
    
    .email-template-modal .modal-body {
        padding: 10px 15px;
    }
    
    .email-template-modal .modal-header {
        padding: 12px 15px;
    }
    
    .email-template-modal .modal-actions {
        padding: 12px 15px;
        flex-direction: column;
        gap: 8px;
    }
    
    .email-template-modal .modal-actions .button {
        width: 100%;
        text-align: center;
    }
}

/* Template Tags Popup */
.template-tags-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.template-tags-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    border: 1px solid #e1e1e1;
}

.template-tags-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e1e1;
    background: #fafafa;
}

.template-tags-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
}

.template-tags-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.template-tags-close:hover {
    background: #f0f0f0;
    color: #333;
}

.template-tags-body {
    padding: 20px;
    max-height: calc(80vh - 120px);
    overflow-y: auto;
}

.template-tags-search {
    margin-bottom: 15px;
}

.template-tags-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.template-tags-list {
    max-height: 400px;
    overflow-y: auto;
}

.template-tag-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.template-tag-item:hover {
    background: #e8f4fd;
    border-color: #0073aa;
    transform: translateX(2px);
}

.template-tag-item code {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #d63384;
    margin-right: 12px;
    min-width: 120px;
    text-align: center;
}

.tag-description {
    color: #666;
    font-size: 13px;
    flex: 1;
}

/* Search functionality */
.template-tag-item.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .email-templates-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .email-template-card {
        padding: 15px;
    }
    
    .template-actions {
        flex-direction: column;
    }
    
    .template-actions .button {
        width: 100%;
    }
    
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .modal-body {
        max-height: calc(100vh - 160px);
        padding: 20px;
    }
    
    .email-template-modal .form-table th {
        width: 100%;
        display: block;
        padding-bottom: 5px;
    }
    
    .email-template-modal .form-table td {
        width: 100%;
        display: block;
        padding-top: 0;
    }
}

/* Reply and Close button hover effect */
.reply-close-btn:hover {
    background-color: #dc3232 !important;
    border-color: #dc3232 !important;
    color: #ffffff !important;
    transition: all 0.2s ease-in-out;
}

/* Ticket/Reply activity history */
.smart-support-history-block {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed #dcdcde;
}

.smart-support-history-block h4,
.smart-support-history-block h5 {
    margin: 0 0 8px;
    font-size: 12px;
    color: #646970;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.smart-support-history-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.smart-support-history-item {
    margin: 0 0 4px;
    color: #646970;
    font-size: 11px;
    line-height: 1.45;
}

.smart-support-history-empty {
    color: #8c8f94;
    font-size: 11px;
}

.smart-support-history-pagination {
    margin-top: 8px;
    display: flex;
    gap: 6px;
}