/* ====================================================================
   CENTRAL DO CLIPADOR - PREMIUM STYLES
   Oliver Cortes — Instituto Oliver
   ==================================================================== */

/* Contêiner principal da Central */
.central-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  background: var(--bg);
  color: var(--white);
  animation: fadeIn 0.4s ease;
}

/* Sidebar Styling */
.central-sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-header {
  margin-bottom: 32px;
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 8px;
}

.sidebar-logo span {
  color: var(--yellow);
}

/* User Profile Widget in Sidebar */
.user-profile-widget {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-container {
  position: relative;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--yellow);
  background: var(--line);
}

.online-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4caf50;
  border: 2px solid var(--panel);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-streak {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--yellow);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

/* Sidebar Nav Menu */
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--gray);
  padding: 12px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-item svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 0.2s;
}

.menu-item:hover {
  background: rgba(255, 212, 0, 0.04);
  color: var(--white);
}

.menu-item:hover svg {
  transform: translateX(2px);
}

.menu-item.active {
  background: var(--yellow-dim);
  color: var(--yellow);
  border-left: 3px solid var(--yellow);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Sidebar Footer & DB Badge */
.sidebar-footer {
  margin-top: auto;
}

.db-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  width: 100%;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.db-status-badge:hover {
  background: rgba(255, 255, 255, 0.06);
}

.db-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.db-status-dot.connected {
  background: #4caf50;
  box-shadow: 0 0 8px #4caf50;
  animation: badgeGlow 2s infinite;
}

.db-status-dot.demo {
  background: #ff9800;
  box-shadow: 0 0 8px #ff9800;
  animation: badgeGlow 2s infinite;
}

@keyframes badgeGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Main Workspace Area */
.central-main {
  padding: 40px 48px;
  overflow-y: auto;
  height: 100vh;
}

/* Section Styling */
.central-section {
  display: none;
  animation: sectionFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.central-section.active {
  display: block;
}

@keyframes sectionFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* Headers */
.section-header {
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 32px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--white);
}

.section-subtitle {
  color: var(--gray);
  font-size: 14px;
  margin-top: 4px;
}

/* Bento Grid Dashboard */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.bento-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.2s;
}

.bento-card:hover {
  border-color: rgba(255, 212, 0, 0.2);
  transform: translateY(-2px);
}

.bento-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 3px;
  background: transparent;
  transition: background 0.3s;
}

.bento-card.highlight::before {
  background: var(--yellow);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  margin-bottom: 16px;
  border: 1px solid var(--line);
}

.bento-card:hover .card-icon {
  color: var(--yellow);
  background: rgba(255, 212, 0, 0.04);
  border-color: rgba(255, 212, 0, 0.2);
}

.card-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.bento-card.highlight .card-value {
  color: var(--yellow);
  text-shadow: 0 0 16px rgba(255, 212, 0, 0.2);
}

.card-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  margin-top: 6px;
}

/* Dashboard Row: Grid with recent submissions + current campaign */
.dashboard-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
}

.panel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Campaigns Grid */
.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.campaign-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.campaign-card:hover {
  border-color: var(--yellow);
  box-shadow: 0 12px 32px rgba(255, 212, 0, 0.04);
  transform: translateY(-4px);
}

.campaign-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}

.campaign-badge {
  background: var(--yellow-dim);
  color: var(--yellow);
  border: 1px solid rgba(255, 212, 0, 0.3);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 2px;
  text-transform: uppercase;
}

.campaign-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}

.campaign-desc {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 24px;
}

.campaign-stats-row {
  display: flex;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-bottom: 24px;
}

.campaign-stat-item .val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--white);
  font-size: 15px;
}

.campaign-stat-item .lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray);
  margin-top: 2px;
}

.campaign-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.btn-primary {
  background: var(--yellow);
  color: #000;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 0;
  border-radius: 4px;
  padding: 12px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 212, 0, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.02);
  color: var(--white);
  border: 1px solid var(--line);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 12px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--gray);
}

/* Submit Clip Form & Rules splitting */
.submit-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
}

/* Custom form elements */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 8px;
}

.form-select, .form-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px 14px;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px var(--yellow), 0 0 20px rgba(255, 212, 0, 0.2);
  transform: scale(1.015);
}

/* Platform Custom Radio Selectors */
.platform-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.platform-radio-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  cursor: pointer;
  background: var(--card);
  transition: all 0.2s;
}

.platform-radio-label svg {
  width: 24px;
  height: 24px;
  fill: var(--gray);
}

.platform-radio-label span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--gray);
  letter-spacing: 0.05em;
}

.platform-radio-input {
  display: none;
}

.platform-radio-input:checked + .platform-radio-label {
  border-color: var(--yellow);
  background: rgba(255, 212, 0, 0.03);
  box-shadow: 0 0 12px rgba(255, 212, 0, 0.05);
}

.platform-radio-input:checked + .platform-radio-label svg {
  fill: var(--yellow);
}

.platform-radio-input:checked + .platform-radio-label span {
  color: var(--yellow);
}

/* Active Guidelines sidebar on Form */
.guidelines-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.guidelines-title {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
}

.rules-list li {
  font-size: 13px;
  color: #c9c9c4;
  line-height: 1.5;
  display: flex;
  gap: 10px;
}

.rules-list li::before {
  content: '✓';
  color: var(--yellow);
  font-weight: 700;
}

/* Clips Table view */
.clips-table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-header-filters {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.table-search-input {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--white);
  padding: 8px 12px;
  font-size: 13px;
  width: 240px;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.table-search-input:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px var(--yellow), 0 0 16px rgba(255, 212, 0, 0.2);
  transform: scale(1.02);
}

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

.clips-table th {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray);
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.15);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.clips-table td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: #d1d1cc;
}

.clips-table tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

.clip-title-col {
  font-weight: 600;
  color: var(--white);
}

.clip-campaign-col {
  font-size: 13px;
  color: var(--gray);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 30px;
  text-transform: uppercase;
}

.status-badge.approved {
  background: rgba(76, 175, 80, 0.08);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.status-badge.pending {
  background: rgba(255, 152, 0, 0.08);
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.2);
}

.status-badge.rejected {
  background: rgba(244, 67, 54, 0.08);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.2);
}

.status-badge.status-ativo {
  background: rgba(76, 175, 80, 0.08);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.status-badge.status-inativo {
  background: rgba(138, 138, 134, 0.08);
  color: var(--gray);
  border: 1px solid rgba(138, 138, 134, 0.2);
}

.status-badge.status-suspenso {
  background: rgba(255, 212, 0, 0.08);
  color: var(--yellow);
  border: 1px solid rgba(255, 212, 0, 0.25);
}

.status-badge.status-banido {
  background: rgba(244, 67, 54, 0.08);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.2);
}

.rejection-notice-bar {
  background: rgba(244, 67, 54, 0.05);
  border: 1px solid rgba(244, 67, 54, 0.15);
  color: #f44336;
  font-size: 12px;
  padding: 10px 14px;
  border-radius: 4px;
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

/* Leaderboard view and Podium */
.leaderboard-podium {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 40px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.podium-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--line);
  margin-bottom: 12px;
  background: var(--card);
}

.podium-place.first .podium-avatar {
  width: 80px;
  height: 80px;
  border-color: #ffd700;
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.25);
}

.podium-place.second .podium-avatar {
  border-color: #c0c0c0;
  box-shadow: 0 0 20px rgba(192, 192, 192, 0.15);
}

.podium-place.third .podium-avatar {
  border-color: #cd7f32;
  box-shadow: 0 0 16px rgba(205, 127, 50, 0.1);
}

.podium-column {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
}

.podium-place.first .podium-column {
  height: 160px;
  border-color: rgba(255, 215, 0, 0.3);
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.05), var(--panel));
}

.podium-place.second .podium-column {
  height: 120px;
}

.podium-place.third .podium-column {
  height: 100px;
}

.podium-rank-tag {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #000;
  position: absolute;
  top: -8px;
}

.podium-place.first .podium-rank-tag { background: #ffd700; }
.podium-place.second .podium-rank-tag { background: #c0c0c0; }
.podium-place.third .podium-rank-tag { background: #cd7f32; }

.podium-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
  margin-top: 4px;
}

.podium-views {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--yellow);
  margin-top: 2px;
}

/* Modal - SQL Schema Copier */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: none; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.close-btn {
  background: transparent;
  border: 0;
  color: var(--gray);
  cursor: pointer;
  font-size: 24px;
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.code-viewer-wrap {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-top: 16px;
}

.code-viewer {
  background: #000;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: #a9ffaf;
  overflow-x: auto;
  max-height: 280px;
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* Guidelines details drawer overlay */
.drawer-overlay {
  position: fixed;
  inset: 0 0 0 auto;
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
}

.drawer-overlay.active {
  transform: translateX(0);
}

/* Responsividade da Central */
@media (max-width: 960px) {
  .central-container {
    grid-template-columns: 1fr;
  }
  .central-sidebar {
    height: auto;
    position: relative;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 24px;
  }
  .central-main {
    padding: 24px;
  }
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-row, .campaigns-grid, .submit-grid {
    grid-template-columns: 1fr;
  }
}
