/* AI Dashboard New Design */

/* Hide old dashboard elements */
.tiles,
.tile {
  display: none !important;
}

/* Dashboard Header */
.ai-dashboard-header {
  margin-bottom: 40px;
  padding: 30px 40px;
  background: rgba(15, 39, 68, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(30, 137, 227, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.welcome-section {
  text-align: left;
  flex-shrink: 0;
}

.welcome-section h1 {
  font-size: 2rem;
  margin-bottom: 5px;
  color: var(--ai-text);
}

.welcome-subtitle {
  color: var(--ai-text-secondary);
  font-size: 1rem;
}

/* Minimal Stats */
.minimal-stats {
  display: flex;
  gap: 35px;
  align-items: center;
  margin-left: 60px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ai-text);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  padding: 12px 20px;
  border-radius: 16px;
  background: rgba(30, 137, 227, 0.08);
  border: 1px solid rgba(30, 137, 227, 0.2);
}

.stat-item:hover {
  background: rgba(30, 137, 227, 0.15);
  border-color: rgba(30, 137, 227, 0.4);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--ai-text);
  box-shadow: 0 5px 15px rgba(30, 137, 227, 0.2);
}

.stat-item i {
  font-size: 1.8rem;
  color: var(--ai-primary-light);
}

.stat-item .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--ai-gradient-2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Base Tooltip Styles */
.stat-item[data-tooltip] {
  position: relative;
}

/* Dark Mode Tooltip (Default) */
body:not([data-theme="light"]) .stat-item[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.95);
  color: white;
  font-size: 0.85rem;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  font-family: 'Inter', Tahoma, sans-serif;
}

/* Dark Mode Tooltip Arrow */
body:not([data-theme="light"]) .stat-item[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  border: 6px solid transparent;
  border-top-color: rgba(15, 23, 42, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

/* Show tooltip on hover - Dark Mode */
body:not([data-theme="light"]) .stat-item[data-tooltip]:hover::before,
body:not([data-theme="light"]) .stat-item[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Light Mode Tooltip */
body[data-theme="light"] .stat-item[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.95);
  color: white;
  font-size: 0.85rem;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  font-family: 'Inter', Tahoma, sans-serif;
}

/* Light Mode Tooltip Arrow */
body[data-theme="light"] .stat-item[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  border: 6px solid transparent;
  border-top-color: rgba(30, 41, 59, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

/* Show tooltip on hover - Light Mode */
body[data-theme="light"] .stat-item[data-tooltip]:hover::before,
body[data-theme="light"] .stat-item[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Mobile tooltip adjustments */
@media (max-width: 768px) {
  .stat-item[data-tooltip]::before {
    font-size: 0.75rem !important;
    padding: 6px 10px !important;
  }
}

/* Quick Stats Circles */
.quick-stats {
  display: flex;
  gap: 20px;
}

.stat-circle {
  width: 80px;
  height: 80px;
  background: var(--ai-gradient-2);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 15px rgba(30, 137, 227, 0.3);
  position: relative;
  overflow: hidden;
}

.stat-circle::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  animation: statRotate 15s linear infinite;
}

@keyframes statRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.stat-circle .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  z-index: 1;
}

.stat-circle .stat-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  z-index: 1;
}

/* Interactive Stats Grid */
.ai-stats-grid {
  margin-bottom: 50px;
}

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

/* 3D Flip Cards */
.ai-stat-card {
  height: 300px;
  perspective: 1000px;
  cursor: pointer;
}

.ai-stat-card .card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.ai-stat-card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.card-front {
  background: rgba(15, 39, 68, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(30, 137, 227, 0.2);
}

.card-back {
  background: var(--ai-gradient-2);
  transform: rotateY(180deg);
  color: white;
}

/* Card Specific Colors */
.ai-stat-card.services .icon-wrapper { background: rgba(30, 137, 227, 0.2); }
.ai-stat-card.domains .icon-wrapper { background: rgba(20, 184, 166, 0.2); }
.ai-stat-card.tickets .icon-wrapper { background: rgba(245, 158, 11, 0.2); }
.ai-stat-card.invoices .icon-wrapper { background: rgba(239, 68, 68, 0.2); }

.ai-stat-card.services .icon-wrapper i { color: var(--ai-primary); }
.ai-stat-card.domains .icon-wrapper i { color: var(--ai-secondary); }
.ai-stat-card.tickets .icon-wrapper i { color: var(--ai-accent); }
.ai-stat-card.invoices .icon-wrapper i { color: #ef4444; }

.icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 2rem;
}

.ai-stat-card h3 {
  color: var(--ai-text);
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--ai-gradient-2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-desc {
  color: var(--ai-text-secondary);
  font-size: 0.9rem;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 10px 25px;
  border-radius: 25px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  text-decoration: none;
  color: white;
}

/* Quick Actions */
.ai-quick-actions {
  margin-bottom: 50px;
}

.section-title {
  font-size: 1.5rem;
  color: var(--ai-text);
  margin-bottom: 25px;
  position: relative;
  padding-left: 20px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 100%;
  background: var(--ai-gradient-2);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.action-item {
  background: rgba(15, 39, 68, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(30, 137, 227, 0.2);
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  text-decoration: none;
  color: var(--ai-text);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.action-item i {
  font-size: 2rem;
  color: var(--ai-primary-light);
}

.action-item:hover {
  transform: translateY(-5px);
  background: rgba(30, 137, 227, 0.1);
  border-color: var(--ai-primary);
  text-decoration: none;
  color: var(--ai-text);
}

/* Activity Timeline */
.ai-activity-timeline {
  margin-bottom: 50px;
}

.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(30, 137, 227, 0.2);
}

.timeline-item {
  position: relative;
  margin-bottom: 30px;
}

.timeline-marker {
  position: absolute;
  left: -30px;
  top: 5px;
  width: 12px;
  height: 12px;
  background: var(--ai-gradient-2);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(30, 137, 227, 0.1);
}

.timeline-content {
  background: rgba(15, 39, 68, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(30, 137, 227, 0.2);
  border-radius: 15px;
  padding: 20px;
}

.timeline-content h4 {
  color: var(--ai-primary-light);
  margin-bottom: 15px;
}

.timeline-entry {
  padding: 8px 0;
  border-bottom: 1px solid rgba(30, 137, 227, 0.1);
}

.timeline-entry:last-child {
  border-bottom: none;
}

.timeline-entry a {
  color: var(--ai-text);
  text-decoration: none;
  transition: all 0.3s ease;
}

.timeline-entry a:hover {
  color: var(--ai-primary-light);
}

/* Custom Panels */
.ai-custom-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 25px;
}

.ai-panel {
  background: rgba(15, 39, 68, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(30, 137, 227, 0.2);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.ai-panel:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.panel-header {
  background: rgba(15, 23, 42, 0.5);
  padding: 20px;
  border-bottom: 1px solid rgba(30, 137, 227, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header h3 {
  margin: 0;
  color: var(--ai-text);
  font-size: 1.1rem;
}

.panel-header i {
  color: var(--ai-primary-light);
  font-size: 1.25rem;
}

.panel-badge {
  margin-left: auto;
  background: var(--ai-gradient-2);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.panel-body {
  padding: 20px;
  color: var(--ai-text-secondary);
}

.panel-items {
  padding: 0;
}

.panel-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: var(--ai-text);
  text-decoration: none;
  border-bottom: 1px solid rgba(30, 137, 227, 0.1);
  transition: all 0.3s ease;
  gap: 10px;
}

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

.panel-item:hover {
  background: rgba(30, 137, 227, 0.05);
  padding-left: 25px;
  color: var(--ai-text);
  text-decoration: none;
}

.item-badge {
  margin-left: auto;
  background: rgba(30, 137, 227, 0.2);
  color: var(--ai-primary-light);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
}

/* Panels Section */
.ai-panels-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 25px;
  margin-top: 40px;
}

.ai-panels-section .ai-panel {
  background: rgba(15, 39, 68, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(30, 137, 227, 0.2);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 1024px) {
  .ai-dashboard-header {
    flex-direction: column;
    text-align: center;
  }

  .welcome-section {
    text-align: center;
  }

  .minimal-stats {
    justify-content: center;
  }
  
  .stats-row {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .quick-stats {
    justify-content: center;
  }

  .ai-dashboard-header {
    padding: 20px;
  }

  .minimal-stats {
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .stat-item {
    padding: 10px 15px;
  }

  .stat-item i {
    font-size: 1.4rem;
  }

  .stat-item .stat-value {
    font-size: 1.3rem;
  }
  
  .stat-circle {
    width: 70px;
    height: 70px;
  }
  
  .ai-stat-card {
    height: 250px;
  }
  
  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .ai-custom-panels {
    grid-template-columns: 1fr;
  }
}

/* Light Mode Specific Styles */
[data-theme="light"] .ai-dashboard-header {
  background: rgba(30, 137, 227, 0.9);
  color: white;
}

[data-theme="light"] .welcome-section h1,
[data-theme="light"] .welcome-subtitle {
  color: white;
}

[data-theme="light"] .stat-item {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

[data-theme="light"] .stat-item:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

[data-theme="light"] .stat-item i {
  color: white;
}

[data-theme="light"] .stat-item .stat-value {
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .ai-panel {
  background: rgba(30, 137, 227, 0.9);
  color: white;
}

[data-theme="light"] .panel-header {
  background: rgba(26, 121, 204, 0.5);
  color: white;
}

[data-theme="light"] .panel-header h3,
[data-theme="light"] .panel-header i {
  color: white;
}

[data-theme="light"] .panel-body {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .panel-item {
  color: white;
}

[data-theme="light"] .panel-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

[data-theme="light"] .action-item {
  background: rgba(30, 137, 227, 0.9);
  color: white;
}

[data-theme="light"] .action-item i {
  color: white;
}

[data-theme="light"] .action-item:hover {
  background: rgba(30, 161, 201, 0.9);
  color: white;
}

[data-theme="light"] .section-title {
  color: var(--ai-primary-dark);
}

[data-theme="light"] .timeline-content {
  background: rgba(30, 137, 227, 0.9);
  color: white;
}

[data-theme="light"] .timeline-content h4 {
  color: white;
}

[data-theme="light"] .timeline-entry a {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .timeline-entry a:hover {
  color: white;
}

/* Light Mode Tooltip */
[data-theme="light"] .stat-item[data-tooltip]::before {
  content: attr(data-tooltip) !important;
  position: absolute !important;
  bottom: 100% !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin-bottom: 10px !important;
  padding: 8px 12px !important;
  background: #1e89e3 !important;
  color: white !important;
  font-size: 0.85rem !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: all 0.3s ease !important;
  pointer-events: none !important;
  box-shadow: 0 5px 15px rgba(30, 137, 227, 0.4) !important;
  z-index: 1000 !important;
  font-family: 'Inter', Tahoma, sans-serif !important;
}

[data-theme="light"] .stat-item[data-tooltip]::after {
  content: '' !important;
  position: absolute !important;
  bottom: 100% !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin-bottom: 4px !important;
  border: 6px solid transparent !important;
  border-top-color: #1e89e3 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: all 0.3s ease !important;
  z-index: 1000 !important;
}

/* Show tooltip on hover - Light Mode */
[data-theme="light"] .stat-item[data-tooltip]:hover::before,
[data-theme="light"] .stat-item[data-tooltip]:hover::after {
  opacity: 1 !important;
  visibility: visible !important;
}