/* Dashboard Widgets & Analytics Styles */

/* Widget Base Styles */
.widget {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.widget:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.widget-title i {
  color: #6b7280;
}

.widget-content {
  padding: 20px 24px 24px;
}

.widget-refresh,
.widget-filter {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.widget-refresh:hover {
  background: #f3f4f6;
  color: #374151;
}

.widget-filter {
  cursor: pointer;
}

.widget-filter:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Quick Stats */
.quick-stats {
  padding: 32px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin-bottom: 32px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  position: relative;
  overflow: hidden;
}

.stat-icon.polls {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.stat-icon.posts {
  background: linear-gradient(135deg, #10b981, #059669);
}

.stat-icon.campaigns {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-icon.users {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.stat-icon.responses {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 8px;
}

.stat-change {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 12px;
  display: inline-block;
  width: fit-content;
}

.stat-change.positive {
  color: #059669;
  background: #d1fae5;
}

.stat-change.negative {
  color: #dc2626;
  background: #fee2e2;
}

.stat-change.neutral {
  color: #d97706;
  background: #fef3c7;
}

/* Access Indicators for Pro Dashboard */
.access-indicator {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.access-indicator[data-feature="polls"] {
  background: #d1fae5;
  color: #059669;
}

.access-indicator[data-feature="posts"],
.access-indicator[data-feature="campaigns"] {
  background: #fee2e2;
  color: #dc2626;
}

.access-indicator[data-feature="analytics"] {
  background: #d1fae5;
  color: #059669;
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 32px;
  align-items: start;
}

.main-sections {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar-widgets {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Dashboard Sections */
.dashboard-section {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid #f3f4f6;
  background: #fafbfc;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title i {
  font-size: 20px;
  color: #6b7280;
}

.section-title h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.section-count {
  background: #f3f4f6;
  color: #6b7280;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.section-actions {
  display: flex;
  gap: 12px;
}

.create-btn {
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.create-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.view-all-btn {
  background: #f9fafb;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-all-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.section-content {
  padding: 0;
}

.items-list {
  padding: 24px 32px;
  min-height: 200px;
}

.section-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-top: 1px solid #f3f4f6;
  background: #fafbfc;
}

.pagination-btn {
  background: #f9fafb;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 14px;
  color: #6b7280;
}

/* Pro Dashboard Access Status */
.access-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 8px;
}

.access-status.approved {
  background: #d1fae5;
  color: #059669;
}

.access-status.pending {
  background: #fef3c7;
  color: #d97706;
}

.access-status.denied {
  background: #fee2e2;
  color: #dc2626;
}

.request-access-btn,
.upgrade-btn {
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.upgrade-btn {
  background: #8b5cf6;
}

.request-access-btn:hover {
  background: #d97706;
}

.upgrade-btn:hover {
  background: #7c3aed;
}

/* Locked Content */
.section-content.locked {
  padding: 48px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.locked-content {
  text-align: center;
  max-width: 400px;
}

.lock-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px;
}

.locked-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px;
}

.locked-content p {
  color: #6b7280;
  margin: 0 0 24px;
  line-height: 1.5;
}

.unlock-btn {
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.unlock-btn.premium {
  background: #8b5cf6;
}

.unlock-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.unlock-btn.premium:hover {
  background: #7c3aed;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* User Activity Widget */
.user-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.user-stat {
  text-align: center;
  flex: 1;
}

.user-count {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 4px;
}

.user-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.activity-chart {
  height: 150px;
  position: relative;
}

/* Poll Performance Widget */
.performance-metrics {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.metric {
  text-align: center;
  flex: 1;
}

.metric-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.performance-chart {
  height: 120px;
  position: relative;
}

/* Social Engagement Widget */
.engagement-platforms {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.platform-metric {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

.platform-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
}

.platform-icon.twitter {
  background: #000000;
}

.platform-icon.facebook {
  background: #1877f2;
}

.platform-icon.instagram {
  background: linear-gradient(
    45deg,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%
  );
}

.platform-icon.linkedin {
  background: #0a66c2;
}

.platform-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.platform-value {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.platform-label {
  font-size: 12px;
  color: #6b7280;
}

/* Upcoming Posts Widget */
.upcoming-posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upcoming-post {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #f3f4f6;
}

.post-time {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  min-width: 60px;
}

.post-platforms {
  display: flex;
  gap: 4px;
}

.post-platform {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: white;
}

.post-content {
  flex: 1;
  font-size: 13px;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-schedule-btn {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-schedule-btn:hover {
  background: #e5e7eb;
}

/* Activity Feed Widget */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #f3f4f6;
}

.activity-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 13px;
  color: #374151;
  margin: 0 0 4px;
  line-height: 1.4;
}

.activity-time {
  font-size: 11px;
  color: #9ca3af;
}

.clear-activity-btn {
  background: none;
  color: #6b7280;
  border: none;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.clear-activity-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Pro Dashboard Specific Widgets */
.social-status-widget .widget-content {
  padding: 16px 24px 24px;
}

.feature-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.feature-badge.locked {
  background: #fee2e2;
  color: #dc2626;
}

.feature-badge.unlocked {
  background: #d1fae5;
  color: #059669;
}

.social-platforms {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.platform-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.platform-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.platform-name {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.platform-status-text {
  font-size: 11px;
  color: #9ca3af;
}

.platform-lock {
  color: #dc2626;
  font-size: 12px;
}

.connect-social-btn {
  width: 100%;
  background: #f9fafb;
  color: #9ca3af;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.connect-social-btn:not(.disabled) {
  background: #3b82f6;
  color: white;
  cursor: pointer;
}

/* Usage Limits Widget */
.usage-item {
  margin-bottom: 16px;
}

.usage-item:last-child {
  margin-bottom: 0;
}

.usage-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}

.usage-label span:first-child {
  color: #374151;
  font-weight: 500;
}

.usage-count {
  color: #6b7280;
  font-size: 12px;
}

.usage-bar {
  height: 4px;
  background: #f3f4f6;
  border-radius: 2px;
  overflow: hidden;
}

.usage-progress {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.upgrade-link {
  background: #8b5cf6;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.upgrade-link:hover {
  background: #7c3aed;
}

/* Access Requests Widget */
.request-item {
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #f3f4f6;
  margin-bottom: 12px;
}

.request-item:last-child {
  margin-bottom: 0;
}

.request-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.request-title {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.request-status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 8px;
}

.request-status.pending {
  background: #fef3c7;
  color: #d97706;
}

.request-status.approved {
  background: #d1fae5;
  color: #059669;
}

.request-status.denied {
  background: #fee2e2;
  color: #dc2626;
}

.request-date {
  font-size: 11px;
  color: #9ca3af;
}

/* Approval Banner */
.approval-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-bottom: 1px solid #f59e0b;
  padding: 16px 0;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f59e0b;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.banner-text {
  flex: 1;
}

.banner-text h4 {
  font-size: 16px;
  font-weight: 600;
  color: #92400e;
  margin: 0 0 4px;
}

.banner-text p {
  font-size: 14px;
  color: #b45309;
  margin: 0;
}

.banner-actions {
  display: flex;
  gap: 12px;
}

.banner-btn {
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.banner-btn:hover {
  background: #d97706;
}

/* Header Enhancements */
.header-search {
  flex: 1;
  max-width: 400px;
  margin: 0 32px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 14px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 36px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  background: #ffffff;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input::placeholder {
  color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .sidebar-widgets {
    grid-row: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-number {
    font-size: 24px;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px 24px;
  }

  .section-actions {
    justify-content: stretch;
  }

  .section-actions button {
    flex: 1;
  }

  .items-list {
    padding: 16px 24px;
  }

  .section-pagination {
    padding: 12px 24px;
  }

  .sidebar-widgets {
    grid-template-columns: 1fr;
  }

  .user-stats,
  .performance-metrics {
    flex-direction: column;
    gap: 12px;
    text-align: left;
  }

  .engagement-platforms {
    gap: 12px;
  }

  .platform-metric {
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .quick-stats {
    padding: 20px 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 12px;
    gap: 12px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .stat-number {
    font-size: 20px;
  }

  .dashboard-grid {
    gap: 16px;
  }

  .section-header {
    padding: 16px 20px;
  }

  .items-list {
    padding: 12px 20px;
  }

  .widget {
    margin-bottom: 16px;
  }

  .widget-header {
    padding: 16px 20px 12px;
  }

  .widget-content {
    padding: 16px 20px 20px;
  }
}
