/* FileAudit - Custom Styles */

/* Base */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light mode (default) */
body {
  background-color: #f8fafc;
  color: #1e293b;
}

/* Dark mode */
body.dark {
  background-color: #0f172a;
  color: #e2e8f0;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Scrollbar - Dark */
body.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

body.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

body.dark ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Vue transitions */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.2s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-enter-active,
.slide-leave-active {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.slide-enter-from {
  transform: translateX(-10px);
  opacity: 0;
}

.slide-leave-to {
  transform: translateX(10px);
  opacity: 0;
}

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

.animate-pulse-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin-slow {
  animation: spin-slow 3s linear infinite;
}

/* Gradient backgrounds */
.bg-gradient-mesh-light {
  background:
    radial-gradient(at 40% 20%, rgba(34, 197, 94, 0.08) 0px, transparent 50%),
    radial-gradient(at 80% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 0% 50%, rgba(168, 85, 247, 0.05) 0px, transparent 50%);
}

.bg-gradient-mesh-dark {
  background:
    radial-gradient(at 40% 20%, rgba(34, 197, 94, 0.1) 0px, transparent 50%),
    radial-gradient(at 80% 0%, rgba(59, 130, 246, 0.1) 0px, transparent 50%),
    radial-gradient(at 0% 50%, rgba(168, 85, 247, 0.05) 0px, transparent 50%);
}

/* Cards */
.card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

body.dark .card {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(71, 85, 105, 0.5);
  backdrop-filter: blur(12px);
}

body.dark .card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  border-color: rgba(71, 85, 105, 0.8);
}

/* Sidebar */
.sidebar {
  background: white;
  border-right: 1px solid #e2e8f0;
}

body.dark .sidebar {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(71, 85, 105, 0.5);
  backdrop-filter: blur(12px);
}

/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid #e2e8f0;
  backdrop-filter: blur(12px);
}

body.dark .navbar {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(71, 85, 105, 0.5);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

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

.btn-primary {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  border: none;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
  background: #e2e8f0;
}

body.dark .btn-secondary {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #475569;
}

body.dark .btn-secondary:hover:not(:disabled) {
  background: #334155;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Inputs */
.input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  outline: none;
}

.input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.input::placeholder {
  color: #94a3b8;
}

body.dark .input {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}

body.dark .input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

body.dark .input::placeholder {
  color: #64748b;
}

/* Select */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

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

.table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #f1f5f9;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

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

body.dark .table th {
  color: #94a3b8;
  border-color: #334155;
}

body.dark .table td {
  border-color: #1e293b;
}

body.dark .table tbody tr:hover {
  background-color: rgba(51, 65, 85, 0.3);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
}

.badge-success {
  background: #dcfce7;
  color: #16a34a;
}

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

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

.badge-info {
  background: #dbeafe;
  color: #2563eb;
}

.badge-gray {
  background: #f1f5f9;
  color: #64748b;
}

body.dark .badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

body.dark .badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

body.dark .badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

body.dark .badge-info {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

body.dark .badge-gray {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

/* Status dots */
.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-dot.pending {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* Loading spinner */
.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid #e2e8f0;
  border-top-color: #22c55e;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

body.dark .spinner {
  border-color: #475569;
  border-top-color: #22c55e;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 32rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

body.dark .modal-content {
  background: #1e293b;
  border: 1px solid #334155;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 100;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-success {
  background: #22c55e;
  color: white;
}

.toast-error {
  background: #ef4444;
  color: white;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem;
}

.empty-state-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  color: #94a3b8;
}

body.dark .empty-state-icon {
  color: #64748b;
}

/* Operation type badges */
.badge-brand {
  background: #dcfce7;
  color: #16a34a;
}

.badge-blue {
  background: #dbeafe;
  color: #2563eb;
}

.badge-green {
  background: #dcfce7;
  color: #16a34a;
}

.badge-red {
  background: #fee2e2;
  color: #dc2626;
}

.badge-yellow {
  background: #fef3c7;
  color: #d97706;
}

.badge-purple {
  background: #f3e8ff;
  color: #9333ea;
}

body.dark .badge-brand {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

body.dark .badge-blue {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

body.dark .badge-green {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

body.dark .badge-red {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

body.dark .badge-yellow {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

body.dark .badge-purple {
  background: rgba(147, 51, 234, 0.2);
  color: #c084fc;
}

/* Button variants */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-ghost {
  background: transparent;
  border: none;
}

.btn-ghost:hover:not(:disabled) {
  background: #f1f5f9;
}

body.dark .btn-ghost:hover:not(:disabled) {
  background: #334155;
}

/* Data Table */
.table-container {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

body.dark .table-container {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(71, 85, 105, 0.5);
}

.table-th {
  text-align: left;
  padding: 0.875rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  white-space: nowrap;
}

body.dark .table-th {
  color: #94a3b8;
}

.table-td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  border-top: 1px solid #f1f5f9;
}

body.dark .table-td {
  border-color: rgba(51, 65, 85, 0.5);
}

.table-row {
  transition: background-color 0.15s ease;
}

.table-row:hover {
  background: #f8fafc;
}

body.dark .table-row:hover {
  background: rgba(51, 65, 85, 0.3);
}

/* Pagination */
.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

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

.pagination-btn.active {
  background: #22c55e;
  color: white;
  border-color: #22c55e;
}

body.dark .pagination-btn {
  background: #1e293b;
  border-color: #475569;
  color: #94a3b8;
}

body.dark .pagination-btn:hover:not(:disabled) {
  background: #334155;
}

body.dark .pagination-btn.active {
  background: #22c55e;
  color: white;
  border-color: #22c55e;
}

/* Modal */
.modal {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-height: 90vh;
  overflow-y: auto;
}

body.dark .modal {
  background: #1e293b;
  border: 1px solid #334155;
}

/* Scale transition for modal */
.scale-enter-active,
.scale-leave-active {
  transition: all 0.2s ease;
}

.scale-enter-from,
.scale-leave-to {
  opacity: 0;
  transform: scale(0.95);
}

/* Responsive utilities */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

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

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 30;
  }
}
