/* Base Design Tokens */
:root {
  --navy:  #10202F; /* Navy Escuro */
  --gold:  #EB7104; /* Laranja da Marca */
  --gelo:  #F5F5F7;
  --white: #FFFFFF;
  --green: #10B981;
  --bordo: #EB7104; /* Usar o Laranja também para destaque secundário */
  --dark-card: rgba(16, 32, 47, 0.65);
  --border-glow: rgba(235, 113, 4, 0.15);
}

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

body {
  font-family: 'Aileron Light', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--navy);
  color: var(--gelo);
  background-image: 
    linear-gradient(rgba(241, 244, 249, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 244, 249, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Scrollbar Style */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--navy);
}
::-webkit-scrollbar-thumb {
  background: rgba(241, 244, 249, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* Sidebar Styling */
.sidebar {
  width: 260px;
  background: rgba(16, 32, 47, 0.95);
  border-right: 1px solid rgba(241, 244, 249, 0.05);
  display: flex;
  flex-direction: column;
  padding: 30px 20px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  padding: 0 10px;
}

.logo-img {
  height: 40px;
  width: auto;
}

.logo-text {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 1px;
}

.logo-text strong {
  font-weight: 800;
  color: var(--gold);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

.nav-item {
  color: rgba(241, 244, 249, 0.6);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover, .nav-item.active {
  color: var(--white);
  background: rgba(241, 244, 249, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-item.active {
  border-left: 3px solid var(--gold);
  background: rgba(235, 113, 4, 0.08);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(241, 244, 249, 0.4);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator.online {
  background-color: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* Main Content Area */
.main-content {
  margin-left: 260px;
  flex-grow: 1;
  padding: 40px 50px;
  max-width: 1300px;
  width: calc(100% - 260px);
}

.content-header {
  margin-bottom: 40px;
}

.content-header h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 15px;
  color: rgba(241, 244, 249, 0.5);
  font-weight: 500;
}

/* Tab Management */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

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

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

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--dark-card);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(241, 244, 249, 0.06);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(235, 113, 4, 0.2);
}

.stat-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(241, 244, 249, 0.4);
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: 'Rounded Elegance', 'Space Mono', monospace;
  font-size: 36px;
  font-weight: 700;
}

.text-gold { color: var(--gold); }
.text-green { color: var(--green); }

/* Buttons */
.btn {
  font-family: 'Aileron Light', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--gold);
  color: var(--navy);
  box-shadow: 0 4px 14px rgba(235, 113, 4, 0.25);
}

.btn-primary:hover {
  background-color: #e5c158;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(235, 113, 4, 0.35);
}

.btn-secondary {
  background: rgba(241, 244, 249, 0.06);
  color: var(--white);
  border: 1px solid rgba(241, 244, 249, 0.08);
}

.btn-secondary:hover {
  background: rgba(241, 244, 249, 0.12);
}

.btn-block {
  width: 100%;
}

/* Sections and Cards */
.section-card {
  background: var(--dark-card);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(241, 244, 249, 0.06);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 800;
}

.max-width-600 {
  max-width: 600px;
}

/* Form Styling */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(241, 244, 249, 0.6);
}

.form-group input[type="url"],
.form-group input[type="text"],
.form-group input[type="password"] {
  background: rgba(16, 32, 47, 0.8);
  border: 1px solid rgba(241, 244, 249, 0.08);
  padding: 14px 16px;
  border-radius: 10px;
  color: var(--white);
  font-family: 'Aileron Light', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--border-glow);
}

.input-hint {
  font-size: 12px;
  color: rgba(241, 244, 249, 0.35);
}

.checkbox-group {
  display: flex;
  gap: 20px;
  background: rgba(16, 32, 47, 0.4);
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(241, 244, 249, 0.05);
}

.checkbox-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gelo);
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Settings Page */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

/* Tables and Data list */
.table-container {
  overflow-x: auto;
}

.posts-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.posts-table th, .posts-table td {
  padding: 18px;
  border-bottom: 1px solid rgba(241, 244, 249, 0.04);
}

.posts-table th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(241, 244, 249, 0.4);
  letter-spacing: 0.5px;
}

.posts-table td {
  font-size: 14px;
  font-weight: 500;
}

.posts-table tbody tr {
  transition: background 0.3s ease;
}

.posts-table tbody tr:hover {
  background: rgba(241, 244, 249, 0.02);
}

/* Status Badges */
.badge {
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-block;
  letter-spacing: 0.5px;
}

.badge-draft { background: rgba(241, 244, 249, 0.1); color: var(--gelo); }
.badge-rendering { background: rgba(235, 181, 44, 0.1); color: var(--gold); }
.badge-approved { background: rgba(235, 113, 4, 0.18); color: var(--gold); border: 1px solid rgba(235, 113, 4, 0.3); }
.badge-published { background: rgba(16, 185, 129, 0.15); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-checking { background: rgba(241, 244, 249, 0.05); color: rgba(241, 244, 249, 0.5); }

/* Platform Tags */
.platform-tag {
  background: rgba(241, 244, 249, 0.04);
  border: 1px solid rgba(241, 244, 249, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
  text-transform: capitalize;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(16, 32, 47, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--navy);
  border: 1px solid rgba(241, 244, 249, 0.08);
  border-radius: 24px;
  width: 90%;
  max-width: 1000px;
  padding: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  animation: modalSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 800;
}

.close-modal {
  font-size: 28px;
  cursor: pointer;
  color: rgba(241, 244, 249, 0.4);
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--white);
}

.modal-body {
  display: flex;
  gap: 30px;
  align-items: stretch;
  flex-wrap: wrap;
}

.modal-col-left {
  flex: 1.2;
  min-width: 380px;
  display: flex;
  flex-direction: column;
}

.modal-col-right {
  flex: 1;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  background: rgba(241, 244, 249, 0.03);
  border: 1px solid rgba(241, 244, 249, 0.08);
  padding: 24px;
  border-radius: 16px;
}

.mobile-only-details {
  display: none;
}

/* Slideshow */
.slideshow-container {
  width: 100%;
  max-width: 480px;
  height: 600px;
  margin: 0 auto 30px auto;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(241, 244, 249, 0.06);
}

.slide-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  flex-shrink: 0;
}

.prev-slide, .next-slide {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(16, 32, 47, 0.7);
  backdrop-filter: blur(4px);
  color: var(--white);
  border: 1px solid rgba(241, 244, 249, 0.08);
  font-size: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.prev-slide:hover, .next-slide:hover {
  background: var(--gold);
  color: var(--navy);
}

.prev-slide { left: 16px; }
.next-slide { right: 16px; }

.slide-indicator {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(1, 14, 56, 0.7);
  backdrop-filter: blur(4px);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(241, 244, 249, 0.08);
}

.action-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* Processing Pulse Animation */
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.badge-pulse {
  animation: badgePulse 1.5s ease-in-out infinite;
}

.badge-scraping { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-generating { background: rgba(235, 113, 4, 0.15); color: var(--gold); border: 1px solid rgba(235, 113, 4, 0.3); }
.badge-error { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Delete Button */
.btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Toast Animations */
@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

/* Mobile Responsiveness (Screen sizes <= 768px) */
@media screen and (max-width: 768px) {
  body {
    flex-direction: column;
  }

  /* Adjust Sidebar */
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 15px 10px;
    border-right: none;
    border-bottom: 1px solid rgba(241, 244, 249, 0.05);
    background: var(--navy);
  }

  .sidebar-logo {
    margin-bottom: 15px;
    justify-content: center;
    padding: 0;
  }

  .logo-img {
    height: 32px;
  }

  .logo-text {
    font-size: 14px;
  }

  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 0;
  }

  .nav-item {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    gap: 6px;
  }

  .nav-item.active {
    border-left: none;
    border-bottom: 2px solid var(--gold);
    background: rgba(241, 244, 249, 0.05);
  }

  .sidebar-footer {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 10px;
  }

  .server-status {
    display: none !important;
  }

  /* Adjust Main Content Area */
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 20px 15px;
  }

  .content-header {
    margin-bottom: 24px;
    text-align: center;
  }

  .content-header h1 {
    font-size: 24px;
    margin-bottom: 6px;
  }

  .subtitle {
    font-size: 13px;
  }

  /* Grid Adjustments */
  .stats-grid {
    gap: 16px;
    margin-bottom: 24px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 28px;
  }

  .section-card {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 12px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }

  .section-header h2 {
    font-size: 18px;
  }

  .btn {
    padding: 10px 18px;
    font-size: 14px;
  }

  /* Table responsive scrolling */
  .posts-table th, .posts-table td {
    padding: 12px 10px;
    font-size: 13px;
  }

  .mobile-only-details {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
  }

  #tab-dashboard .posts-table th:nth-child(2),
  #tab-dashboard .posts-table td:nth-child(2),
  #tab-dashboard .posts-table th:nth-child(3),
  #tab-dashboard .posts-table td:nth-child(3) {
    display: none;
  }

  .platform-tag {
    padding: 2px 6px;
    font-size: 10px;
    margin-right: 4px;
  }

  /* Settings Page */
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Modals */
  .modal-content {
    width: 95%;
    padding: 15px;
    border-radius: 16px;
    max-height: 95vh;
    overflow-y: auto;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  /* Slideshow scaling for smaller mobile viewports */
  .slideshow-container {
    max-width: 100%;
    height: auto;
    aspect-ratio: 4/5;
  }

  .modal-body {
    flex-direction: column;
    gap: 20px;
  }

  .modal-col-left {
    min-width: 100%;
  }

  .modal-col-right {
    min-width: 100%;
    padding: 16px;
  }

  .action-footer {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .action-footer .btn {
    width: 100%;
  }
}

