/* Anabta CX - Customer Experience Intelligence - Custom Styles */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Security: Prevent text selection and copy */
.protected-content {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Disable right-click on protected areas */
.no-context-menu {
  pointer-events: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Dashboard Container */
.dashboard-container {
  min-height: 100vh;
  display: flex;
}

/* Sidebar Styles */
.sidebar {
  width: 280px;
  background: white;
  border-right: 1px solid #e2e8f0;
  transition: transform 0.3s ease;
  position: fixed;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
}

.dark .sidebar {
  background: #0f172a;
  border-right-color: #1e293b;
}

.sidebar.collapsed {
  transform: translateX(-280px);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.dark .sidebar-header {
  border-bottom-color: #1e293b;
}

.sidebar-menu {
  padding: 1rem 0;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: #64748b;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  font-weight: 500;
}

.sidebar-menu-item:hover {
  background: #f1f5f9;
  color: #6366f1;
  font-weight: 600;
}

.dark .sidebar-menu-item {
  color: #94a3b8;
}

.dark .sidebar-menu-item:hover {
  background: #1e293b;
  color: #a5b4fc;
  font-weight: 600;
}

.sidebar-menu-item.active {
  background: #eef2ff;
  color: #4f46e5;
  border-right: 3px solid #6366f1;
  font-weight: 600;
}

.dark .sidebar-menu-item.active {
  background: #1e293b;
  color: #a5b4fc;
  border-right-color: #818cf8;
  font-weight: 600;
}

.sidebar-menu-item i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  transition: margin-left 0.3s ease;
}

.main-content.expanded {
  margin-left: 0;
}

/* Top Navigation Bar */
.top-nav {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 40;
}

.dark .top-nav {
  background: #0f172a;
  border-bottom-color: #1e293b;
}

/* Card Styles */
.dashboard-card {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  border: 1px solid #e2e8f0;
}

.dark .dashboard-card {
  background: #1e293b;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.5);
  border-color: #334155;
}

.dashboard-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.dark .dashboard-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.7);
  border-color: #475569;
}

/* KPI Card */
.kpi-card {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.kpi-value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  margin: 0.5rem 0;
}

.kpi-label {
  font-size: 0.875rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.dark .badge-success {
  background: #065f46;
  color: #d1fae5;
}

.dark .badge-warning {
  background: #92400e;
  color: #fef3c7;
}

.dark .badge-danger {
  background: #991b1b;
  color: #fee2e2;
}

.dark .badge-info {
  background: #1e40af;
  color: #dbeafe;
}

/* Button Styles */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: #6366f1;
  color: white;
}

.btn-primary:hover {
  background: #4f46e5;
}

.btn-secondary {
  background: #64748b;
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-outline {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.dark .btn-outline {
  border-color: #334155;
  color: #cbd5e1;
}

.dark .btn-outline:hover {
  background: #1e293b;
  border-color: #475569;
}

/* SWOT Quadrant */
.swot-quadrant {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.swot-box {
  padding: 1.5rem;
  border-radius: 0.5rem;
  min-height: 300px;
  cursor: pointer;
  transition: all 0.2s;
}

.swot-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.swot-strength {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.swot-weakness {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.swot-opportunity {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
}

.swot-threat {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

/* Filter Panel */
.filter-panel {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.dark .filter-panel {
  background: #1e293b;
}

.filter-select {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
  background: white;
  color: #1e293b;
  min-width: 150px;
}

.dark .filter-select {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

/* Table Styles */
.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow-x: auto;
}

.data-table th {
  background: #f1f5f9;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  color: #334155;
  border-bottom: 2px solid #cbd5e1;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.dark .data-table th {
  background: #1e293b;
  color: #e2e8f0;
  border-bottom-color: #475569;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
}

.dark .data-table td {
  border-bottom-color: #334155;
  color: #cbd5e1;
}

.data-table tr:hover {
  background: #f8fafc;
}

.dark .data-table tr:hover {
  background: #1e293b;
}

/* Timeline Styles */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.dark .timeline::before {
  background: #334155;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6366f1;
  border: 3px solid white;
  box-shadow: 0 0 0 3px #e2e8f0;
}

.dark .timeline-item::before {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px #334155;
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 300px;
  margin-top: 1rem;
}

/* Loading Spinner */
.loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #6366f1;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

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

/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: white;
  border-radius: 0.5rem;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.dark .modal-content {
  background: #0f172a;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-280px);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .swot-quadrant {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .top-nav {
    padding: 1rem;
  }
  
  .dashboard-card {
    padding: 1rem;
  }
  
  .kpi-value {
    font-size: 2rem;
  }
  
  .filter-panel {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-select {
    width: 100%;
  }
}

/* Enhanced Text Colors for Readability */
.text-enhanced {
  color: #1e293b;
}

.dark .text-enhanced {
  color: #f1f5f9;
}

.text-muted-enhanced {
  color: #475569;
}

.dark .text-muted-enhanced {
  color: #cbd5e1;
}

.text-heading {
  color: #0f172a;
  font-weight: 700;
}

.dark .text-heading {
  color: #f8fafc;
}

.text-subheading {
  color: #334155;
  font-weight: 600;
}

.dark .text-subheading {
  color: #e2e8f0;
}

/* Enhanced Card Headers */
.card-header {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
}

.dark .card-header {
  color: #f8fafc;
}

/* Enhanced Link Colors */
a.link-enhanced {
  color: #6366f1;
  text-decoration: none;
  transition: color 0.2s;
}

a.link-enhanced:hover {
  color: #4f46e5;
  text-decoration: underline;
}

.dark a.link-enhanced {
  color: #818cf8;
}

.dark a.link-enhanced:hover {
  color: #a5b4fc;
}

/* Enhanced Input Fields */
.input-enhanced {
  background: white;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 0.625rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
}

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

.dark .input-enhanced {
  background: #0f172a;
  border-color: #475569;
  color: #f1f5f9;
}

.dark .input-enhanced:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

/* Enhanced Label Colors */
.label-enhanced {
  color: #475569;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  display: block;
}

.dark .label-enhanced {
  color: #cbd5e1;
}

/* Print Styles */
@media print {
  .sidebar,
  .top-nav,
  .filter-panel,
  .btn {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .dashboard-card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }
}

/* Toast/Alert Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

.animate-fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}
