/**
 * Public CSS for Nagasaki Prompt Manager - Modern Blue Design
 */
:root {
  --npm-primary: #017cc8;      /* Primary blue */
  --npm-secondary: #025b92;    /* Darker blue - deep darker */
  --npm-accent: #38b6ff;       /* Light blue accent - brighter */
  --npm-accent-hover: #0098e6; /* Hover blue - adjusted for better contrast */
  --npm-light: #f4faff;        /* Light blue-tinted background - lighter */
  --npm-dark: #014b79;         /* Dark blue - deeper tone */
  --npm-text: #333333;         /* Text color */
  --npm-border: #b8dfff;       /* Border color with blue tint - lighter */
  --npm-shadow: rgba(1, 124, 200, 0.12);  /* Shadow color based on primary - softer */
  --npm-radius: 8px;           /* Border radius */
  --npm-transition: all 0.3s ease; /* Smooth transitions */
  --npm-highlight: #5ac8ff;    /* Bright highlight color - more vivid */
  --npm-gradient-start: #0088d6; /* Gradient start - slightly brighter primary */
  --npm-gradient-end: #015385;   /* Gradient end - deeper blue */
}

/* Main container styling */
.npm-public-container {
  max-width: 1200px;
  margin: 0px auto;
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: var(--npm-text);
  padding: 0 20px;
}

/* Instruction text styling */
.npm-public-instruction-text {
  width: 100%;
  margin-bottom: 20px;
  text-align: center;
}

.npm-public-instruction-text p {
  padding: 15px;
  border-radius: var(--npm-radius);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 500;
  margin: 0;
}

/* Selectors area styling */
.npm-public-selectors {
  display: flex;
  gap: 25px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--npm-gradient-start), var(--npm-gradient-end));
  padding: 30px;
  border-radius: var(--npm-radius);
  box-shadow: 0 8px 20px var(--npm-shadow);
}

.npm-public-selector-group {
  flex: 1;
  min-width: 250px;
}

.npm-public-selector-group label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--npm-light);
  letter-spacing: 0.5px;
  font-size: 16px;
}

.npm-public-select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--npm-radius);
  background-color: rgba(255, 255, 255, 0.12);
  font-size: 16px;
  color: white;
  cursor: pointer;
  transition: var(--npm-transition);
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6" viewBox="0 0 12 6"><path fill="white" d="M0 0l6 6 6-6z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px;
}

.npm-public-select:focus {
  border-color: var(--npm-highlight);
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 182, 255, 0.25);
}

.npm-public-select:hover {
  background-color: rgba(255, 255, 255, 0.18);
}

.npm-public-select:disabled {
  background-color: rgba(255, 255, 255, 0.05);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Prompt list title and instruction */
.npm-public-prompt-list-header {
  margin-top: 40px;
  margin-bottom: 25px;
  text-align: center;
}

.npm-public-prompt-list-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--npm-primary);
  margin: 0 0 10px 0;
  padding-bottom: 10px;
  display: inline-block;
  position: relative;
}

.npm-public-prompt-list-title:after {
  content: '';
  position: absolute;
  width: 70%;
  height: 3px;
  bottom: 0;
  left: 15%;
  background: linear-gradient(to right, transparent, var(--npm-accent), transparent);
}

.npm-public-prompt-list-instruction {
  font-size: 16px;
  color: #555;
  margin: 0;
  line-height: 1.5;
}

/* Prompt list styling */
.npm-public-prompt-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.npm-public-prompt-card {
  background: white;
  border-radius: var(--npm-radius);
  overflow: hidden;
  box-shadow: 0 5px 15px var(--npm-shadow);
  transition: var(--npm-transition);
  border: 1px solid var(--npm-border);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.npm-public-prompt-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(1, 124, 200, 0.18);
  border-color: var(--npm-highlight);
}

.npm-public-prompt-card:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--npm-primary), var(--npm-accent));
  opacity: 0;
  transition: var(--npm-transition);
}

.npm-public-prompt-card:hover:before {
  opacity: 1;
}

.npm-public-prompt-header {
  padding: 18px 22px;
  background: linear-gradient(to right, var(--npm-light), #ffffff);
  border-bottom: 1px solid var(--npm-border);
}

.npm-public-prompt-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--npm-primary);
  line-height: 1.4;
  font-weight: 600;
}

.npm-public-prompt-body {
  padding: 18px 22px;
  color: #4a4a4a;
  font-size: 15px;
  line-height: 1.6;
  flex: 1;
}

.npm-public-prompt-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 20px;
  color: #555;
  line-height: 1.7;
}

.npm-public-prompt-footer {
  padding: 0 22px 18px;
  text-align: right;
  margin-top: auto;
}

.npm-public-view-btn {
  display: inline-block;
  background: var(--npm-primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--npm-transition);
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(1, 124, 200, 0.2);
}

.npm-public-view-btn:hover {
  background: var(--npm-accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(56, 182, 255, 0.3);
  text-decoration: none;
  color: white;
}

/* Prompt detail modal styling */
.npm-public-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.npm-public-modal.open {
  display: flex;
}

.npm-public-modal-content {
  background: white;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.npm-public-modal-header {
  padding: 25px 30px;
  background: linear-gradient(135deg, var(--npm-primary), var(--npm-gradient-end));
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.npm-public-modal-header h3 {
  margin: 0;
  font-size: 22px;
  color: white;
  font-weight: 600;
}

.npm-public-close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
  transition: var(--npm-transition);
}

.npm-public-close-btn:hover {
  color: white;
  transform: rotate(90deg);
}

.npm-public-modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
  background: #fcfcfc;
  max-height: 50vh; /* Giới hạn chiều cao để luôn thấy được footer */
}

.npm-public-prompt-content {
  white-space: pre-wrap;
  line-height: 1.8;
  color: #333;
  font-size: 16px;
  border-left: 3px solid var(--npm-primary);
  padding-left: 20px;
  font-family: 'Noto Sans JP', sans-serif;
}

.npm-public-modal-footer {
  padding: 20px 30px;
  display: flex;
  justify-content: flex-end;
  background: #f8f9fa;
  border-top: 1px solid #eee;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.npm-public-copy-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--npm-primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--npm-transition);
  box-shadow: 0 4px 12px rgba(1, 124, 200, 0.2);
}

.npm-public-copy-btn:hover {
  background: var(--npm-accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(1, 124, 200, 0.3);
}

.npm-public-copy-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* Empty state styling */
.npm-public-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--npm-light);
  border-radius: var(--npm-radius);
  color: #666;
  font-size: 16px;
  grid-column: 1 / -1; /* Span all columns */
  border: 1px dashed var(--npm-border);
}

/* Loading indicator styling */
.npm-public-loading {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 100001;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(3px);
}

.npm-public-loading.show {
  display: flex;
}

.npm-public-loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(1, 124, 200, 0.2);
  border-top: 4px solid var(--npm-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Copy notification styling */
.npm-public-copy-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--npm-primary);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  box-shadow: 0 5px 15px rgba(1, 124, 200, 0.3);
  z-index: 100002;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  min-width: 200px;
  font-weight: 500;
}

.npm-public-copy-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.npm-public-notification-content {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.npm-public-notification-content:before {
  content: '✓';
  display: inline-block;
  margin-right: 8px;
  font-weight: bold;
  color: white;
  background: var(--npm-accent);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  text-align: center;
  line-height: 22px;
  font-size: 12px;
}

/* Animation */
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(20px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .npm-public-selectors {
    flex-direction: column;
    gap: 15px;
    padding: 20px;
  }
  
  .npm-public-prompt-list {
    grid-template-columns: 1fr;
  }
  
  .npm-public-modal {
    align-items: flex-start;
    padding-top: 50px; /* Đặt modal cao hơn trên màn hình */
  }
  
  .npm-public-modal-content {
    width: 95%;
    max-height: 80vh;
  }
  
  .npm-public-modal-header {
    padding: 15px 20px;
  }
  
  .npm-public-modal-body {
    padding: 15px;
    max-height: calc(60vh - 110px); /* Đảm bảo nội dung không quá dài */
    overflow-y: auto;
  }
  
  .npm-public-modal-footer {
    padding: 12px 15px;
    position: sticky;
    bottom: 0;
  }
  
  .npm-public-copy-btn {
    font-size: 14px;
    padding: 10px 20px;
    width: 100%; /* Nút copy chiếm toàn bộ chiều rộng trên mobile */
    justify-content: center;
  }
  
  .npm-public-copy-notification {
    min-width: 180px;
    padding: 10px 16px;
    font-size: 14px;
    top: 20px; /* Hiển thị thông báo ở trên đầu màn hình */
    bottom: auto;
  }
  
  .npm-public-copy-notification.show {
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 480px) {
  .npm-public-container {
    margin: 20px auto;
    padding: 0 15px;
  }
  
  .npm-public-prompt-header h3 {
    font-size: 16px;
  }
  
  .npm-public-prompt-excerpt {
    font-size: 14px;
    -webkit-line-clamp: 2;
  }
  
  .npm-public-modal-header h3 {
    font-size: 18px;
  }
  
  .npm-public-prompt-content {
    font-size: 14px;
    line-height: 1.6;
  }
  
  .npm-public-prompt-header,
  .npm-public-prompt-body,
  .npm-public-prompt-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .npm-public-modal {
    padding-top: 30px; /* Modal bắt đầu gần đỉnh màn hình hơn */
  }
  
  .npm-public-modal-body {
    max-height: calc(65vh - 100px); /* Thêm không gian cho nội dung */
  }
} 