/**
 * All of the CSS for your admin-specific functionality should be
 * included in this file.
 */
 /* Style the tab */
.tab {
    overflow: hidden;
    border: 1px solid #ccc;
    background-color: #f1f1f1;
}

/* Style the buttons that are used to open the tab content */
.tab button {
  background-color: inherit;
  float: left;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 14px 16px;
  transition: 0.3s;
}

/* Change background color of buttons on hover */
.tab button:hover {
  background-color: #ddd;
}

/* Create an active/current tablink class */
.tab button.active {
  background-color: #ccc;
}

/* Style the tab content */
.tabcontent {
  display: none;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-top: none;
}

  /* The Modal (background) */
  .cockpit-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place relative to the viewport */
    z-index: 1; /* Sit on top */
    left: 50%; /* Center horizontally */
    top: 50%; /* Center vertically */
    transform: translate(-43%, -65%); /* Offset by 50% to truly center */
    width: 75%; /* 90% of viewport width */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    overflow: auto; /* Enable scroll if needed */
  }

/* Modal Content */
.cockpit-modal-content {
  background-color: #ffffff;
  border: 7px solid #3a3838;
}
.responsive-image {
  max-width: 95%;
  max-height: 300px;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
}
/* The Close Button */
.close {
  color: #fc0909;
  float: right;
  font-size: 40px;
  font-weight: bold;
  padding:10px;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

.video_grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(390px, 390px));
  grid-gap: 20px;
  justify-content: center;
  justify-items: center;
}

@media screen and (max-width: 768px) {
  .video_grid {
    grid-template-columns: minmax(280px, 390px) !important;
  }
}

.video_grid div {
  width: 100%;
  background: white;
  font-size: 14pt !important;
}

@media (max-width: 400px) {
  .video_grid {
    grid-template-columns: 1fr !important;
  }
}

/* G-FFL Cockpit Toggle Switch Styles */
.g-ffl-cockpit-toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.g-ffl-cockpit-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.g-ffl-cockpit-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.g-ffl-cockpit-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.g-ffl-cockpit-toggle-switch input:checked + .g-ffl-cockpit-slider {
  background-color: #007cba;
}

.g-ffl-cockpit-toggle-switch input:checked + .g-ffl-cockpit-slider:before {
  transform: translateX(26px);
}

/* Logs table: never wrap timestamps */
#logs #log_table .gridjs-table th:first-child,
#logs #log_table .gridjs-table td:first-child {
    white-space: nowrap;
}

/* Hide WordPress admin notices in G-FFL Cockpit Product Search */
#product_feed .notice,
#product_feed .update-nag,
#product_feed .error,
#product_feed .updated,
#product_feed .notice-error,
#product_feed .notice-warning,
#product_feed .notice-success,
#product_feed .notice-info,
.g-ffl-cockpit-product-search-container ~ .notice,
.g-ffl-cockpit-product-search-container ~ .update-nag,
.g-ffl-cockpit-product-search-container ~ .error,
.g-ffl-cockpit-product-search-container ~ .updated {
  display: none !important;
}

/* G-FFL Cockpit Single UPC Dashboard Styles */
.g-ffl-cockpit-single-upc-header {
  animation: g-ffl-cockpit-fadeInDown 0.6s ease-out;
  isolation: isolate;
  position: relative;
  z-index: 1;
}

.g-ffl-cockpit-single-upc-header * {
  box-sizing: border-box;
}

/* Prevent WordPress admin notices from appearing in G-FFL Cockpit dashboard */
#g_ffl_cockpit_single_upc_dashboard .notice,
#g_ffl_cockpit_single_upc_dashboard .update-nag,
#g_ffl_cockpit_single_upc_dashboard .error,
#g_ffl_cockpit_single_upc_dashboard .updated {
  display: none !important;
}

/* Reset any inherited styles in G-FFL Cockpit dashboard header */
#g_ffl_cockpit_dashboard_product_name,
#g_ffl_cockpit_dashboard_product_details {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

#g_ffl_cockpit_dashboard_product_name::before,
#g_ffl_cockpit_dashboard_product_name::after,
#g_ffl_cockpit_dashboard_product_details::before,
#g_ffl_cockpit_dashboard_product_details::after {
  content: none !important;
  display: none !important;
}

.g-ffl-cockpit-price-comparison-section,
.g-ffl-cockpit-detailed-comparison-section {
  animation: g-ffl-cockpit-fadeInUp 0.6s ease-out;
}

#g_ffl_cockpit_distributor_cards_container > div {
  animation: g-ffl-cockpit-fadeInScale 0.6s ease-out;
  animation-fill-mode: both;
}

#g_ffl_cockpit_distributor_cards_container > div:nth-child(1) { animation-delay: 0.1s; }
#g_ffl_cockpit_distributor_cards_container > div:nth-child(2) { animation-delay: 0.2s; }
#g_ffl_cockpit_distributor_cards_container > div:nth-child(3) { animation-delay: 0.3s; }
#g_ffl_cockpit_distributor_cards_container > div:nth-child(4) { animation-delay: 0.4s; }

@keyframes g-ffl-cockpit-fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes g-ffl-cockpit-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes g-ffl-cockpit-fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.g-ffl-cockpit-btn {
  display: inline-block;
  padding: 10px 20px;
  margin: 5px;
  text-decoration: none;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.g-ffl-cockpit-btn-primary {
  background-color: #007cba;
  color: white;
}

.g-ffl-cockpit-btn-primary:hover {
  background-color: #005a87;
}

.g-ffl-cockpit-btn-secondary {
  background-color: #6c757d;
  color: white;
}

.g-ffl-cockpit-btn-secondary:hover {
  background-color: #545b62;
}

/* G-FFL Cockpit UPC Diagnosis Widget Styles */
.g-ffl-cockpit-diagnosis-section {
  animation: g-ffl-cockpit-fadeInUp 0.6s ease-out;
}

.g-ffl-cockpit-diagnosis-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.g-ffl-cockpit-diagnosis-check-item.passed {
  border-left: 3px solid #10b981;
}

.g-ffl-cockpit-diagnosis-check-item.failed {
  border-left: 3px solid #ef4444;
  cursor: pointer;
}

.g-ffl-cockpit-diagnosis-check-item.failed:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

.g-ffl-cockpit-diagnosis-check-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.g-ffl-cockpit-diagnosis-check-icon.passed {
  background: #d1fae5;
  color: #059669;
}

.g-ffl-cockpit-diagnosis-check-icon.failed {
  background: #fee2e2;
  color: #dc2626;
}

.g-ffl-cockpit-diagnosis-check-icon.warning {
  background: #fef3c7;
  color: #d97706;
}

.g-ffl-cockpit-diagnosis-check-item.warning {
  background: #fffbeb;
  border-color: #fde68a;
}

.g-ffl-cockpit-diagnosis-check-content {
  flex: 1;
  min-width: 0;
}

.g-ffl-cockpit-diagnosis-check-name {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
  margin-bottom: 2px;
}

.g-ffl-cockpit-diagnosis-check-detail {
  font-size: 12px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.g-ffl-cockpit-diagnosis-check-arrow {
  color: #9ca3af;
  font-size: 12px;
  flex-shrink: 0;
}

.g-ffl-cockpit-diagnosis-recommendation {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 15px;
  background: white;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid #d1fae5;
}

.g-ffl-cockpit-diagnosis-recommendation:last-child {
  margin-bottom: 0;
}

.g-ffl-cockpit-diagnosis-recommendation-icon {
  width: 24px;
  height: 24px;
  background: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.g-ffl-cockpit-diagnosis-recommendation-icon i {
  color: white;
  font-size: 12px;
}

.g-ffl-cockpit-diagnosis-recommendation-content {
  flex: 1;
}

.g-ffl-cockpit-diagnosis-recommendation-action {
  font-weight: 600;
  color: #065f46;
  font-size: 14px;
  margin-bottom: 4px;
}

.g-ffl-cockpit-diagnosis-recommendation-location {
  font-size: 12px;
  color: #047857;
}

.g-ffl-cockpit-diagnosis-detail-restriction {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
}

.g-ffl-cockpit-diagnosis-detail-restriction:last-child {
  margin-bottom: 0;
}

.g-ffl-cockpit-diagnosis-detail-restriction-source {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #991b1b;
  font-weight: 600;
  margin-bottom: 4px;
}

.g-ffl-cockpit-diagnosis-detail-restriction-message {
  color: #7f1d1d;
  font-size: 14px;
}

#g_ffl_cockpit_diagnosis_toggle_btn:hover {
  background: #d97706 !important;
}

#g_ffl_cockpit_clear_errors_btn:hover {
  background: #b91c1c !important;
}

/* Responsive diagnosis widget */
@media (max-width: 768px) {
  .g-ffl-cockpit-diagnosis-section > div:first-child {
    flex-direction: column;
    text-align: center;
  }
  
  #g_ffl_cockpit_diagnosis_checks_grid {
    grid-template-columns: 1fr !important;
  }
  
  #g_ffl_cockpit_diagnosis_clear_errors > div {
    flex-direction: column;
    text-align: center;
    gap: 15px !important;
  }
  
  #g_ffl_cockpit_clear_errors_btn {
    width: 100%;
    justify-content: center;
  }
}

/* G-FFL Cockpit Responsive design for dashboard */
@media (max-width: 768px) {
  #g_ffl_cockpit_distributor_cards_container {
    grid-template-columns: 1fr !important;
  }
  
  .g-ffl-cockpit-single-upc-header > div > div {
    flex-direction: column !important;
    text-align: center;
    gap: 20px !important;
  }
  
  #g_ffl_cockpit_dashboard_product_image {
    margin-top: 0 !important;
    min-width: auto !important;
  }
  
  #g_ffl_cockpit_dashboard_product_details > div {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
    gap: 15px !important;
  }
  
  .g-ffl-cockpit-price-comparison-chart > div {
    flex-direction: column !important;
    height: auto !important;
  }
  
  .g-ffl-cockpit-detailed-comparison-section table {
    font-size: 12px;
  }
  
  .g-ffl-cockpit-detailed-comparison-section th,
  .g-ffl-cockpit-detailed-comparison-section td {
    padding: 8px !important;
  }
}

/* Needs Review Badge */
.needs-review-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    box-shadow: 0 2px 4px rgba(238, 90, 36, 0.2);
}

.needs-review-badge i {
    font-size: 11px;
}

/* Product Notes */
.product-header .product-notes {
    font-size: 11px;
    line-height: 1.2;
    margin: 4px 0 0 0;
    padding: 0;
}

.product-details-row {
    display: flex;
    gap: 15px;
    margin: 2px 0;
    flex-wrap: wrap;
}

.product-details-row span {
    font-size: 12px;
    line-height: 1.3;
    color: #333;
    white-space: nowrap;
}

.product-details-row span strong {
    font-weight: 600;
}

.product-notes strong {
    color: #007cba;
}

/* Test Summary Header Styles */
.test-summary-header {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    border: 1px solid #e9ecef;
    max-height: 120px;
    overflow-y: auto;
}

.metrics-header-row {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.metrics-section {
    flex: 1;
}

.metrics-section-title {
    margin: 0 0 8px 0;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 4px;
}

.metrics-cards {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.metrics-divider {
    width: 1px;
    height: 60px;
    background: #dee2e6;
    margin: 0 8px;
    flex-shrink: 0;
}

.compact-metrics-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.metric-divider {
    width: 1px;
    height: 30px;
    background: #dee2e6;
    margin: 0 4px;
    flex-shrink: 0;
}

.test-results-section,
.estimate-section {
    margin-bottom: 8px;
}

.test-results-section:last-child,
.estimate-section:last-child {
    margin-bottom: 0;
}

.test-results-section h3,
.estimate-section h3 {
    margin: 0 0 5px 0;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
    padding-bottom: 3px;
    border-bottom: 1px solid #dee2e6;
}

.test-results-section h3 i {
    color: #007cba;
}

.estimate-section h3 i {
    color: #28a745;
}

.test-metrics-row,
.estimate-metrics-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.g-ffl-metric-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px;
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: box-shadow 0.2s ease;
}

.g-ffl-metric-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.g-ffl-metric-card.blue {
    border-left: 4px solid #007cba;
}

.g-ffl-metric-card.green {
    border-left: 4px solid #46b450;
}

.g-ffl-metric-card.red {
    border-left: 4px solid #dc3232;
}

.metric-icon {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.g-ffl-metric-card.blue .metric-icon {
    background: #e3f2fd;
    color: #007cba;
}

.g-ffl-metric-card.green .metric-icon {
    background: #e8f5e9;
    color: #28a745;
}

.g-ffl-metric-card.red .metric-icon {
    background: #f8d7da;
    color: #dc3545;
}

.metric-content {
    flex: 1;
}

.metric-number {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1px;
    color: #333;
}

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

.estimate-disclaimer {
    margin-top: 6px;
    padding: 4px 8px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 3px;
    color: #856404;
    font-size: 9px;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.2;
}

.estimate-disclaimer i {
    margin-top: 2px;
    flex-shrink: 0;
}

/* Responsive design for metric cards */
@media (max-width: 768px) {
    .test-metrics-row,
    .estimate-metrics-row,
    .compact-metrics-row,
    .metrics-cards {
        flex-direction: column;
        gap: 6px;
    }
    
    .metrics-header-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .metrics-divider {
        display: none;
    }
    
    .g-ffl-metric-card {
        min-width: auto;
    }
    
    .metric-number {
        font-size: 12px;
    }
    
    .test-summary-header {
        padding: 8px;
        max-height: 100px;
    }
    
    .test-results-section h3,
    .estimate-section h3 {
        font-size: 11px;
    }
    
    .metric-divider {
        display: none;
    }
}

/* All Metrics Row - Consistent pill design */
.all-metrics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    justify-content: flex-start;
    align-items: stretch;
}

.metric-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 25px;
    min-width: 180px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex: 1;
    min-width: 0; /* Allow flex items to shrink */
}

.metric-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.metric-pill.blue {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.metric-pill.green {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.metric-pill i {
    font-size: 16px;
    opacity: 0.9;
    flex-shrink: 0;
}

.metric-number {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.metric-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.95;
    line-height: 1.2;
    flex: 1;
}

/* Responsive design for metric pills */
@media (max-width: 1200px) {
    .all-metrics-row {
        gap: 12px;
    }
    
    .metric-pill {
        min-width: 160px;
    }
    
    .metric-number {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .all-metrics-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .metric-pill {
        min-width: auto;
        justify-content: flex-start;
    }
    
    .metric-number {
        font-size: 18px;
    }
}

/* Estimated Stats Row Layout */
.estimate-stats-row {
    display: flex;
    gap: 40px;
    margin: 15px 0;
    align-items: center;
}

.estimate-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.estimate-label {
    font-weight: 600;
    color: #333;
}

.blue-text {
    color: #2196F3;
    font-weight: bold;
    font-size: 18px;
}

/* Green pill styling for tokens */
.green-pill {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Product Tab System */
.product-tabs-container {
    margin-top: 20px;
}

.tabs-header {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e1e5e9;
    padding-bottom: 10px;
}

.product-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    min-width: 120px;
    border-bottom: 2px solid transparent;
}

.product-tab:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.product-tab.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
    border-bottom-color: #007cba;
    font-weight: 600;
}

.product-tab img {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    object-fit: cover;
}

.tab-content-container {
    min-height: 300px;
}

.tab-content-item {
    display: none;
    padding: 20px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0 6px 6px 6px;
    min-height: 250px;
}

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

/* Summary tab specific styling */
.summary-tab {
    background: linear-gradient(135deg, #2196F3, #1976D2) !important;
    color: white !important;
    border-color: #2196F3 !important;
    font-weight: 600;
}

.summary-tab:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0) !important;
}

.summary-tab.active {
    background: linear-gradient(135deg, #1565C0, #0D47A1) !important;
    border-bottom-color: #1565C0 !important;
}

/* Responsive design for tabs */
@media (max-width: 768px) {
    .tabs-header {
        flex-direction: column;
    }
    
    .product-tab {
        width: 100%;
        justify-content: flex-start;
    }
    
    .tab-content-item {
        padding: 15px;
    }
}

/* Responsive design for summary stats */
@media (max-width: 768px) {
    .summary-stats-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .estimate-stats-row {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* Pulse animation for highlighted purchase link */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.pulse-highlight {
    animation: pulse 2s infinite;
    background: #dc3545 !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.pulse-highlight:hover {
    background: #c82333 !important;
    transform: scale(1.05) !important;
}

/* Product Groups Styles */
.product-groups-container {
    height: 100%;
    overflow-y: auto;
    width: 100%;
}

.product-group {
    margin-bottom: 15px;
    width: 100%;
}

.group-container {
    width: 100%;
    box-sizing: border-box;
}

.product-groups-container .group-container {
    width: 100% !important;
}

.group-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    margin-right: 8px;
    text-transform: uppercase;
}

.group-type-badge.include {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.group-type-badge.exclude {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.group-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.group-type-selector {
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    margin: 0;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.radio-custom.include {
    border-color: #28a745;
}

.radio-custom.exclude {
    border-color: #dc3545;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    background-color: currentColor;
}

.radio-label input[type="radio"]:checked + .radio-custom.include {
    background-color: #28a745;
    border-color: #28a745;
}

.radio-label input[type="radio"]:checked + .radio-custom.exclude {
    background-color: #dc3545;
    border-color: #dc3545;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: white;
}

/* Editable group name styles */
.group-name {
    padding: 2px 4px;
    border-radius: 3px;
}

.edit-group-name {
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.edit-group-name:hover {
    opacity: 1;
    color: #007bff !important;
}

.accordion-header:hover .edit-group-name {
    opacity: 0.8;
}

.cost-range-container {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.cost-range-inputs {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 10px;
    align-items: center;
}

.cost-range-inputs label {
    font-weight: 500;
    white-space: nowrap;
    margin: 0;
}

.cost-range-inputs input {
    width: 100%;
}

.empty-state {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    margin: 20px 0;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.4;
}

/* Legacy conversion notice styles */
#legacy-conversion-notice {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced group header styles */
.group-header {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 0;
}

.accordion-header {
    display: flex;
    align-items: center;
    flex: 1;
    font-weight: 600;
    color: #495057;
}

.accordion-content {
    width: 100%;
    box-sizing: border-box;
}

.accordion-toggle-icon {
    margin-right: 10px;
    transition: transform 0.2s ease;
    width: 12px;
    text-align: center;
}

.accordion-header[aria-expanded="true"] .accordion-toggle-icon {
    transform: rotate(90deg);
}

/* Improved button styles for product groups */
.btn-primary.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    background-color: #007cba;
    border-color: #007cba;
}

.btn-primary.btn-sm:hover {
    background-color: #005a87;
    border-color: #005a87;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
    background-color: transparent;
}

.btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Responsive adjustments for product groups */
@media (max-width: 768px) {
    .cost-range-inputs {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .group-type-selector {
        gap: 12px;
    }
    
    .radio-label {
        font-size: 13px;
    }
    
    .group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .group-actions {
        align-self: flex-end;
    }
}

/* AI Product Info: keep prompt row aligned on mobile (title left, actions right) */
@media (max-width: 768px) {
    #ai-prompt-container .group-header {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    #ai-prompt-container .accordion-header {
        min-width: 0;
    }

    #ai-prompt-container .group-actions {
        align-self: center;
        margin-left: auto;
    }
}

/* Main Product Restrictions Container Layout */
.main-container {
    display: flex;
    height: 100%;
    gap: 20px;
    min-height: 600px;
}

/* Product Restrictions: Product Groups wrapper shouldn't add an extra bordered card */
#product-restrictions #product-groups-section {
    border: none;
    padding: 0;
}

.left-container {
    flex: 1;
    min-width: 300px;
}

.right-container {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

#product-groups-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}

#product-groups-interface .other-restrictions-header {
    flex-shrink: 0;
    margin-bottom: 15px;
}

#product-groups-interface .product-groups-container {
    flex: 1;
    height: auto;
}

/* Email column formatting for GridJS */
.gffc-email-address {
    display: none;
}
.gffc-email-label {
    display: inline;
}

/* Ship Status Column Formatting */
.gffc-ship-status-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.gffc-tracking-link, .gffc-tracking-text {
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.gffc-tracking-link.status-delivered, .gffc-tracking-text.status-delivered { color: green; }
.gffc-tracking-link.status-return, .gffc-tracking-text.status-return { color: red; }
.gffc-tracking-link.status-transit, .gffc-tracking-text.status-transit { color: #2271b1; }

#fulfillment .gffc-hide-order-btn {
    cursor: pointer;
    color: #94a3b8;
    margin-left: 8px;
}
#fulfillment .gffc-hide-order-btn:hover {
    color: #d63638;
}
.gffc-hide-label {
    display: none; /* Hide label on desktop */
}

/* Tab Label Responsive Switching */
.gffc-tab-mobile {
    display: none;
}
.gffc-tab-desktop {
    display: inline;
}

@media screen and (max-width: 768px) {
    .gffc-tab-mobile {
        display: inline;
    }
    .gffc-tab-desktop {
        display: none;
    }

    /* Mobile Cart Layout */
    .gffc-cart-table thead {
        display: none;
    }

    .gffc-cart-table, .gffc-cart-table tbody {
        display: block;
        width: 100%;
    }

    .gffc-cart-row {
        display: flex;
        flex-wrap: wrap;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 12px;
        position: relative;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }

    .gffc-cart-dist {
        width: auto !important;
        border: none !important;
        padding: 0 !important;
        margin-bottom: 8px;
        order: 1;
    }

    .gffc-cart-actions {
        width: auto !important;
        border: none !important;
        padding: 0 !important;
        position: absolute;
        top: 12px;
        right: 12px;
        order: 2;
    }

    .gffc-cart-item {
        width: 100% !important;
        border: none !important;
        padding: 0 0 12px 0 !important;
        border-bottom: 1px solid #f1f5f9 !important;
        margin-bottom: 12px;
        order: 3;
    }

    .gffc-cart-price {
        width: 50% !important;
        border: none !important;
        padding: 0 !important;
        text-align: left !important;
        order: 4;
    }

    .gffc-cart-qty {
        width: 50% !important;
        border: none !important;
        padding: 0 !important;
        text-align: right !important;
        display: flex !important;
        flex-direction: column;
        align-items: flex-end;
        order: 5;
    }
    
    .gffc-cart-qty input {
        width: 60px !important;
        text-align: center;
    }

    /* FFL Selection Mobile Layout */
    .gffc-ffl-search-row {
        grid-template-columns: 1fr 1fr !important;
    }
    
    .gffc-ffl-search-row button {
        width: 100%;
    }
}

/* FFL Selection Grid Layouts (Desktop Default) */
.gffc-ffl-license-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
}

.gffc-ffl-search-row {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr 120px auto;
    gap: 10px;
    align-items: end;
}

/* Contact Column Styles */
.gffc-contact-cell {
    white-space: nowrap;
}
.gffc-mobile-icon {
    display: none;
}
.gffc-email-link {
    margin-left: 5px;
    text-decoration: none;
}
.gffc-email-link i {
    color: #94a3b8;
}
.gffc-email-link:hover i {
    color: #2271b1;
}
.gffc-email-text {
    display: none;
}

/* Mobile Contact Styles */
@media screen and (max-width: 768px) {
    .gffc-contact-cell {
        white-space: normal;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .gffc-phone-wrapper {
        display: flex;
        align-items: center;
    }
    .gffc-mobile-icon {
        display: inline-block;
        margin-right: 8px;
        color: #94a3b8;
        width: 16px;
    }
    .gffc-email-link {
        margin-left: 0;
        display: flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
    }
    .gffc-email-link i {
        color: #94a3b8;
        width: 16px;
    }
    .gffc-email-text {
        display: inline;
        color: #475569;
    }
}

/*
 * Main Cockpit navigation uses the tab strip on both desktop and mobile.
 * Accordion behavior is reserved for the Configuration sub-tabs only
 * (implemented via `.gffc-mobile-accordion-header` inside the Configuration panel).
 */
.accordion {
    display: none !important;
}

/* Product History Section Styles */
.g-ffl-cockpit-history-section {
    animation: g-ffl-cockpit-fadeInUp 0.6s ease-out;
}

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

.g-ffl-cockpit-view-btn {
    transition: all 0.2s ease;
}

.g-ffl-cockpit-view-btn:hover:not(.active) {
    background: #e8e8e8 !important;
}

.g-ffl-cockpit-view-btn.active {
    background: #0073aa !important;
    color: white !important;
}

/* History Table Styles */
.g-ffl-cockpit-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.g-ffl-cockpit-history-table th {
    background: #f8f9fa;
    padding: 10px 24px 10px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.g-ffl-cockpit-history-table th:hover {
    background: #e9ecef;
}

.g-ffl-cockpit-history-table th[data-sort]::after {
    content: '⇅';
    position: absolute;
    right: 12px;
    color: #bbb;
    font-size: 12px;
}

.g-ffl-cockpit-history-table th.sorted-asc::after {
    content: '↑';
    color: #0073aa;
}

.g-ffl-cockpit-history-table th.sorted-desc::after {
    content: '↓';
    color: #0073aa;
}

.g-ffl-cockpit-history-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.g-ffl-cockpit-history-table tbody tr:hover {
    background: #f8f9fa;
}

.g-ffl-cockpit-history-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.g-ffl-cockpit-history-table tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

/* History price change indicators */
.g-ffl-cockpit-price-up {
    color: #dc3545;
}

.g-ffl-cockpit-price-down {
    color: #28a745;
}

.g-ffl-cockpit-price-same {
    color: #6c757d;
}

.g-ffl-cockpit-stock-up {
    color: #28a745;
}

.g-ffl-cockpit-stock-down {
    color: #dc3545;
}

/* Chart legend styles */
.g-ffl-cockpit-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.g-ffl-cockpit-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.g-ffl-cockpit-legend-item:hover {
    background-color: #f0f0f0;
}

.g-ffl-cockpit-legend-color {
    width: 16px;
    height: 3px;
    border-radius: 2px;
}

/* History chart tooltip */
.g-ffl-cockpit-chart-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    max-width: 280px;
}

/* Marker tooltip */
.g-ffl-cockpit-marker-tooltip {
    position: absolute;
    background: rgba(20, 20, 40, 0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    min-width: 180px;
    max-width: 280px;
    border: 1px solid #444;
}

.g-ffl-cockpit-chart-tooltip-header {
    font-weight: 600;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 6px;
}

.g-ffl-cockpit-chart-tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 3px 0;
}

/* Mobile responsiveness for history section */
@media (max-width: 768px) {
    .g-ffl-cockpit-history-section > div:first-child {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .g-ffl-cockpit-history-view-toggle {
        width: 100%;
    }
    
    .g-ffl-cockpit-history-view-toggle button {
        flex: 1;
    }
    
    #g_ffl_cockpit_history_distributor_filter {
        width: 100%;
    }
    
    .g-ffl-cockpit-history-table {
        font-size: 12px;
    }
    
    .g-ffl-cockpit-history-table th,
    .g-ffl-cockpit-history-table td {
        padding: 8px 10px;
    }
}

/* TinyMCE dialog z-index fix for Bootstrap modals */
/* Ensures TinyMCE dialogs (like image editor) appear above Bootstrap modals */
/* and can receive user input (pointer-events) */
.tox-tinymce-aux {
    z-index: 100000 !important;
    pointer-events: auto !important;
}

.tox .tox-dialog-wrap {
    z-index: 100001 !important;
    pointer-events: auto !important;
}

.tox .tox-dialog-wrap__backdrop {
    z-index: 100000 !important;
    pointer-events: auto !important;
}

.tox .tox-dialog {
    z-index: 100002 !important;
    pointer-events: auto !important;
}

.tox .tox-dialog__body,
.tox .tox-dialog__body-content,
.tox .tox-dialog__footer,
.tox .tox-form,
.tox .tox-form__group,
.tox .tox-textfield,
.tox .tox-button {
    pointer-events: auto !important;
}

/* AI Helpdesk Chat Styles */
.ai-helpdesk-section {
    max-width: 100%;
}

.ai-chat-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.ai-chat-messages {
    max-height: 400px;
    min-height: 60px;
    overflow-y: auto;
    padding: 10px 12px;
    background: #fafafa;
}

.ai-message {
    margin-bottom: 10px;
    display: flex;
}

.ai-message:last-child {
    margin-bottom: 0;
}

.ai-user-message {
    justify-content: flex-end;
}

.ai-assistant-message {
    justify-content: flex-start;
}

.ai-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.65;
    word-wrap: break-word;
    color: #000;
    font-size: 14.5px;
}

.ai-user-message .ai-message-content {
    background: #0073aa;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-assistant-message .ai-message-content {
    background: #f0f0f0;
    color: #000;
    border-bottom-left-radius: 4px;
    font-size: 14.5px;
    line-height: 1.65;
}

.ai-chat-input-container {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #ddd;
    align-items: flex-end;
}

.ai-question-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    font-size: 14px;
    min-height: 40px;
}

.ai-question-input:focus {
    border-color: #111827;
    outline: none;
    box-shadow: 0 0 0 1px #111827;
}

.ai-ask-button {
    min-width: 80px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000 !important;
    color: #fff !important;
    border: 1px solid #111827 !important;
    border-radius: 999px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 0 20px !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2) !important;
    text-shadow: none !important;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.ai-ask-button:hover {
    background: #000 !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25) !important;
}

.ai-ask-button:focus {
    outline: 2px solid rgba(0, 254, 72, 0.35) !important;
    outline-offset: 2px;
}

.ai-ask-button .spinner {
    visibility: visible;
    margin-left: 5px;
}

.ai-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background: #f1f5f9;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

.ai-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.ai-typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Knowledge Base Form Styles */
.ai-knowledge-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ai-knowledge-section textarea:focus {
    border-color: #e65100;
    outline: none;
    box-shadow: 0 0 0 1px #e65100;
}

/* Mobile responsive for AI chat */
@media screen and (max-width: 768px) {
    .ai-chat-input-container {
        flex-direction: column;
    }
    
    .ai-question-input {
        width: 100%;
    }
    
    .ai-ask-button {
        width: 100%;
    }
    
    .ai-message-content {
        max-width: 90%;
    }
}
