/**
 * Hotsites Admin CSS
 * Interface completa para gerenciamento de hotsites
 */

/* ===== HOTSITES LIST ===== */
.hotsites-list {
  display: grid;
  gap: 20px;
  margin-top: 30px;
}

.hotsite-card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.hotsite-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.hotsite-card.inactive {
  opacity: 0.6;
}

.hotsite-info h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.4rem;
}

.hotsite-url {
  margin: 10px 0;
  color: var(--marsala-dark);
  font-family: monospace;
}

.hotsite-url a {
  color: var(--marsala-dark);
  text-decoration: none;
}

.hotsite-url a:hover {
  text-decoration: underline;
}

.hotsite-meta {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-top: 15px;
}

.meta-item {
  color: #666;
  font-size: 0.9rem;
}

.meta-item i {
  margin-right: 5px;
}

.hotsite-actions {
  display: flex;
  gap: 10px;
}

.badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-danger {
  background: #f8d7da;
  color: #721c24;
}

/* ===== MODAL XL — apenas para o modal de hotsite ===== */
.modal-xl .modal-dialog {
  max-width: 900px;
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.modal-xl .modal-body {
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-xl .modal-content {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ===== TABS DO MODAL DE HOTSITE (classes isoladas hs-*) ===== */
.hs-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-bottom: 2px solid #eee;
  margin-bottom: 30px;
}

.hs-tab-btn {
  padding: 12px 24px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  position: relative;
  top: 2px;
  white-space: nowrap;
}

.hs-tab-btn i {
  margin-right: 8px;
}

.hs-tab-btn:hover {
  color: var(--marsala-dark);
  background: rgba(107, 31, 61, 0.05);
}

.hs-tab-btn.active {
  color: var(--marsala-dark);
  border-bottom-color: var(--marsala-dark);
  font-weight: 600;
}

.hs-pane {
  display: none;
}

.hs-pane.active {
  display: block;
  animation: hsPaneFadeIn 0.2s ease;
}

@keyframes hsPaneFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== FORM SECTIONS ===== */
.form-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section h3 {
  color: var(--marsala-dark);
  margin-bottom: 15px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section h3 i {
  color: var(--golden);
}

.form-section > p {
  color: #666;
  margin-bottom: 20px;
  font-size: 14px;
}

/* ===== COLOR PICKERS ===== */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.color-picker-group {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.color-picker-group:hover {
  border-color: var(--marsala-dark);
  background: white;
  box-shadow: 0 4px 12px rgba(107, 31, 61, 0.1);
}

.color-picker-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
  font-size: 14px;
}

.color-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 10px;
}

.color-picker {
  width: 70px;
  height: 45px;
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.color-picker:hover {
  border-color: var(--marsala-dark);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(107, 31, 61, 0.2);
}

.color-picker:focus {
  outline: none;
  border-color: var(--golden);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.color-hex {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  font-weight: 600;
  background: white;
  color: #333;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.color-hex:focus {
  outline: none;
  border-color: var(--marsala-dark);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(107, 31, 61, 0.1);
}

.color-hex::placeholder {
  color: #aaa;
  font-weight: normal;
}

.color-picker-group small {
  display: block;
  color: #666;
  font-size: 12px;
  font-style: italic;
}

/* ===== OPACITY SLIDER ===== */
.opacity-slider {
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(to right, 
    rgba(107, 31, 61, 0) 0%, 
    rgba(107, 31, 61, 0.5) 50%,
    rgba(107, 31, 61, 1) 100%);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  margin: 15px 0;
}

.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--marsala-dark);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.opacity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 12px rgba(107, 31, 61, 0.5);
}

.opacity-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--marsala-dark);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.opacity-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 12px rgba(107, 31, 61, 0.5);
}

.opacity-value {
  float: right;
  font-weight: 700;
  color: var(--marsala-dark);
  font-size: 16px;
  background: rgba(107, 31, 61, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
}

.opacity-preview-bar {
  margin-top: 15px;
  height: 60px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--marsala-dark) 0%, #8B2F47 100%);
  transition: opacity 0.3s ease;
  position: relative;
  overflow: hidden;
  border: 2px solid #e9ecef;
}

.opacity-preview-bar::after {
  content: 'PREVIEW';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ===== CODE EDITOR ===== */
.code-editor {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
}

.code-editor:focus {
  background: white;
  border-color: var(--marsala-dark);
}

/* ===== CHAR COUNTER ===== */
.char-count {
  float: right;
  color: #666;
  font-size: 12px;
}

.char-count.warning {
  color: orange;
}

.char-count.error {
  color: red;
}

/* ===== SECTIONS CONFIG ===== */
.sections-config {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.section-item:hover {
  background: white;
  border-color: var(--marsala-dark);
}

.section-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.section-info {
  flex: 1;
}

.section-info strong {
  display: block;
  color: #333;
  margin-bottom: 5px;
  font-size: 15px;
}

.section-info strong i {
  margin-right: 8px;
  color: var(--golden);
}

.section-info small {
  color: #666;
  font-size: 13px;
}

/* ===== FORM ACTIONS ===== */
.form-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #eee;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hotsite-card {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .hotsite-actions {
    width: 100%;
    margin-top: 20px;
  }
  
  .hotsite-actions button {
    flex: 1;
  }
  
  .hs-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .hs-tab-btn {
    white-space: nowrap;
    font-size: 14px;
    padding: 10px 16px;
  }
  
  .color-grid {
    grid-template-columns: 1fr;
  }
  
  .current-image {
    max-width: 100%;
    height: 200px;
  }
  
  .modal-xl .modal-dialog {
    max-width: 95%;
  }
}

/* ===== IMAGE UPLOAD ===== */
.image-upload-group {
  margin-bottom: 30px;
}

.image-upload-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.current-image {
  width: 100%;
  max-width: 500px;
  height: 250px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  overflow: hidden;
  transition: all 0.3s ease;
}

.current-image:hover {
  border-color: var(--marsala-dark);
  background: white;
}

.current-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.no-image-text {
  color: #999;
  font-style: italic;
  font-size: 14px;
}

.file-input {
  display: none;
}

.file-input-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--marsala-dark);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  border: none;
}

.file-input-label:hover {
  background: var(--marsala-darker, #4a1529);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(107, 31, 61, 0.3);
}

.file-input-label i {
  font-size: 16px;
}

/* ===== UTILITIES ===== */
.text-muted {
  color: #666;
}

.text-success {
  color: #28a745;
}

.text-danger {
  color: #dc3545;
}
