/* Main Entry - 全局样式入口 */
/* Base styles - @import must be first */
@import './base/variables.css';
@import './base/reset.css';

/* Component styles */
@import './components/button.css';
@import './components/form.css';
@import './components/modal.css';
@import './components/table.css';

/* Tailwind directives */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Force body styles */
body {
  color: #f3f4f6;
  background-color: #0f1115;
}

/* Ensure main content has dark background */
#app, .page-content {
  background-color: #0f1115 !important;
  color: #f3f4f6;
}

/* Animations */
@keyframes bar-grow {
  from {
    height: 0;
    opacity: 1;
  }
  to {
    opacity: 1;
  }
}

@keyframes progress-grow {
  from {
    width: 0;
    opacity: 1;
  }
  to {
    width: var(--target-width);
    opacity: 1;
  }
}

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

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

@keyframes loading-dots {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

@keyframes loading-skeleton {
  0% { opacity: 0.4; }
  50% { opacity: 0.7; }
  100% { opacity: 0.4; }
}

/* Animation classes */
.chart-bar {
  height: 0;
  opacity: 0;
  animation: bar-grow 2.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.progress-bar {
  width: 0;
  opacity: 0;
  animation: progress-grow 2.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.loading-pulse {
  animation: pulse-dot 1.5s ease-in-out infinite;
}

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

.loading-skeleton {
  animation: loading-skeleton 1.5s ease-in-out infinite;
}

/* Utility classes */
.text-gradient {
  background: linear-gradient(to right, var(--color-primary), #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background-color: rgba(31, 34, 48, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(42, 44, 54, 0.5);
}

.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 149, 0, 0.5);
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1f2230;
  border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

.badge-success {
  background-color: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.badge-warning {
  background-color: rgba(234, 179, 8, 0.2);
  color: #eab308;
}

.badge-error {
  background-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.badge-info {
  background-color: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.badge-default {
  background-color: rgba(107, 114, 128, 0.2);
  color: #6b7280;
}

/* Status dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all var(--transition-base);
}

.status-dot-active {
  background-color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-dot-inactive {
  background-color: #6b7280;
}

.status-dot-error {
  background-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Empty state */
.empty-state {
  padding: var(--spacing-2xl);
  text-align: center;
  transition: all var(--transition-slow);
}

.empty-state-icon {
  color: #4b5563;
  font-size: var(--font-size-2xl);
  margin-bottom: var(--spacing-md);
  transition: transform var(--transition-slow);
}

.empty-state:hover .empty-state-icon {
  color: #6b7280;
  transform: scale(1.1);
}

/* Card hover effect */
.card-hover {
  transition: all var(--transition-base);
}

.card-hover:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Element Plus Dark Theme - Must be last */
html.dark {
  --el-bg-color: #171922;
  --el-bg-color-overlay: #171922;
  --el-text-color-primary: #ffffff;
  --el-text-color-regular: #a1a1aa;
  --el-border-color: #2a2c36;
  --el-border-color-light: #2a2c36;
  --el-fill-color-blank: #171922;
  --el-color-primary: #ff9500;
}

/* el-select */
html.dark .el-select .el-input__wrapper,
html.dark .el-select .el-select__wrapper {
  background-color: #171922 !important;
  border: 1px solid #2a2c36;
  box-shadow: none !important;
}

html.dark .el-select:hover .el-input__wrapper,
html.dark .el-select:hover .el-select__wrapper {
  background-color: #1a1c25 !important;
  border-color: #ff9500;
}

html.dark .el-select .el-input__wrapper.is-focus,
html.dark .el-select .el-select__wrapper.is-focus {
  border-color: #ff9500;
}

html.dark .el-select .el-input__inner {
  color: #ffffff;
}

/* el-select dropdown */
.el-select-dropdown.el-popper,
html.dark .el-select-dropdown {
  background-color: #171922 !important;
  border: 1px solid #2a2c36 !important;
}

html.dark .el-select-dropdown__list {
  background-color: #171922 !important;
}

html.dark .el-select-dropdown__item {
  color: #ffffff !important;
  background-color: transparent !important;
}

html.dark .el-select-dropdown__item:hover,
html.dark .el-select-dropdown__item.hover {
  background-color: #1a1c25 !important;
}

html.dark .el-select-dropdown__item.is-selected {
  color: #ff9500 !important;
}

/* el-checkbox */
html.dark .el-checkbox .el-checkbox__input.is-checked .el-checkbox__inner {
  background-color: transparent;
  border-color: #ff9500;
}

html.dark .el-checkbox .el-checkbox__input.is-checked .el-checkbox__inner::after {
  border-color: #ff9500 !important;
  width: 4px;
  height: 8px;
}

html.dark .el-checkbox .el-checkbox__label {
  color: #e5e7eb;
}
