/**
 * PMS Operation Result Modal Styles
 * Comprehensive styling for operation feedback modals
 * 
 * @package PMS
 * @since 1.0
 */

/* Modal Base Styles */
.pms-operation-result-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
}

.pms-operation-result-modal .pms-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pms-operation-result {
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 450px;
  max-height: 70vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: pms-modal-slide-in 0.3s ease-out;
}

@keyframes pms-modal-slide-in {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Header */
.pms-operation-result .pms-modal__header {
  background: #f8f9fa;
  color: #333;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e9ecef;
}

.pms-modal__header-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pms-modal__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.pms-modal__icon.success {
  background: rgba(40, 167, 69, 0.3);
  color: #28a745;
}

.pms-modal__icon.error {
  background: rgba(220, 53, 69, 0.3);
  color: #dc3545;
}

.pms-modal__title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.pms-modal__subtitle {
  margin: 4px 0 0 0;
  font-size: 14px;
  opacity: 0.9;
  font-weight: 400;
}

.pms-modal__close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pms-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Modal Body */
.pms-operation-result .pms-modal__body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

/* Operation Summary */
.pms-operation-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.pms-summary-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

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

.pms-summary-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #6c757d;
}

.pms-summary-card.success::before {
  background: #28a745;
}

.pms-summary-card.warning::before {
  background: #ffc107;
}

.pms-summary-card.error::before {
  background: #dc3545;
}

.pms-summary-card__icon {
  font-size: 16px;
  margin-bottom: 4px;
  color: #6c757d;
}

.pms-summary-card.success .pms-summary-card__icon {
  color: #28a745;
}

.pms-summary-card.warning .pms-summary-card__icon {
  color: #ffc107;
}

.pms-summary-card.error .pms-summary-card__icon {
  color: #dc3545;
}

.pms-summary-card__value {
  font-size: 18px;
  font-weight: 600;
  color: #212529;
  margin-bottom: 2px;
  line-height: 1;
}

.pms-summary-card__label {
  font-size: 10px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 500;
}

/* Details Section */
.pms-details-section {
  border-top: 1px solid #e9ecef;
  padding-top: 24px;
  margin-top: 24px;
}

.pms-details-group {
  margin-bottom: 20px;
}

.pms-details-group h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.pms-details-group h4:hover {
  border-bottom-color: #dee2e6;
}

.pms-details-group h4 i {
  color: #6c757d;
  font-size: 14px;
}

.pms-details-content {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 16px;
  margin-top: 8px;
  display: none;
}

.pms-details-content.expanded {
  display: block;
}

/* Statistics Grid */
.pms-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.pms-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: white;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.pms-stat-label {
  font-weight: 500;
  color: #495057;
}

.pms-stat-value {
  font-weight: 600;
  color: #212529;
}

/* Duplicate and Internal Code Lists */
.pms-duplicate-list,
.pms-internal-code-list {
  max-height: 300px;
  overflow-y: auto;
}

.pms-duplicate-item,
.pms-internal-code-item {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
}

.pms-duplicate-item:last-child,
.pms-internal-code-item:last-child {
  margin-bottom: 0;
}

.pms-duplicate-header,
.pms-internal-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pms-duplicate-row,
.pms-internal-code-row {
  font-weight: 600;
  color: #495057;
  background: #e9ecef;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.pms-duplicate-reason,
.pms-internal-code-reason {
  font-size: 12px;
  color: #6c757d;
  font-style: italic;
}

.pms-duplicate-details,
.pms-internal-code-details {
  font-size: 14px;
  color: #495057;
  line-height: 1.4;
}

/* Validation Results */
.pms-validation-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pms-validation-errors,
.pms-validation-warnings {
  background: white;
  border-radius: 6px;
  padding: 16px;
}

.pms-validation-errors {
  border-left: 4px solid #dc3545;
}

.pms-validation-warnings {
  border-left: 4px solid #ffc107;
}

.pms-validation-errors h5,
.pms-validation-warnings h5 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pms-validation-errors h5 {
  color: #dc3545;
}

.pms-validation-warnings h5 {
  color: #ffc107;
}

.pms-validation-error,
.pms-validation-warning {
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.4;
}

.pms-validation-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.pms-validation-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.pms-validation-error:last-child,
.pms-validation-warning:last-child {
  margin-bottom: 0;
}

/* Action Buttons */
.pms-action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
  flex-wrap: wrap;
}

/* Modal Footer */
.pms-operation-result .pms-modal__footer {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  padding: 12px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Button styles are now handled by the main button system in buttons.css */

/* Body scroll lock */
body.pms-modal-open {
  overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
  .pms-operation-result {
    margin: 10px;
    max-height: calc(100vh - 20px);
  }

  .pms-operation-result .pms-modal__header {
    padding: 20px;
  }

  .pms-operation-result .pms-modal__body {
    padding: 20px;
  }

  .pms-operation-result .pms-modal__footer {
    padding: 16px 20px;
  }

  .pms-modal__header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .pms-modal__title h3 {
    font-size: 20px;
  }

  .pms-operation-summary {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
  }

  .pms-summary-card {
    padding: 16px;
  }

  .pms-summary-card__value {
    font-size: 24px;
  }

  .pms-action-buttons {
    flex-direction: column;
  }

  .pms-operation-result .pms-modal__footer {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .pms-operation-summary {
    grid-template-columns: 1fr;
  }

  .pms-stats-grid {
    grid-template-columns: 1fr;
  }

  .pms-duplicate-header,
  .pms-internal-code-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Detailed Information Section Styles */
.pms-operation-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.pms-operation-details h4 {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pms-operation-details h4::before {
  content: "📋";
  font-size: 16px;
}

.pms-details-content {
  display: block;
  margin-top: 12px;
}

.pms-details-content .pms-detail-section {
  margin-bottom: 0;
}

.pms-detail-section {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid #d1d5db;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

.pms-detail-section h5 {
  margin-top: 0;
  margin-bottom: 12px;
}

.pms-detail-section h6 {
  margin-top: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.pms-error-summary {
  margin: 0 0 12px 0;
  padding: 12px;
  background: #fee;
  border-left: 3px solid #dc3545;
  border-radius: 4px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.pms-error-list {
  margin: 8px 0 0 0;
  padding-left: 24px;
}

.pms-error-list li {
  margin-bottom: 6px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.6;
}

.pms-detail-section.error {
  background: #fef2f2;
  border-left-color: #ef4444;
}

.pms-detail-section.warning {
  background: #fffbeb;
  border-left-color: #f59e0b;
}

.pms-detail-section.info {
  background: #eff6ff;
  border-left-color: #3b82f6;
}

.pms-detail-section h5 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pms-detail-section.error h5 {
  color: #dc2626;
}

.pms-detail-section.warning h5 {
  color: #d97706;
}

.pms-detail-section.info h5 {
  color: #2563eb;
}

.pms-detail-section ul {
  margin: 0;
  padding-left: 20px;
  list-style-type: disc;
}

.pms-detail-section li {
  font-size: 13px;
  line-height: 1.5;
  color: #6b7280;
  margin-bottom: 4px;
}

.pms-detail-section.error li {
  color: #7f1d1d;
}

.pms-detail-section.warning li {
  color: #92400e;
}

.pms-detail-section.info li {
  color: #1e40af;
}

.pms-more-errors {
  font-style: italic;
  color: #6b7280 !important;
  font-weight: 500;
}

/* File Status Section */
.pms-file-status-section {
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.pms-file-status-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pms-file-status-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.pms-file-status-icon.success {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.pms-file-status-icon.error {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.pms-file-status-content h4 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.pms-file-status-message {
  margin: 0;
  font-size: 14px;
  color: #6c757d;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.pms-file-status-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.pms-file-status-content h4 {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Processing Results Section */
.pms-processing-results-section {
  margin-bottom: 24px;
}

.pms-processing-results-section h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.pms-processing-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

/* Responsive adjustments for detailed sections */
@media (max-width: 768px) {
  .pms-operation-details {
    margin-top: 20px;
    padding-top: 20px;
  }

  .pms-operation-details h4 {
    font-size: 16px;
  }

  .pms-detail-section {
    padding: 12px;
  }

  .pms-detail-section h5 {
    font-size: 13px;
  }

  .pms-detail-section li {
    font-size: 12px;
  }

  .pms-file-status-section {
    padding: 16px;
  }

  .pms-file-status-header {
    gap: 12px;
  }

  .pms-file-status-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .pms-file-status-content h4 {
    font-size: 16px;
  }

  .pms-processing-results-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Operation Note Styles */
.pms-operation-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: #e3f2fd;
  border: 1px solid #2196f3;
  border-radius: 6px;
  border-left: 4px solid #2196f3;
}

.pms-note-content {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1565c0;
  font-size: 14px;
  line-height: 1.4;
}

.pms-note-content i {
  color: #2196f3;
  font-size: 16px;
  flex-shrink: 0;
}

/* Responsive adjustments for note */
@media (max-width: 768px) {
  .pms-operation-note {
    margin-top: 12px;
    padding: 10px 12px;
  }

  .pms-note-content {
    font-size: 13px;
  }

  .pms-note-content i {
    font-size: 14px;
  }
}
