:root {
  --primary-color: #7561FD;
  --secondary-color: #1C1C1C;
  --background-color: #f8f9fc;
  --text-color: #333;
  --border-color: #e0e0e0;
  --success-color: #28a745;
  --error-color: #dc3545;
  --light-purple: #ece9ff;
  --dark-purple: #5240d5;
  --gray-light: #f0f0f0;
  --gray-medium: #888;
  --shadow-sm: 0 2px 4px rgba(117, 97, 253, 0.1);
  --shadow-md: 0 4px 8px rgba(117, 97, 253, 0.15);
  --shadow-lg: 0 8px 16px rgba(117, 97, 253, 0.2);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  width: 100%;
  margin: 0 auto;
  padding: 1rem 2rem;
}

header {
  margin-bottom: 2rem;
}

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

.header-content > div:first-child {
  text-align: left;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#user-name {
  font-weight: 500;
  color: var(--primary-color);
}

.nav-link {
  color: var(--primary-color);
  text-decoration: none;
  margin-right: 1rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.logout-button {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-button:hover {
  background-color: var(--primary-color);
  color: white;
}

header h1 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 2.5rem;
}

header p {
  font-size: 1.1rem;
  color: #666;
}

.input-section {
  background-color: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  position: relative;
  border: 1px solid var(--border-color);
}

.input-group {
  display: flex;
  gap: 1rem;
}

input[type="url"] {
  flex: 1;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

input[type="url"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--light-purple);
}

button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

button:hover {
  background-color: var(--secondary-color);
}

.loading {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  border-radius: 8px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 1rem;
}

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

.result-section {
  background-color: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  display: none;
  border: 1px solid var(--border-color);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.result-header h2 {
  color: var(--primary-color);
  font-size: 1.8rem;
}

.actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.tab-button {
  background-color: transparent;
  color: var(--text-color);
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.tab-button.active {
  color: var(--primary-color);
  border-bottom: 3px solid var(--primary-color);
}

.tab-content {
  position: relative;
  min-height: 400px;
}

.tab-pane {
  display: none;
  height: 100%;
}

.tab-pane.active {
  display: block;
}

#preview-iframe {
  width: 100%;
  height: 600px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

#source-code {
  width: 100%;
  height: 600px;
  overflow: auto;
  background-color: #f8f9fa;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: monospace;
  white-space: pre-wrap;
  font-size: 14px;
}

.plano-info {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.plano-badge {
  background-color: var(--primary-color);
  color: white;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
}

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

.progress-container {
  width: 200px;
  height: 10px;
  background-color: #e9ecef;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s;
}

footer {
  text-align: center;
  margin-top: 2rem;
  color: #666;
  font-size: 0.9rem;
}

/* Estilos para o editor */
.editor-container {
  display: flex;
  height: calc(100vh - 220px);
  min-height: 600px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.editor-sidebar {
  width: 30%;
  min-width: 250px;
  background-color: #f8f9fa;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
}

.editor-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.editor-section {
  padding: 1rem;
}

.editor-section h3 {
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-size: 1.2rem;
}

.element-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.element-item {
  padding: 0.8rem;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.element-item:hover {
  background-color: #f0f4f8;
  border-color: var(--primary-color);
}

.element-item.active {
  background-color: #e6f0fa;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px var(--primary-color);
}

.element-type {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.3rem;
}

.element-preview {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.no-selection-message {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: #666;
  font-style: italic;
}

.element-editor {
  padding: 1rem;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.element-editor h3 {
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.8rem;
}

.element-preview-container {
  margin-bottom: 2rem;
  background-color: #f5f7fa;
  border-radius: 4px;
  padding: 1rem;
  border: 1px solid var(--border-color);
}

.element-preview-container h4 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 600;
}

.element-preview-content {
  background-color: white;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.element-preview-content * {
  max-width: 100%;
  box-sizing: border-box;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group textarea,
.form-group input:not([type="color"]) {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
}

.color-picker-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-picker {
  width: 50px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
}

.color-hex {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.primary-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.primary-button:hover {
  background-color: #0069d9;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.primary-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.primary-button:hover {
  background-color: var(--secondary-color);
}

.secondary-button {
  background-color: white;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-button:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
}

.empty-message {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* Responsividade */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .input-group {
    flex-direction: column;
  }
  
  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .actions {
    width: 100%;
  }
  
  button, input[type="url"] {
    font-size: 16px;
  }
  
  .editor-container {
    flex-direction: column;
    height: auto;
  }
  
  .editor-sidebar {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .editor-content {
    min-height: 400px;
  }
}

/* Estilos para a barra de busca */
.search-container {
  display: flex;
  align-items: center;
  background-color: #f8f9fa;
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-color);
}

#search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
}

.search-controls {
  display: flex;
  align-items: center;
  margin-left: 10px;
}

.search-controls button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 0 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.search-controls button:hover {
  background-color: #0069d9;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.search-controls button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.search-controls button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

#search-count {
  font-size: 14px;
  color: #495057;
  margin: 0 5px;
  min-width: 40px;
  text-align: center;
}

/* Estilos para a aba de códigos de rastreio */
.tracking-container {
  background-color: white;
  border-radius: 4px;
  padding: 1.5rem;
  height: 600px;
  overflow-y: auto;
}

.tracking-header {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.tracking-header-title h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.tracking-actions {
  margin-left: 1rem;
}

.tracking-info {
  color: #666;
  font-size: 0.9rem;
}

.tracking-list {
  margin-top: 1rem;
}

.tracking-item {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.tracking-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.tracking-item-title {
  font-weight: 600;
  color: var(--primary-color);
}

.tracking-item-type {
  background-color: var(--primary-color);
  color: white;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.tracking-item-content {
  background-color: #f1f3f5;
  padding: 0.75rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 150px;
  overflow-y: auto;
}

/* Estilos para a seção de códigos personalizados */
.tracking-custom-section,
.seo-editor-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
  background-color: white;
  border-radius: 4px;
  padding: 1.5rem;
}

.tracking-custom-form {
  background-color: #f8f9fa;
  border-radius: 4px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #495057;
}

#custom-code {
  width: 100%;
  height: 120px;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9rem;
  resize: vertical;
  background-color: white;
  transition: border-color 0.2s;
}

#custom-code:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.radio-group {
  display: flex;
  flex-direction: column;
  margin-top: 0.5rem;
}

.radio-group label {
  margin-bottom: 0.8rem;
  font-weight: normal;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.radio-group label:hover {
  background-color: #e9ecef;
}

.radio-group input[type="radio"] {
  margin-right: 0.8rem;
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.form-actions {
  margin-top: 1.5rem;
  text-align: right;
  display: flex;
  justify-content: flex-end;
}

.custom-codes-list,
.seo-info-panel {
  margin-top: 2rem;
  background-color: #f8f9fa;
  border-radius: 4px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.seo-info-panel {
  margin-top: 0;
  margin-bottom: 2rem;
  background-color: #e9f5ff;
  border-left: 4px solid var(--primary-color);
}

.seo-info-panel p {
  margin: 0;
  color: #495057;
}

.custom-codes-list h4 {
  color: var(--primary-color);
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 0.8rem;
}

.custom-code-item {
  background-color: white;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s, transform 0.2s;
}

.custom-code-item:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.custom-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed #e9ecef;
}

.custom-code-position {
  background-color: var(--primary-color);
  color: white;
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-weight: 500;
}

.custom-code-content {
  font-family: monospace;
  font-size: 0.9rem;
  background-color: #f1f3f5;
  padding: 0.5rem;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 100px;
  overflow-y: auto;
}

/* Estilos para o editor SEO */
.seo-form {
  background-color: #f8f9fa;
  border-radius: 4px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.seo-input,
.seo-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.95rem;
  background-color: white;
  transition: border-color 0.2s;
}

.seo-input:focus,
.seo-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.seo-textarea {
  height: 100px;
  resize: vertical;
}

.input-info {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.3rem;
}

.custom-code-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.custom-code-remove:hover {
  background-color: #c82333;
  transform: scale(1.1);
}
