/* ==========================================
   DESIGN SYSTEM & THEME VARIABLES
   ========================================== */
:root {
  --font-primary: 'Outfit', sans-serif;
  --font-heading: 'Plus Jakarta Sans', sans-serif;

  /* Color Palette (Deep Dark Theme) */
  --bg-app: #08090d;
  --bg-card: rgba(18, 20, 29, 0.7);
  --bg-card-hover: rgba(26, 28, 41, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #5f5ce6;
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Accent Colors */
  --color-primary: #6366f1; /* Indigo */
  --color-primary-glow: rgba(99, 102, 241, 0.15);
  --color-secondary: #06b6d4; /* Cyan */
  --color-success: #10b981; /* Green */
  
  /* Shadow & Blur System */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --blur-amount: 12px;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --transition-speed: 0.2s;
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

/* ==========================================
   AD CONTAINERS (ADSENSE)
   ========================================== */
.ad-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(18, 20, 29, 0.4);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  margin: 20px auto;
  padding: 10px;
  max-width: 1200px;
  text-align: center;
}

.ad-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.top-ad {
  min-height: 100px;
  margin-top: 15px;
}

.footer-ad {
  min-height: 120px;
  margin-bottom: 30px;
}

.sidebar-ad-placement {
  display: none; /* Hidden on small screens, shown in media queries */
}

/* ==========================================
   COMMON COMPONENTS
   ========================================== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  transition: transform var(--transition-speed) ease, border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-lg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  font-family: var(--font-primary);
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn:active {
  transform: translateY(1px);
}

/* ==========================================
   LAYOUT
   ========================================== */
.app-header {
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(8, 9, 13, 0.8);
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.logo svg {
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-speed);
}

.nav-links a:hover {
  color: var(--color-primary);
}

.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.app-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 992px) {
  .app-container {
    grid-template-columns: 420px 1fr;
  }
}

/* ==========================================
   INPUT PANEL (LEFT COLUMN)
   ========================================== */
.input-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-primary);
}

.panel-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: -8px;
  margin-bottom: 8px;
}

.form-group {
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input, textarea, select {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(95, 92, 230, 0.2);
}

.char-counter {
  display: flex;
  justify-content: flex-end;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.char-counter .limit-exceeded {
  color: #ef4444;
}

/* ==========================================
   PREVIEW PANEL (RIGHT COLUMN)
   ========================================== */
.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.preview-card {
  padding: 0;
}

.preview-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 0 24px;
  border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
  .preview-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
  }
}

.tabs-container {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--border-color);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-speed);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

.preview-body {
  padding: 24px;
}

.tab-content {
  display: none;
}

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

/* ==========================================
   SOCIAL CARD MOCKUPS
   ========================================== */

/* 1. Google Mockup */
.google-mockup {
  background: #ffffff;
  color: #202124;
  padding: 20px;
  border-radius: var(--radius-md);
  font-family: arial, sans-serif;
  box-shadow: var(--shadow-sm);
}

.google-logo {
  font-size: 0.85rem;
  color: #5f6368;
  font-weight: bold;
  margin-bottom: 10px;
  border-bottom: 1px solid #e8eaed;
  padding-bottom: 8px;
}

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

.google-breadcrumb {
  font-size: 0.875rem;
  color: #202124;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.google-url-text {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.google-breadcrumb-arrow {
  color: #70757a;
}

.google-title {
  color: #1a0dab;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 400;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.google-title:hover {
  text-decoration: underline;
}

.google-snippet {
  color: #4d5156;
  font-size: 0.875rem;
  line-height: 1.58;
  word-wrap: break-word;
}

/* 2. Facebook Mockup */
.facebook-mockup {
  background: #ffffff;
  color: #050505;
  border-radius: var(--radius-md);
  font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
  border: 1px solid #ced0d4;
  overflow: hidden;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

.fb-header {
  display: flex;
  align-items: center;
  padding: 12px;
  position: relative;
}

.fb-avatar {
  width: 40px;
  height: 40px;
  background-color: #6366f1;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  margin-right: 8px;
}

.fb-user-info {
  display: flex;
  flex-direction: column;
}

.fb-user-name {
  font-weight: 600;
  font-size: 0.93rem;
  color: #050505;
  cursor: pointer;
}

.fb-user-name:hover {
  text-decoration: underline;
}

.fb-post-time {
  font-size: 0.8rem;
  color: #65676b;
}

.fb-more-icon {
  position: absolute;
  right: 12px;
  color: #65676b;
  cursor: pointer;
}

.fb-post-text {
  padding: 0 12px 12px 12px;
  font-size: 0.93rem;
}

.fb-card {
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  cursor: pointer;
}

.fb-card-image-wrapper {
  aspect-ratio: 1.91 / 1;
  background-color: #f0f2f5;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.fb-card-text {
  background-color: #f0f2f5;
  padding: 12px;
}

.fb-card-domain {
  font-size: 0.75rem;
  color: #65676b;
  text-transform: uppercase;
}

.fb-card-title {
  font-weight: 600;
  font-size: 1rem;
  color: #050505;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fb-card-desc {
  font-size: 0.875rem;
  color: #65676b;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 3. Twitter/X Mockup */
.twitter-mockup {
  background: #000000;
  color: #e7e9ea;
  border-radius: var(--radius-md);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  border: 1px solid #2f3336;
  padding: 12px 16px;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

.tw-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.tw-avatar {
  width: 40px;
  height: 40px;
  background-color: #06b6d4;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 8px;
}

.tw-user-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.93rem;
}

.tw-display-name {
  font-weight: 700;
  color: #e7e9ea;
}

.tw-username {
  color: #71767b;
}

.tw-dot, .tw-post-time {
  color: #71767b;
}

.tw-post-text {
  font-size: 0.93rem;
  margin-bottom: 12px;
}

.tw-card {
  border: 1px solid #2f3336;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: background-color 0.2s;
}

.tw-card:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Twitter Large Card Variant */
.tw-card-image-wrapper {
  aspect-ratio: 1.91 / 1;
  background-color: #16181c;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tw-card-text {
  padding: 12px;
}

.tw-card-domain {
  font-size: 0.85rem;
  color: #71767b;
}

.tw-card-title {
  font-size: 0.93rem;
  font-weight: 700;
  color: #e7e9ea;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tw-card-desc {
  font-size: 0.85rem;
  color: #71767b;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Twitter Small Card Variant */
.tw-card.summary-card {
  display: flex;
  align-items: stretch;
  height: 120px;
}

.tw-card-image-wrapper-small {
  width: 120px;
  flex-shrink: 0;
  background-color: #16181c;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #2f3336;
}

.preview-img-small {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tw-card-text-small {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.tw-card-domain-small {
  font-size: 0.8rem;
  color: #71767b;
}

.tw-card-title-small {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e7e9ea;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tw-card-desc-small {
  font-size: 0.8rem;
  color: #71767b;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* 4. LinkedIn Mockup */
.linkedin-mockup {
  background: #ffffff;
  color: rgba(0, 0, 0, 0.9);
  border-radius: var(--radius-md);
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif;
  border: 1px solid #e0e0e0;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.li-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
}

.li-avatar {
  width: 48px;
  height: 48px;
  background-color: #0077b5;
  color: #ffffff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
  margin-right: 12px;
}

.li-user-info {
  display: flex;
  flex-direction: column;
}

.li-user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.li-user-headline {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.6);
}

.li-post-time {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.6);
}

.li-post-text {
  padding: 0 16px 12px 16px;
  font-size: 0.875rem;
}

.li-card {
  background-color: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
}

.li-card-image-wrapper {
  aspect-ratio: 1.91 / 1;
  background-color: #ececec;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.li-card-text {
  padding: 12px 16px;
}

.li-card-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.9);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.li-card-domain {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.6);
  margin-top: 4px;
}

/* 5. Discord Mockup */
.discord-mockup {
  background: #36393f;
  color: #dcddde;
  border-radius: var(--radius-md);
  font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  padding: 16px;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

.discord-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.discord-avatar {
  width: 40px;
  height: 40px;
  background-color: #5865f2;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.75rem;
  margin-right: 16px;
}

.discord-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.discord-bot-name {
  font-weight: 500;
  color: #ffffff;
  font-size: 1rem;
}

.discord-bot-tag {
  background-color: #5865f2;
  color: #ffffff;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
}

.discord-timestamp {
  font-size: 0.75rem;
  color: #72767d;
}

.discord-embed {
  display: flex;
  max-width: 520px;
  background: #2f3136;
  border-radius: 4px;
  overflow: hidden;
}

.discord-embed-border {
  width: 4px;
  background-color: var(--color-primary); /* dynamic embed color */
  flex-shrink: 0;
}

.discord-embed-content {
  padding: 8px 16px 16px 12px;
  flex: 1;
}

.discord-embed-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 480px) {
  .discord-embed-grid {
    grid-template-columns: 1fr 80px;
  }
}

.discord-embed-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.discord-embed-provider {
  font-size: 0.75rem;
  color: #b9bbbe;
}

.discord-embed-title {
  font-size: 1rem;
  font-weight: 600;
}

.discord-embed-title a {
  color: #00aff4;
  text-decoration: none;
}

.discord-embed-title a:hover {
  text-decoration: underline;
}

.discord-embed-desc {
  font-size: 0.875rem;
  color: #dcddde;
}

.discord-embed-image-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  overflow: hidden;
  justify-self: end;
}

.discord-embed-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================
   CODE GENERATION CARD (OUTPUT)
   ========================================== */
.code-card {
  padding: 0;
  border-color: rgba(99, 102, 241, 0.2);
}

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

.btn-copy {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-focus);
  box-shadow: 0 0 10px rgba(95, 92, 230, 0.2);
}

.btn-copy.copied {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.code-body {
  background-color: rgba(0, 0, 0, 0.3);
  padding: 20px 24px;
  max-height: 300px;
  overflow-y: auto;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

pre {
  margin: 0;
}

code {
  font-family: 'Consolas', 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: var(--color-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ==========================================
   FOOTER
   ========================================== */
.app-footer {
  border-top: 1px solid var(--border-color);
  background-color: #08090d;
  padding: 24px;
  margin-top: 48px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0 8px;
  transition: color var(--transition-speed);
}

.footer-links a:hover {
  color: var(--color-primary);
}

/* ==========================================
   RESPONSIVE LAYOUT EXTRA MEDIA QUERY
   ========================================== */
@media (min-width: 1400px) {
  /* Show sidebar ad on ultra-wide screens */
  body {
    display: flex;
    justify-content: center;
  }
  
  .app-header, .app-footer, .top-ad, .footer-ad {
    width: 100%;
    max-width: 1200px;
  }
  
  .sidebar-ad-placement {
    display: block;
    position: fixed;
    right: calc(50% - 780px);
    top: 120px;
    width: 160px;
  }
  
  .sticky-ad {
    position: sticky;
    top: 120px;
    min-height: 600px;
  }
}
