/* X Dashboard Styles */

/* Local Mode Banner */
.local-mode-banner {
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.2), rgba(241, 196, 15, 0.2));
  border: 1px solid rgba(243, 156, 18, 0.4);
  border-left: 4px solid #f39c12;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  animation: slideDown 0.3s ease;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.banner-content i {
  font-size: 1.5rem;
  color: #f39c12;
  flex-shrink: 0;
}

.banner-content > div {
  flex: 1;
  min-width: 200px;
}

.banner-content strong {
  color: #f39c12;
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

.banner-content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.banner-content .btn {
  flex-shrink: 0;
}

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

/* Login Page Styles */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-card {
  background: linear-gradient(135deg, rgba(26, 42, 94, 0.9), rgba(10, 14, 31, 0.9));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 3rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.login-header {
  margin-bottom: 2rem;
}

.login-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 24px rgba(59, 94, 219, 0.4);
}

.login-header h1 {
  color: #FFD166;
  margin-bottom: 0.5rem;
  font-size: 2rem;
}

.login-header p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.login-content {
  margin: 2rem 0;
}

.login-loading,
.login-prompt,
.login-success {
  padding: 2rem;
}

.login-loading i {
  font-size: 2rem;
  color: #FFD166;
  margin-bottom: 1rem;
}

.login-prompt h2,
.login-success h2 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.login-prompt p,
.login-success p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.login-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(52, 152, 219, 0.1);
  border: 1px solid rgba(52, 152, 219, 0.3);
  border-radius: var(--radius-md);
}

.login-info i {
  color: #3498db;
  font-size: 1.25rem;
}

.login-info p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.login-footer {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

/* Dashboard Layout */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(26, 42, 94, 0.7), rgba(59, 94, 219, 0.3));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: 1.5rem;
}

.header-info h2 {
  margin: 0 0 0.5rem 0;
  color: #FFD166;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.75rem;
}

.header-info p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
}

.header-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  position: relative;
}

/* API Status Card */
.api-status-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background: rgba(10, 14, 31, 0.6);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 2rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.status-indicator i {
  font-size: 0.75rem;
}

#api-status-icon.connected {
  color: #27ae60;
}

#api-status-icon.disconnected {
  color: #e74c3c;
}

#api-status-icon.loading {
  color: #f39c12;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-actions {
  display: flex;
  gap: 1rem;
}

/* Week Overview */
.week-overview {
  margin-bottom: 2rem;
}

.week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
}

.week-header h3 {
  margin: 0;
  color: #FFD166;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.automation-indicator {
  flex: 1 1 100%;
  margin-top: 1rem;
}

.automation-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.automation-badge.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
  border: 2px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.automation-badge.inactive {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.2) 0%, rgba(75, 85, 99, 0.2) 100%);
  border: 2px solid rgba(107, 114, 128, 0.3);
  color: #9ca3af;
}

.automation-badge i {
  font-size: 1.25rem;
}

.automation-badge span {
  font-size: 1rem;
}

.automation-times {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-left: 0.5rem;
}

.automation-badge small {
  font-size: 0.8rem;
  opacity: 0.8;
  font-weight: 400;
  margin-left: 0.5rem;
}

.week-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.week-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(135deg, rgba(26, 42, 94, 0.5), rgba(10, 14, 31, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 209, 102, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #FFD166;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Schedule Grid */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.day-card {
  background: linear-gradient(135deg, rgba(26, 42, 94, 0.4), rgba(10, 14, 31, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
}

.day-card:hover {
  border-color: rgba(255, 209, 102, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.day-header {
  padding: 1.25rem;
  background: rgba(59, 94, 219, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.day-header h4 {
  margin: 0;
  color: #FFD166;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.day-date {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: normal;
}

.add-post-btn {
  background: rgba(59, 94, 219, 0.3);
  border: 1px solid rgba(59, 94, 219, 0.5);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.add-post-btn:hover {
  background: rgba(59, 94, 219, 0.5);
  transform: scale(1.05);
}

.posts-container {
  padding: 1rem;
  min-height: 150px;
  max-height: 500px;
  overflow-y: auto;
}

.post-item {
  background: rgba(10, 14, 31, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid #FFD166;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.post-item:hover {
  border-color: rgba(255, 209, 102, 0.5);
  transform: translateX(4px);
}

.post-item.auto-post {
  border-left-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(10, 14, 31, 0.6) 100%);
}

.auto-post-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  }
  50% {
    box-shadow: 0 2px 16px rgba(16, 185, 129, 0.6);
  }
}

.auto-post-badge i {
  font-size: 0.85rem;
}

.post-item.draft {
  border-left-color: #95a5a6;
  opacity: 0.8;
}

.post-item.scheduled {
  border-left-color: #3498db;
}

.post-item.posted {
  border-left-color: #27ae60;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.post-time {
  font-weight: 600;
  color: #FFD166;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-status {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.post-status.draft {
  background: rgba(149, 165, 166, 0.2);
  color: #95a5a6;
}

.post-status.scheduled {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
}

.post-status.posted {
  background: rgba(39, 174, 96, 0.2);
  color: #27ae60;
}

.post-status.failed {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

.post-preview {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.post-category {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.post-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-actions button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  font-size: 0.85rem;
}

.post-actions button:hover {
  color: #FFD166;
  background: rgba(255, 209, 102, 0.1);
}

.empty-day {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  padding: 2rem 1rem;
  font-style: italic;
}

/* Content Library Sidebar */
.content-library {
  position: fixed;
  right: -450px;
  top: 0;
  width: 450px;
  height: 100vh;
  background: linear-gradient(135deg, rgba(10, 14, 31, 0.98), rgba(26, 42, 94, 0.98));
  backdrop-filter: blur(10px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 1001;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.content-library.active {
  right: 0;
}

.library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.library-header h3 {
  margin: 0;
  color: #FFD166;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.library-tabs {
  display: flex;
  padding: 0.5rem;
  background: rgba(10, 14, 31, 0.5);
  gap: 0.25rem;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.tab-btn.active {
  background: rgba(59, 94, 219, 0.3);
  color: #FFD166;
}

.library-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.library-item {
  background: rgba(26, 42, 94, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.library-item:hover {
  border-color: rgba(255, 209, 102, 0.4);
  transform: translateX(-4px);
}

.library-item-title {
  font-weight: 600;
  color: #FFD166;
  margin-bottom: 0.5rem;
}

.library-item-preview {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.library-item-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Modal System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  overflow-y: auto;
}

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

.modal {
  background: linear-gradient(135deg, rgba(26, 42, 94, 0.95), rgba(15, 15, 30, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
  position: relative;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  color: #FFD166;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
}

.modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  font-size: 1rem;
}

.modal-close:hover {
  background: rgba(255, 77, 77, 0.2);
  border-color: rgba(255, 77, 77, 0.3);
  color: #ff4d4d;
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Post Editor Modal */
.post-editor-modal {
  max-width: 700px;
  width: 90%;
}

.post-editor-modal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

.post-type-selector {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.type-btn {
  flex: 1;
  padding: 0.75rem;
  background: rgba(26, 42, 94, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.type-btn:hover {
  border-color: rgba(255, 209, 102, 0.3);
  background: rgba(26, 42, 94, 0.6);
}

.type-btn.active {
  border-color: #FFD166;
  background: rgba(255, 209, 102, 0.1);
  color: #FFD166;
}

.type-btn i {
  font-size: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: rgba(10, 14, 31, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #FFD166;
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.1);
}

.form-group textarea {
  resize: vertical;
  font-size: 1rem;
  line-height: 1.5;
}

.form-group small {
  display: block;
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.char-counter {
  text-align: right;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.5rem;
}

.char-counter.warning {
  color: #f39c12;
}

.char-counter.danger {
  color: #e74c3c;
}

.thread-posts {
  margin-bottom: 1rem;
}

.thread-post-item {
  background: rgba(10, 14, 31, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid #FFD166;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.thread-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.thread-post-number {
  color: #FFD166;
  font-weight: 600;
}

.remove-thread-btn {
  background: transparent;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.remove-thread-btn:hover {
  background: rgba(231, 76, 60, 0.1);
}

/* User Menu Dropdown */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, rgba(26, 42, 94, 0.98), rgba(15, 15, 30, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  min-width: 280px;
  display: none;
  flex-direction: column;
  z-index: 10000;
  animation: dropdownSlideIn 0.2s ease;
}

.user-dropdown.show {
  display: flex;
}

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

.user-menu-header {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-menu-header i {
  font-size: 2.5rem;
  color: #FFD166;
}

.user-menu-header div {
  flex: 1;
}

.user-menu-header strong {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.user-menu-header small {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.user-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0;
}

.user-menu-item {
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.user-menu-item:hover {
  background: rgba(255, 209, 102, 0.1);
  color: #FFD166;
}

.user-menu-item i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.user-menu-item span {
  flex: 1;
  font-weight: 500;
}

.user-menu-item small {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.25rem;
}

.user-menu-item:last-child {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.user-menu-item:last-child:hover {
  background: rgba(255, 77, 77, 0.1);
  color: #ff4d4d;
}

/* Settings Modal */
.settings-modal {
  max-width: 600px;
}

.settings-info {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: rgba(52, 152, 219, 0.1);
  border: 1px solid rgba(52, 152, 219, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.settings-info i {
  color: #3498db;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Floating Settings Button */
.floating-settings-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B5EDB, #7B5EDB);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(59, 94, 219, 0.4);
  transition: all 0.3s ease;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.floating-settings-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 32px rgba(59, 94, 219, 0.6);
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  color: white;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 10000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: slideInRight 0.3s ease;
}

.toast-success {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.toast-error {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.toast-info {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .schedule-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 992px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .header-actions .btn {
    flex: 1;
  }

  .week-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-library {
    width: 100%;
    right: -100%;
  }
}

@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .header-actions .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.9rem;
    padding: 0.6rem;
  }

  /* Make user menu button full width on its own row if needed, or part of grid */
  #user-menu-btn {
    grid-column: span 2;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .dashboard-tabs {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: flex-start;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  
  .dashboard-tabs::-webkit-scrollbar {
    display: none;
  }

  .dashboard-tab {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.8rem 1.2rem;
  }

  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .week-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .post-editor-modal,
  .settings-modal {
    width: 95%;
    max-height: 85vh;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-footer {
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .floating-settings-btn {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .header-info h2 {
    font-size: 1.35rem;
  }

  .week-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .api-status-card {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ===================================
   AUTOMATION CONFIGURATION STYLES
   =================================== */

/* Automation Status Card */
.automation-status-card {
  background: linear-gradient(135deg, rgba(59, 94, 219, 0.15) 0%, rgba(255, 209, 102, 0.15) 100%);
  backdrop-filter: blur(16px);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.status-header h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.4rem;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
}

.status-item.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.15) 100%);
  border-color: rgba(16, 185, 129, 0.4);
}

.status-item.inactive {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.15) 0%, rgba(75, 85, 99, 0.15) 100%);
  border-color: rgba(107, 114, 128, 0.3);
  opacity: 0.7;
}

.status-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.status-item.active .status-icon {
  color: #10b981;
  animation: pulse 2s infinite;
}

.status-item.inactive .status-icon {
  color: #6b7280;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.status-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.status-info strong {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.95);
  display: block;
}

.status-label {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
  margin-top: 0.25rem;
}

.status-item.active .status-label {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-item.inactive .status-label {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

.status-info small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.status-note {
  background: rgba(59, 94, 219, 0.1);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.status-note i {
  color: var(--primary-color);
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.status-note p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  line-height: 1.6;
}

.status-note strong {
  color: var(--accent-color);
}

.dashboard-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 2rem 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0;
}

.dashboard-tab {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-tab:hover {
  color: rgba(255, 255, 255, 0.9);
}

.dashboard-tab.active {
  color: var(--accent-color);
}

.dashboard-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-color);
}

.dashboard-views {
  margin-top: 2rem;
}

.dashboard-view {
  display: none;
}

.dashboard-view.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

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

.automation-header,
.analytics-header {
  margin-bottom: 2rem;
}

.automation-header h3,
.analytics-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.automation-header p,
.analytics-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.05rem;
}

.placeholder-content {
  background: rgba(30, 32, 38, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
}

.placeholder-content p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
  margin-top: 1.5rem;
}

.automation-config {
  max-width: 900px;
  margin: 0 auto;
}

.config-section {
  background: linear-gradient(135deg, rgba(30, 32, 38, 0.7) 0%, rgba(20, 22, 28, 0.7) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.config-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.config-section:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.config-section:hover::before {
  opacity: 1;
}

.config-section h3 {
  margin: 0 0 2rem 0;
  font-size: 1.5rem;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.config-option {
  margin-bottom: 2rem;
}

.config-option:last-child {
  margin-bottom: 0;
}

.config-option > label:not(.toggle-label) {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.config-option input[type="number"],
.config-option input[type="time"],
.config-option input[type="url"],
.config-option input[type="password"],
.config-option input[type="text"],
.config-option select,
.config-option textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.95rem;
  transition: all var(--transition-normal);
}

.config-option input:focus,
.config-option select:focus,
.config-option textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(59, 94, 219, 0.1);
}

.config-option textarea {
  resize: vertical;
  font-family: inherit;
}

.config-option small {
  display: block;
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.config-option small a {
  color: var(--primary-color);
  text-decoration: none;
}

.config-option small a:hover {
  text-decoration: underline;
}

/* Toggle Switch - Enhanced */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0 !important;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-normal);
}

.toggle-label:hover {
  background: rgba(255, 255, 255, 0.03);
}

.toggle-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.toggle-slider {
  position: relative;
  width: 54px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--primary-color) 0%, #2d4ab8 100%);
  border-color: var(--primary-color);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 12px rgba(59, 94, 219, 0.3);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
  transform: translateX(26px);
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.toggle-label:hover .toggle-slider {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.toggle-label input[type="checkbox"]:checked:hover + .toggle-slider {
  background: linear-gradient(135deg, #4a6edb 0%, #3558c7 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 16px rgba(59, 94, 219, 0.5);
}

.toggle-label input[type="checkbox"]:focus + .toggle-slider {
  outline: 2px solid rgba(59, 94, 219, 0.5);
  outline-offset: 2px;
}

.toggle-label span:not(.toggle-slider) {
  font-weight: 600;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.95);
}

/* Time Inputs */
.time-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.time-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
}

.time-input-wrapper:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.time-inputs input[type="time"] {
  width: 150px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 0.5rem;
  color: white;
  font-size: 1rem;
  font-weight: 600;
}

.time-inputs input[type="time"]:focus {
  outline: none;
  box-shadow: none;
}

.btn-remove-time {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove-time:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
  transform: scale(1.1);
}

.btn-sm {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-sm i {
  font-size: 0.85rem;
}

/* Config Hint */
.config-hint {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(59, 94, 219, 0.1) 0%, rgba(255, 209, 102, 0.1) 100%);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--radius-md);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.config-hint i {
  color: var(--accent-color);
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.config-hint p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Config Actions */
.config-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.config-actions button {
  flex: 1;
  min-width: 200px;
  font-size: 1rem;
  font-weight: 600;
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

.btn-danger:active {
  transform: translateY(0);
}

/* Notification Animation */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .automation-config {
    padding: 1rem;
  }

  .config-section {
    padding: 1.5rem;
  }

  .config-section h3 {
    font-size: 1.25rem;
  }

  .automation-status-card {
    padding: 1.5rem;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .status-item {
    flex-direction: column;
    text-align: center;
  }

  .automation-badge {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    padding: 0.75rem 1rem;
  }

  .automation-times {
    margin-left: 0;
    margin-top: 0.5rem;
  }

  .time-inputs {
    flex-direction: column;
    align-items: stretch;
  }

  .time-input-wrapper {
    width: 100%;
  }

  .time-inputs input[type="time"] {
    width: 100%;
  }

  .config-actions {
    flex-direction: column;
  }

  .config-actions button {
    width: 100%;
    min-width: unset;
  }

  .week-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .automation-indicator {
    width: 100%;
  }

  .automation-badge {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .config-section {
    padding: 1.25rem;
  }

  .config-section h3 {
    font-size: 1.1rem;
    flex-wrap: wrap;
  }

  .toggle-label {
    font-size: 0.9rem;
  }

  .automation-status-card {
    padding: 1.25rem;
  }

  .status-header h3 {
    font-size: 1.1rem;
  }

  .auto-post-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }
}

/* Thread Post Styles */
#thread-container {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(99, 102, 241, 0.05);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: 8px;
}

.thread-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.thread-post-item {
  background: rgba(26, 42, 94, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 8px;
  padding: 1rem;
  position: relative;
}

.thread-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.thread-post-header span {
  font-weight: 600;
  color: #6366f1;
  font-size: 0.875rem;
}

.thread-post-item .btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #2054ad;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.thread-post-item .btn-icon:hover {
  background: #fee2e2;
  color: #ef4444;
}

.thread-post-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #606570;
  background: rgb(14, 17, 46);
  border-radius: 6px;
  color: white;
  font-size: 0.875rem;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s;
}

.thread-post-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.thread-post-item .char-count {
  margin-top: 0.5rem;
  text-align: right;
  font-size: 0.75rem;
  color: #6b7280;
}

/* Thread Media Styles */
.thread-media-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.thread-media-upload {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.thread-media-upload .btn {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
}

.thread-media-preview {
  margin-top: 0.5rem;
}

.thread-media-preview .media-preview-item {
  position: relative;
  display: inline-block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.thread-media-preview img,
.thread-media-preview video {
  max-width: 200px;
  max-height: 150px;
  object-fit: cover;
  display: block;
}

.thread-media-preview .remove-media-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.thread-media-preview .remove-media-btn:hover {
  background: rgba(239, 68, 68, 0.9);
}

#add-thread-btn {
  width: 100%;
  padding: 0.75rem;
  background: rgba(26, 42, 94, 0.5);
  border: 2px dashed rgba(99, 102, 241, 0.4);
  color: #8ab4ff;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

#add-thread-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.75);
}

#add-thread-btn i {
  margin-right: 0.5rem;
}

/* Media Upload Preview */
.media-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.media-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

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

.media-preview-item .remove-media {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}

.media-preview-item .remove-media:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.existing-media-preview {
 display: flex;
 gap: 1rem;
 margin-bottom: 1rem;
 flex-wrap: wrap;
}

.media-preview-item {
 position: relative;
 width: 100px;
 height: 100px;
 border-radius: 8px;
 overflow: hidden;
 border: 1px solid rgba(255, 255, 255, 0.1);
}

.media-preview-item img,
.media-preview-item video {
 width: 100%;
 height: 100%;
 object-fit: cover;
}

.media-preview-item .remove-media-btn {
 position: absolute;
 top: 4px;
 right: 4px;
 background: rgba(0, 0, 0, 0.7);
 color: #fff;
 border: none;
 border-radius: 50%;
 width: 24px;
 height: 24px;
 display: flex;
 align-items: center;
 justify-content: center;
 cursor: pointer;
 font-size: 12px;
 transition: background 0.2s;
}

.media-preview-item .remove-media-btn:hover {
 background: rgba(239, 68, 68, 0.9);
}


.media-preview-item .remove-media-btn i {
 pointer-events: none;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .post-editor-modal {
    width: 95%;
    margin: 0 auto;
  }
  
  .post-type-selector {
    flex-wrap: wrap;
  }
  
  .type-btn {
    flex: 1 1 30%;
    min-width: 80px;
  }
}

@media (max-width: 480px) {
  .post-editor-modal {
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  
  .post-editor-modal .modal-body {
    flex: 1;
    max-height: none; /* Let flex handle it */
  }
  
  .modal-header, .modal-footer {
    padding: 1rem;
  }
  
  .type-btn {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
  
  .form-row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  /* Improve touch targets */
  .btn, .nav-link, .dashboard-tab {
    min-height: 44px;
  }
  
  /* Adjust grid for very small screens */
  .schedule-grid {
    gap: 1rem;
  }
  
  .day-card {
    margin-bottom: 1rem;
  }
}



/* Media Gallery Styles */
.media-gallery-modal .modal-body {
  padding: 1.5rem;
}

.gallery-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-tabs {
  display: flex;
  gap: 0.5rem;
}

.media-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  aspect-ratio: 1;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.gallery-item:hover {
  transform: scale(1.02);
  border-color: #FFD166;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-delete-btn {
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
}

.gallery-item:hover .gallery-delete-btn {
  opacity: 1;
}

.gallery-delete-btn:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

.gallery-delete-btn:active {
  transform: scale(0.95) !important;
}

.loading-spinner,
.empty-state,
.error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: rgba(255, 255, 255, 0.6);
}

.loading-spinner i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #FFD166;
}

/* Template Editor Modal */
.template-editor-modal {
  max-width: 600px;
  width: 90%;
  z-index: 2001;
}

.modal-overlay {
  z-index: 2000;
}

/* Footer Fix for Templates View */
.dashboard-view {
  min-height: 60vh;
  padding-bottom: 2rem;
}

#templates-view {
  display: none;
}

#templates-view.active {
  display: block;
}

.templates-grid {
  margin-bottom: 2rem;
}

/* Modal Visibility Fixes */
.modal, .post-editor-modal, .template-editor-modal, .media-gallery-modal, .post-details-modal {
  z-index: 10000 !important;
  padding-top: 60px;
}

.modal-overlay {
  z-index: 9999 !important;
  padding-top: 80px;
  align-items: flex-start;
  overflow-y: auto;
}

.modal-close, .close-modal-btn {
  z-index: 10001 !important;
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Analytics View Styles */
#analytics-view {
  padding: 1rem;
}

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.date-range-selector select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.metric-icon {
  font-size: 1.5rem;
  color: #00d4ff;
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.25rem;
}

.metric-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.charts-container {
  margin-bottom: 2rem;
}

.chart-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  height: 500px; /* Fixed height for stability */
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Prevent overflow */
}

@media (max-width: 768px) {
  .chart-card {
    height: 500px; /* Ensure enough space on mobile */
    padding: 1rem;
  }
}

.chart-card canvas {
  flex: 1;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
}

.chart-card h4 {
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.top-posts-section {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  overflow: hidden; /* Prevent children from spilling out */
}

.top-posts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%; /* Ensure full width */
}

.top-post-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  max-width: 100%; /* Prevent overflow */
}

.post-content {
  flex: 1;
  margin-right: 2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.9);
  min-width: 0; /* Critical for flex child truncation */
}

.post-stats {
  display: flex;
  gap: 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.post-stats span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.post-stats i {
  color: #00d4ff;
}

@media (max-width: 768px) {
  .top-post-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .post-content {
    margin-right: 0;
    white-space: normal;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  
  .post-stats {
    width: 100%;
    justify-content: space-between;
  }
  
  .analytics-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .date-range-selector {
    width: 100%;
  }
  
  .date-range-selector select {
    width: 100%;
  }
}

/* Month View Styles */
.schedule-grid.month-view {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.month-day {
  background: var(--bg-dark);
  min-height: 100px;
  padding: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
}

.month-day:hover {
  background: rgba(255, 255, 255, 0.05);
}

.month-day.empty {
  background: rgba(0, 0, 0, 0.2);
  cursor: default;
}

.month-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.day-number {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.post-count-badge {
  background: rgba(0, 212, 255, 0.2);
  color: #00d4ff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
}

.month-day-content {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}

.month-post-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
}

.month-post-dot.draft { background: #9ca3af; }
.month-post-dot.scheduled { background: #f59e0b; }
.month-post-dot.posted { background: #10b981; }
.month-post-dot.failed { background: #ef4444; }

.month-more-posts {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 2px;
}

/* Calendar Controls */
.calendar-controls {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 8px;
}

.view-toggle .btn {
  border: none;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
}

.view-toggle .btn.active {
  background: var(--accent-blue);
  color: white;
}

.view-toggle .btn-secondary {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: none;
}

.view-toggle .btn-secondary:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.calendar-nav {
  display: flex;
  align-items: center;
}

/* Month View Tooltip Styles */
.post-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 220px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.month-post-dot:hover .post-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

/* Tooltip Arrow */
.post-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.98) transparent transparent transparent;
}

.tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-time {
  font-size: 0.75rem;
  color: #FFD166;
  font-weight: 600;
}

.tooltip-type {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

.tooltip-content {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
}

.tooltip-footer {
  display: flex;
  justify-content: flex-end;
}

.tooltip-status {
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.tooltip-status.scheduled { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.tooltip-status.posted { background: rgba(39, 174, 96, 0.2); color: #27ae60; }
.tooltip-status.draft { background: rgba(149, 165, 166, 0.2); color: #95a5a6; }
.tooltip-status.failed { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }


/* AI Assistant Toolbar */
.ai-assistant-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-controls-left,
.ai-controls-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ai-select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

.ai-select:focus {
  border-color: var(--accent-color);
}

.btn-ai {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

.btn-ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.5);
  filter: brightness(1.1);
}

.btn-ai:active {
  transform: translateY(0);
}

.btn-ai-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-ai-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.ai-status-msg {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-status-msg.loading {
  color: #FFD166;
  background: rgba(255, 209, 102, 0.1);
}

.ai-status-msg.error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.ai-status-msg.success {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

/* Animation for magic button icon */
.btn-ai:hover i {
  animation: magic-sparkle 1s infinite;
}

@keyframes magic-sparkle {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(15deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Time Input Group */
.time-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.time-input-group input {
  flex: 1;
}

.btn-suggest-time {
  background: rgba(59, 94, 219, 0.2);
  border: 1px solid rgba(59, 94, 219, 0.4);
  color: #FFD166;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-suggest-time:hover {
  background: rgba(59, 94, 219, 0.4);
  transform: translateY(-1px);
}

.btn-suggest-time i {
  font-size: 0.8rem;
}

/* Chat Agent & Brand Hub Styles */
/* Chat agent styles moved to /css/chat-agent.css */

/* Brand Hub Header */
.brand-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-hub-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: #fff;
}

.brand-hub-header p {
  margin: 0.25rem 0 0 0;
  color: rgba(255, 255, 255, 0.6);
}

.brand-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.brand-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.brand-card .card-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-card .card-body {
  padding: 1.25rem;
}

.brand-card textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: white;
  padding: 1rem;
  resize: vertical;
  font-family: inherit;
  margin-bottom: 0.5rem;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Partner Reorganization Styles */
.partner-group {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.partner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.partner-header h5 {
  margin: 0;
  font-size: 0.9rem;
  color: #FFD166;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 0.5rem;
}

.partner-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.partner-main-link {
  padding: 0.6rem 0.8rem;
  word-break: break-word;
}

.partner-other-links {
  padding: 0 0.8rem 0.8rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  margin-top: 0.4rem;
  padding-top: 0.8rem;
}

.partner-other-links:empty {
  display: none;
}

.toggle-partner {
  transition: transform 0.3s ease;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 4px;
}

.toggle-partner.expanded {
  transform: rotate(180deg);
}

.btn-xs {
  padding: 2px 6px;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Brand Hub Enhancements */
.instructions-card textarea {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.instructions-card small {
  display: block;
  margin-top: 0.25rem;
  opacity: 0.7;
  font-style: italic;
}

/* Message Actions Enhancement */
.learn-btn {
  color: #10B981 !important;
}

.learn-btn:hover {
  background: rgba(16, 185, 129, 0.1) !important;
}

.link-item.sub-link {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 0.5rem 0.75rem;
}

.link-info h5 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9rem;
  color: #FFD166;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-info p {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  word-break: break-all;
}

.link-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}

/* Responsive Adjustments */
@media (max-width: 1400px) {
  .brand-hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  /* Chat agent responsive styles in /css/chat-agent.css */
  .brand-hub-grid {
    grid-template-columns: 1fr;
  }
}

/* Link & Hashtag Manager Styles */
.link-hashtag-manager {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.link-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.cta-input {
  width: 140px;
  flex-shrink: 0;
}

.link-select {
  flex-grow: 1;
  min-width: 150px;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.5rem;
  border-radius: 4px;
}

.link-select:focus {
  border-color: #FFD166;
  outline: none;
}

.manual-link-input input,
.hashtag-input-group input {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.5rem;
  border-radius: 4px;
}

.manual-link-input input:focus,
.hashtag-input-group input:focus {
  border-color: #FFD166;
  outline: none;
}

/* Mobile adjustments for Link Manager */
@media (max-width: 500px) {
  .link-input-group {
    flex-direction: column;
  }
  
  .cta-input {
    width: 100%;
  }
  
  .link-select {
    width: 100%;
  }
  
  #insert-link-btn {
    width: 100%;
  }
}

/* Fix Analytics Dropdown Visibility */
#analytics-range {
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

#analytics-range option {
  background-color: #1a1f2e;
  color: #fff;
}

#analytics-range:focus {
  outline: none;
  border-color: #FFD166;
}

/* Chart Filters */
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.chart-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chart-filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.chart-filter-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color);
  opacity: 0.5;
}

.chart-filter-btn.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color);
  color: #fff;
}

.chart-filter-btn.active .dot {
  opacity: 1;
  box-shadow: 0 0 8px var(--color);
}

.chart-filter-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
  .chart-filters {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  
  .chart-filter-btn {
    white-space: nowrap;
  }
}


/* Omni-Editor Styles */
.omni-editor-modal {
  max-width: 1000px;
  width: 95%;
  height: 85vh;
  display: flex;
  flex-direction: column;
}

.omni-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  flex: 1;
  overflow: hidden;
  padding: 0;
}

.omni-input-column {
  padding: 1.5rem;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.omni-preview-column {
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Platform Toggles */
.platform-toggles {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.platform-checkbox {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.platform-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: all 0.2s;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.2rem;
}

.platform-checkbox:hover .checkmark {
  background-color: rgba(255, 255, 255, 0.1);
}

.platform-checkbox input:checked ~ .checkmark {
  background-color: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(59, 94, 219, 0.4);
}

/* Editor Toolbar */
.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  margin-top: -1px;
}

.toolbar-left {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.toolbar-right {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

.btn-icon {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.1rem;
  border-radius: 4px;
}

.btn-icon:hover {
  color: #FFD166;
  background: rgba(255, 255, 255, 0.05);
}

/* Preview Tabs */
.preview-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 1rem;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.preview-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
}

.preview-tab.active {
  color: white;
  border-bottom-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.05);
}

.preview-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

/* Preview Cards */
.preview-card {
  background: white;
  color: black;
  border-radius: 12px;
  width: 100%;
  max-width: 350px;
  padding: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.x-preview {
  background: black;
  color: white;
  border: 1px solid #333;
}

.linkedin-preview {
  background: white;
  border: 1px solid #e0e0e0;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.preview-header .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.preview-header .user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.preview-header .name {
  font-weight: 700;
  font-size: 0.95rem;
}

.preview-header .handle,
.preview-header .sub-text {
  color: #666;
  font-size: 0.85rem;
}

.x-preview .handle { color: #71767b; }

.preview-body {
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

.preview-footer {
  display: flex;
  justify-content: space-between;
  color: #666;
  font-size: 1.1rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eee;
}

.x-preview .preview-footer {
  border-top: 1px solid #333;
  color: #71767b;
}

.linkedin-preview .preview-footer {
  font-size: 0.85rem;
  font-weight: 600;
}

.linkedin-preview .preview-footer span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
}

.linkedin-preview .preview-footer span:hover {
  background: #f3f3f3;
}

@media (max-width: 900px) {
  .omni-layout {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    grid-template-columns: none;
  }
  
  .omni-input-column {
    overflow-y: visible;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
  }
  
  .omni-preview-column {
    height: auto;
    min-height: 400px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
  }
}

/* Preview Styles */
.preview-link {
  color: #1d9bf0;
  text-decoration: none;
}

.preview-hashtag {
  color: #1d9bf0;
}

/* Chat Header & Model Selector */
.chat-header-bar {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: flex-end;
}

.model-selector-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.model-selector-container i {
  color: #FFD166;
  font-size: 0.9rem;
}

.model-select {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

.model-select option {
  background: #1a1f2e;
  color: #fff;
}

.model-select:focus {
  outline: none;
}

/* Media Library Styles */
.media-library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
}

.breadcrumb-item {
  cursor: pointer;
  transition: color 0.2s;
}

.breadcrumb-item:hover {
  color: #FFD166;
}

.media-actions {
  display: flex;
  gap: 1rem;
}

.media-toolbar {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.5rem;
}

.media-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s;
}

.media-item:hover {
  transform: translateY(-2px);
  border-color: #FFD166;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.media-item.selected {
  border-color: #FFD166;
  background: rgba(255, 209, 102, 0.1);
}

.folder-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  aspect-ratio: 1;
}

.folder-icon {
  font-size: 3rem;
  color: #FFD166;
  margin-bottom: 0.5rem;
}

.file-item {
  aspect-ratio: 1;
}

.media-item .media-preview {
  width: 100%;
  height: 100%;
  position: relative;
  display: block;
  margin: 0;
}

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

.media-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.5rem;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.media-select-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 209, 102, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.media-item.selected .media-select-overlay {
  opacity: 1;
}

.media-select-overlay i {
  font-size: 2rem;
  color: #FFD166;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.video-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}


/* Emoji Picker Container Styles */
.emoji-picker-container {
  position: fixed;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  width: 352px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.emoji-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  font-weight: 600;
  color: #f1f5f9;
}

.emoji-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.emoji-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

/* Style the emoji-picker-element web component */
emoji-picker {
  --background: #1e293b;
  --border-color: rgba(255, 255, 255, 0.1);
  --indicator-color: #3b5edb;
  --input-border-color: rgba(255, 255, 255, 0.2);
  --input-font-color: #f1f5f9;
  --input-placeholder-color: #94a3b8;
  --outline-color: #3b5edb;
  --category-emoji-size: 1.375rem;
  --emoji-size: 1.375rem;
  --category-font-color: #f1f5f9;
  --button-hover-background: rgba(255, 255, 255, 0.1);
  --button-active-background: rgba(59, 94, 219, 0.2);
  --skintone-border-radius: 4px;
  
  width: 100%;
  height: 400px;
  border: none;
}


