

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-light);
  transition: all 0.3s ease;
}

body.dark-theme {
  background-color: var(--bg-dark);
  color: var(--text-dark);
}

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--purple-primary), var(--purple-light));
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-card {
  background: var(--card-light);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.dark-theme .login-card {
  background: var(--card-dark);
}

.login-header .logo {
  width: 60px;
  height: 60px;
  background: var(--purple-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: white;
  font-size: 24px;
}

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-light);
}

.dark-theme .login-header h1 {
  color: var(--text-dark);
}

.login-header p {
  color: #666;
  margin-bottom: 30px;
}

.login-form .form-group {
  margin-bottom: 20px;
  text-align: left;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-light);
}

.dark-theme .login-form label {
  color: var(--text-dark);
}

.login-form .form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-light);
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: var(--bg-light);
  color: var(--text-light);
}

.dark-theme .login-form .form-control {
  border-color: var(--border-dark);
  background: var(--bg-dark);
  color: var(--text-dark);
}

.login-form .form-control:focus {
  outline: none;
  border-color: var(--purple-primary);
  box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.1);
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.form-check {
  display: flex;
  align-items: center;
}

.form-check-input {
  margin-right: 8px;
}

.forgot-password {
  color: var(--purple-primary);
  text-decoration: none;
  font-size: 14px;
}

.forgot-password:hover {
  text-decoration: underline;
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--purple-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.btn-login:hover {
  background: var(--purple-dark);
  transform: translateY(-1px);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login-footer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.dark-theme .login-footer {
  border-color: var(--border-dark);
}

.login-footer a {
  color: var(--purple-primary);
  text-decoration: none;
}

/* Dashboard Layout */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--card-light);
  border-bottom: 1px solid var(--border-light);
  height: 64px;
}

.dark-theme .header {
  background: var(--card-dark);
  border-color: var(--border-dark);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 32px;
  height: 32px;
  background: var(--purple-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.logo-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0;
}

.dark-theme .logo-header h1 {
  color: var(--text-dark);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ghost {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 6px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dark-theme .btn-ghost {
  color: var(--text-dark);
}

.btn-ghost:hover {
  background: rgba(111, 66, 193, 0.1);
  color: var(--purple-primary);
}

.main-container {
  display: flex;
  min-height: calc(100vh - 64px);
}

/* Sidebar */
.sidebar {
  width: 256px;
  background: var(--sidebar-light);
  border-right: 1px solid var(--border-light);
  position: fixed;
  left: 0;
  top: 64px;
  height: calc(100vh - 64px);
  z-index: 30;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.dark-theme .sidebar {
  background: var(--sidebar-dark);
  border-color: var(--border-dark);
}

.sidebar.open {
  transform: translateX(0);
}

@media (min-width: 992px) {
  .sidebar {
    position: static;
    transform: translateX(0);
    height: auto;
  }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
}

.dark-theme .sidebar-header {
  border-color: var(--border-dark);
}

.sidebar-nav {
  padding: 16px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  border-radius: 8px;
  color: var(--text-light);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  font-size: 14px;
}

.dark-theme .nav-item {
  color: var(--text-dark);
}

.nav-item:hover {
  background: rgba(111, 66, 193, 0.1);
  color: var(--purple-primary);
}

.nav-item.active {
  background: var(--purple-primary);
  color: white;
}

.nav-item i {
  width: 16px;
  text-align: center;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 24px;
  margin-left: 0;
  background: var(--bg-light);
}

.dark-theme .main-content {
  background: var(--bg-dark);
}

@media (min-width: 992px) {
  .main-content {
    margin-left: 56px;
  }
}

/* Cards */
.card {
  background: var(--card-light);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark-theme .card {
  background: var(--card-dark);
  border-color: var(--border-dark);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.dark-theme .card-header {
  border-color: var(--border-dark);
}

.card-body {
  padding: 24px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text-light);
}

.dark-theme .card-title {
  color: var(--text-dark);
}

/* Stat Cards */
.stat-card {
  background: var(--card-light);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark-theme .stat-card {
  background: var(--card-dark);
  border-color: var(--border-dark);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.stat-icon {
  color: var(--purple-primary);
  font-size: 16px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
}

.dark-theme .stat-value {
  color: var(--text-dark);
}

.stat-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.positive {
  color: #10b981;
}

.stat-change.negative {
  color: #ef4444;
}

.stat-subtitle {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

/* Gradient Cards */
.gradient-blue {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
}

.gradient-green {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
}

.gradient-purple {
  background: linear-gradient(135deg, var(--purple-primary), var(--purple-dark));
  color: white;
  border: none;
}

.gradient-orange {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
}

.gradient-blue .stat-title,
.gradient-green .stat-title,
.gradient-purple .stat-title,
.gradient-orange .stat-title {
  color: rgba(255, 255, 255, 0.8);
}

.gradient-blue .stat-icon,
.gradient-green .stat-icon,
.gradient-purple .stat-icon,
.gradient-orange .stat-icon {
  color: white;
}

/* Activity List */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.dark-theme .activity-item {
  border-color: var(--border-dark);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-info {
  flex: 1;
}

.activity-title {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 4px;
}

.dark-theme .activity-title {
  color: var(--text-dark);
}

.activity-subtitle {
  font-size: 14px;
  color: #666;
}

.activity-value {
  text-align: right;
}

.activity-amount {
  font-weight: 600;
  color: var(--purple-primary);
  margin-bottom: 4px;
}

.activity-time {
  font-size: 12px;
  color: #666;
}

/* Progress Bars */
.progress-item {
  margin-bottom: 16px;
}

.progress {
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.dark-theme .progress {
  background: var(--border-dark);
}

.progress-bar {
  height: 100%;
  transition: width 1s ease;
}

.bg-pink {
  background-color: #ec4899;
}

/* Device Items */
.device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--sidebar-light);
  border-radius: 8px;
  margin-bottom: 12px;
}

.dark-theme .device-item {
  background: var(--sidebar-dark);
}

.device-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.device-name {
  font-weight: 600;
  color: var(--text-light);
}

.dark-theme .device-name {
  color: var(--text-dark);
}

.device-count {
  font-size: 12px;
  color: #666;
}

.device-percentage {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
}

.dark-theme .device-percentage {
  color: var(--text-dark);
}

/* Insight Cards */
.gradient-bg {
  background: linear-gradient(135deg, rgba(111, 66, 193, 0.1), rgba(59, 130, 246, 0.1));
}

.insight-card {
  background: var(--card-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
}

.dark-theme .insight-card {
  background: var(--card-dark);
  border-color: var(--border-dark);
}

.insight-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-bottom: 8px;
}

.insight-title {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 4px;
}

.dark-theme .insight-title {
  color: var(--text-dark);
}

.insight-subtitle {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.insight-value {
  font-size: 18px;
  font-weight: 700;
}

/* Marketing Tabs */
.marketing-tabs {
  display: flex;
  gap: 4px;
  background: var(--sidebar-light);
  padding: 4px;
  border-radius: 8px;
  flex-wrap: wrap;
}

.dark-theme .marketing-tabs {
  background: var(--sidebar-dark);
}

.marketing-tab {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: 6px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.dark-theme .marketing-tab {
  color: var(--text-dark);
}

.marketing-tab:hover {
  background: rgba(111, 66, 193, 0.1);
}

.marketing-tab.active {
  background: var(--purple-primary);
  color: white;
}

.marketing-tab i {
  font-size: 12px;
}

@media (max-width: 768px) {
  .marketing-tab span {
    display: none;
  }
}

/* Marketing Content */
.marketing-content {
  display: none;
}

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

/* Material Cards */
.material-card {
  background: var(--sidebar-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.dark-theme .material-card {
  background: var(--sidebar-dark);
  border-color: var(--border-dark);
}

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

.material-preview {
  aspect-ratio: 16 / 9;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-light);
  position: relative;
}

.dark-theme .material-preview {
  border-color: var(--border-dark);
}

.material-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.video-preview {
  background: #000;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-overlay i {
  font-size: 24px;
  color: var(--purple-primary);
  background: rgba(255, 255, 255, 0.9);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.material-info {
  padding: 16px;
}

.material-info h6 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}

.dark-theme .material-info h6 {
  color: var(--text-dark);
}

.material-details {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  margin-bottom: 12px;
}

.material-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Text Items */
.text-category {
  margin-bottom: 24px;
}

.text-category h6 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 16px;
}

.dark-theme .text-category h6 {
  color: var(--text-dark);
}

.text-item {
  background: var(--sidebar-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.dark-theme .text-item {
  background: var(--sidebar-dark);
  border-color: var(--border-dark);
}

.text-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 16px;
}

.text-header h6 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}

.dark-theme .text-header h6 {
  color: var(--text-dark);
}

.text-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.text-content {
  background: var(--card-light);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 12px;
}

.dark-theme .text-content {
  background: var(--card-dark);
  border-color: var(--border-dark);
}

.text-content pre {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-light);
  white-space: pre-wrap;
  margin: 0;
}

.dark-theme .text-content pre {
  color: var(--text-dark);
}

/* Pixel Config */
.pixel-platforms {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.pixel-platforms .btn {
  border-radius: 6px;
}

/* Link Cards */
.link-url {
  background: var(--sidebar-light);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 16px;
}

.dark-theme .link-url {
  background: var(--sidebar-dark);
  border-color: var(--border-dark);
}

.link-url code {
  font-size: 12px;
  color: var(--text-light);
  word-break: break-all;
}

.dark-theme .link-url code {
  color: var(--text-dark);
}

.link-stat {
  text-align: center;
}

.link-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
}

.dark-theme .link-stat-value {
  color: var(--text-dark);
}

.link-stat-label {
  font-size: 12px;
  color: #666;
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border-light);
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  color: #666;
  margin-bottom: 16px;
}

.dark-theme .upload-area {
  border-color: var(--border-dark);
}

.upload-area i {
  font-size: 48px;
  margin-bottom: 16px;
  color: #ccc;
}

/* Buttons */
.btn-purple {
  background: var(--purple-primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-purple:hover {
  background: var(--purple-dark);
  color: white;
}

.btn-outline-purple {
  background: none;
  color: var(--purple-primary);
  border: 1px solid var(--purple-primary);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline-purple:hover {
  background: var(--purple-primary);
  color: white;
}

/* Badges */
.badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.bg-purple {
  background: var(--purple-primary);
  color: white;
}

/* Tables */
.table {
  color: var(--text-light);
}

.dark-theme .table {
  color: var(--text-dark);
}

.table th {
  border-color: var(--border-light);
  font-weight: 600;
  font-size: 14px;
}

.dark-theme .table th {
  border-color: var(--border-dark);
}

.table td {
  border-color: var(--border-light);
  vertical-align: middle;
}

.dark-theme .table td {
  border-color: var(--border-dark);
}

.text-purple {
  color: var(--purple-primary);
}

/* Tab Content */
.tab-content {
  display: none;
}

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

/* Form Controls */
.form-control,
.form-select {
  background: var(--card-light);
  border: 1px solid var(--border-light);
  color: var(--text-light);
}

.dark-theme .form-control,
.dark-theme .form-select {
  background: var(--card-dark);
  border-color: var(--border-dark);
  color: var(--text-dark);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--purple-primary);
  box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.25);
}

.form-label {
  color: var(--text-light);
  font-weight: 500;
}

.dark-theme .form-label {
  color: var(--text-dark);
}

/* Toast */
.toast {
  background: var(--card-light);
  border: 1px solid var(--border-light);
  color: var(--text-light);
}

.dark-theme .toast {
  background: var(--card-dark);
  border-color: var(--border-dark);
  color: var(--text-dark);
}

/* Modal */
.modal-content {
  background: var(--card-light);
  border: 1px solid var(--border-light);
}

.dark-theme .modal-content {
  background: var(--card-dark);
  border-color: var(--border-dark);
}

.modal-header {
  border-color: var(--border-light);
}

.dark-theme .modal-header {
  border-color: var(--border-dark);
}

.modal-footer {
  border-color: var(--border-light);
}

.dark-theme .modal-footer {
  border-color: var(--border-dark);
}

.modal-title {
  color: var(--text-light);
}

.dark-theme .modal-title {
  color: var(--text-dark);
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    padding: 0 16px;
  }

  .main-content {
    padding: 16px;
  }

  .stat-card {
    padding: 16px;
  }

  .card-body {
    padding: 16px;
  }

  .text-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .material-actions {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
}

/* Loading Animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.fa-spin {
  animation: spin 1s linear infinite;
}

/* Sidebar Overlay */
@media (max-width: 991px) {
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 25;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }
}

/* Utilities */
.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.text-center {
  text-align: center !important;
}

.text-end {
  text-align: right !important;
}

.fw-bold {
  font-weight: 700 !important;
}

.text-muted {
  color: #666 !important;
}

.me-1 {
  margin-right: 0.25rem !important;
}
.me-2 {
  margin-right: 0.5rem !important;
}
.mb-1 {
  margin-bottom: 0.25rem !important;
}
.mb-2 {
  margin-bottom: 0.5rem !important;
}
.mb-3 {
  margin-bottom: 1rem !important;
}
.mb-4 {
  margin-bottom: 1.5rem !important;
}
.mt-3 {
  margin-top: 1rem !important;
}

.w-100 {
  width: 100% !important;
}

.bg-success {
  background-color: #10b981 !important;
}
.bg-primary {
  background-color: #3b82f6 !important;
}
.bg-warning {
  background-color: #f59e0b !important;
}
.bg-secondary {
  background-color: #6b7280 !important;
}

.text-success {
  color: #10b981 !important;
}
.text-primary {
  color: #3b82f6 !important;
}
.text-warning {
  color: #f59e0b !important;
}
