/**
 * Admin SPA Styles
 */

/* Import Tailwind CSS */
@use 'tailwindcss/base';
@use 'tailwindcss/components';
@use 'tailwindcss/utilities';

/* Base styles using Tailwind utilities */
@layer base {
  * {
    @apply m-0 p-0 box-border;
  }
}

/* Component styles using Tailwind @apply */
@layer components {
  /* Admin app base styles */
  .zeno-chatbot-ai-admin-app {
    @apply font-sans text-gray-800 leading-normal;
  }

  /* Loading spinner component */
  .loading-spinner {
    @apply inline-block w-5 h-5 border-2 border-gray-200 border-t-primary-600 rounded-full animate-spin;
  }

  /* Button components */
  .btn-primary {
    @apply bg-primary-600 text-white px-4 py-2 rounded-lg font-medium transition-colors hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2;
  }

  .btn-secondary {
    @apply bg-gray-100 text-gray-700 px-4 py-2 rounded-lg font-medium transition-colors hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2;
  }

  /* Card component */
  .card {
    @apply bg-white rounded-lg border border-gray-200 shadow-sm;
  }

  .card-header {
    @apply px-6 py-4 border-b border-gray-200;
  }

  .card-body {
    @apply px-6 py-4;
  }
}

/* Cards */
.card {
  background: white;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

/* Stats Cards */
.stat-card {
  background: white;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  padding: 20px;
  text-align: center;
  transition: box-shadow 0.3s ease;
}

.stat-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: #0073aa;
  margin: 0;
}

.stat-label {
  color: #666;
  font-size: 14px;
  margin: 5px 0 0 0;
}

/* Forms */
.form-table {
  width: 100%;
  border-collapse: collapse;
}

.form-table th {
  width: 200px;
  padding: 20px 10px 20px 0;
  text-align: left;
  font-weight: 600;
  vertical-align: top;
}

.form-table td {
  padding: 15px 10px 20px 0;
  vertical-align: top;
}

.form-table input[type="text"],
.form-table input[type="email"],
.form-table input[type="url"],
.form-table input[type="password"],
.form-table input[type="number"],
.form-table select,
.form-table textarea {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-table input:focus,
.form-table select:focus,
.form-table textarea:focus {
  border-color: #0073aa;
  box-shadow: 0 0 0 1px #0073aa;
  outline: none;
}

.form-table .description {
  color: #666;
  font-size: 13px;
  margin-top: 5px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  color: #0073aa;
  border-color: #0073aa;
}

.btn:hover {
  background: #0073aa;
  color: white;
}

.btn-primary {
  background: #0073aa;
  color: white;
  border-color: #0073aa;
}

.btn-primary:hover {
  background: #005a87;
  border-color: #005a87;
}

.btn-danger {
  color: #d63638;
  border-color: #d63638;
}

.btn-danger:hover {
  background: #d63638;
  color: white;
}

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

/* Notifications */
.notification {
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 4px;
  border-left: 4px solid;
  background: white;
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.notification-success {
  border-left-color: #46b450;
  background: #f7fcf7;
}

.notification-error {
  border-left-color: #d63638;
  background: #fcf7f7;
}

.notification-warning {
  border-left-color: #ffb900;
  background: #fffcf7;
}

.notification-info {
  border-left-color: #0073aa;
  background: #f7fafc;
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

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

/* Responsive */
@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .form-table th,
  .form-table td {
    display: block;
    width: 100%;
    padding: 10px 0;
  }

  .form-table th {
    font-weight: 600;
    margin-bottom: 5px;
  }
}

/* WordPress Admin Compatibility */
.wrap .zeno-chatbot-ai-admin-app {
  margin: 0;
}

/* Status Indicators */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.status-active {
  background: #d4edda;
  color: #155724;
}

.status-inactive {
  background: #f8d7da;
  color: #721c24;
}

.status-warning {
  background: #fff3cd;
  color: #856404;
}

.zeno-chatbot-ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: #666;
}

.loading-spinner {
  margin-bottom: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0073aa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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


#zeno-chatbot-ai-admin-app {
  .el-select {
    input[type=color], input[type=date], input[type=datetime-local], input[type=datetime], input[type=email], input[type=month], input[type=number], input[type=password], input[type=search], input[type=tel], input[type=text], input[type=time], input[type=url], input[type=week], select, textarea {
      box-shadow: 0 0 0 transparent;
      border-radius: 4px;
      border-color: transparent;
      background-color: transparent;
      color: #2c3338;
    }
  }
}
