/* Base Design Tokens */
:root {
  --navy:  #010E38;
  --gold:  #EBB52C;
  --gelo:  #F1F4F9;
  --white: #FFFFFF;
  --green: #10B981;
  --dark-card: rgba(1, 14, 56, 0.65);
  --border-glow: rgba(235, 181, 44, 0.15);
}

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

body {
  font-family: 'Montserrat', 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(1, 14, 56, 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, 181, 44, 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, 181, 44, 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: 'Space Mono', monospace;
  font-size: 36px;
  font-weight: 700;
}

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

/* Buttons */
.btn {
  font-family: 'Montserrat', 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, 181, 44, 0.25);
}

.btn-primary:hover {
  background-color: #f7c53d;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(235, 181, 44, 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(1, 14, 56, 0.8);
  border: 1px solid rgba(241, 244, 249, 0.08);
  padding: 14px 16px;
  border-radius: 10px;
  color: var(--white);
  font-family: 'Montserrat', 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(1, 14, 56, 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, 181, 44, 0.18); color: var(--gold); border: 1px solid rgba(235, 181, 44, 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(1, 14, 56, 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);
}

/* 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(1, 14, 56, 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, 181, 44, 0.15); color: var(--gold); border: 1px solid rgba(235, 181, 44, 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); }
}
