/* Base Styles */
:root {
  --primary: #0ea5e9;
  --gradient-start: #3b82f6;
  --gradient-end: #ec4899;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --background: #f9fafb;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --radius: 0.75rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header Styles */
.header {
  text-align: center;
  margin-bottom: 2rem;
}

.title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.subtitle {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.gradient-title {
  display: inline-block;
  font-size: 2rem;
  font-weight: bold;
  background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.description {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

/* Main Content Layout */
.main-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .main-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Generator Section */
.generator-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

/* Tabs */
.tabs {
  position: relative;
}

.tabs-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.tab-trigger {
  padding: 0.75rem;
  text-align: center;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.tab-trigger.active {
  color: var(--primary);
}

.tab-indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  width: 50%;
  background: var(--primary);
  transition: transform 0.3s;
}

/* Preview Section */
.preview-section {
  position: sticky;
  top: 1rem;
}

.preview-footer {
  text-align: center;
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Form Elements */
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-upload {
  width: 100%;
  display: flex;
  justify-content: center;
}

.profile-preview {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.3s;
}

.profile-preview:hover {
  opacity: 0.8;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.upload-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Switch Toggle */
.verified-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* Input Groups */
.input-group {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.1);
}

textarea.form-input {
  resize: none;
  min-height: 100px;
}

.char-count {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Buttons */
.gradient-button {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 9999px;
  background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
  color: white;
  font-weight: 500;
  font-size: 1.125rem;
  cursor: pointer;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.gradient-button:hover {
  opacity: 0.9;
}

.gradient-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Bulk Table */
.table-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem 0;
}

.bulk-table {
  width: 100%;
  border-collapse: collapse;
}

.bulk-table th,
.bulk-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.bulk-table th {
  background: #f9fafb;
  font-weight: 500;
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.delete-button,
.download-button {
  padding: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background-color 0.3s;
}

.delete-button:hover {
  background-color: #fee2e2;
}

.download-button:hover {
  background-color: #dbeafe;
}

.icon-trash,
.icon-download {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.icon-trash {
  color: #ef4444;
}

.icon-download {
  color: #3b82f6;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  animation: slideIn 0.3s ease-out;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Preview Section */
.preview-section {
  position: sticky;
  top: 1rem;
}

.tiktok-preview {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  text-align: center;
}

.phone-frame {
  max-width: 300px;
  margin: 0 auto;
  border: 8px solid black;
  border-radius: 2rem;
  overflow: hidden;
  background: black;
  position: relative;
}

.status-bar {
  height: 24px;
  background: black;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  color: white;
  font-size: 0.75rem;
}

.tiktok-content {
  height: 600px;
  position: relative;
  overflow: hidden;
}

/* Background Slideshow */
.background-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.background-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: opacity 1s;
}

.gradient-overlay-top,
.gradient-overlay-bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
}

.gradient-overlay-top {
  top: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent);
}

.gradient-overlay-bottom {
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
}

/* Comment Bubble */
.comment-preview {
  position: absolute;
  top: 96px;
  left: 1rem;
  right: 1rem;
  z-index: 10;
}

.comment-bubble {
  background: white;
  border-radius: 1rem;
  padding: 0.75rem;
  max-width: 85%;
  position: relative;
}

.reply-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.comment-content {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.profile-pic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #f3f4f6;
  flex-shrink: 0;
}

.profile-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.text-content {
  flex: 1;
  font-size: 0.875rem;
}

.username-display {
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.verified-badge {
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 8px;
}

.bubble-pointer {
  position: absolute;
  bottom: -8px;
  left: 1rem;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid white;
}

/* Side Actions */
.side-actions {
  position: absolute;
  right: 0.5rem;
  bottom: 7rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: white;
}

.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.action-button {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.action-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

.action-button.like.active svg {
  fill: #ff2c55;
  stroke: #ff2c55;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .title,
  .subtitle {
    font-size: 2rem;
  }

  .gradient-title {
    font-size: 1.5rem;
  }

  .preview-section {
    position: static;
  }
}

@media (max-width: 480px) {
  .tabs-list {
    font-size: 0.875rem;
  }

  .bulk-table th,
  .bulk-table td {
    padding: 0.5rem;
    font-size: 0.875rem;
  }

  .action-buttons {
    flex-direction: column;
  }
}

/* Updated Button Styles */
.bulk-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bulk-actions .gradient-button {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  height: auto;
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-count {
  padding: 0.5rem 1rem;
  background: var(--background);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.new-row-button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  background: white;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.new-row-button:hover {
  background: var(--background);
}

.new-row-button svg {
  width: 16px;
  height: 16px;
}