:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --bg-dark: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --accent-color: #10b981;
  --danger-color: #ef4444;
  --sidebar-width: 260px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
}

.sidebar-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links {
  list-style: none;
}

.nav-item {
  margin-bottom: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  background-color: var(--primary-color);
  color: white;
}

.nav-link i {
  font-size: 1.2rem;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.header-title h1 {
  font-size: 1.875rem;
  font-weight: 700;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
  font-size: 1.5rem;
}

/* Table */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.quote-cell {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-main);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary-color);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline.playing {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  animation: pulse-primary 2s infinite;
}

@keyframes pulse-primary {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-dark);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background-color: var(--bg-sidebar);
  padding: 2.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 400px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap; /* Important for mobile */
}

.image-preview {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
  border: 1px solid var(--border-color);
}

.image-preview:hover {
  transform: scale(1.1);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}

.page-link:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.page-link.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.page-link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Image Modal */
.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.image-modal.show {
  display: flex;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close-modal {
  position: absolute;
  top: 2rem;
  right: 2rem;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  opacity: 0.7;
}

.close-modal:hover {
  opacity: 1;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1001;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: 10px 0 15px rgba(0, 0, 0, 0.3);
  }

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

  .main-content {
    margin-left: 0;
    padding: 1.5rem;
    padding-top: 5rem;
  }

  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-dark);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .header-title h1 {
    font-size: 1.5rem;
  }

  .user-profile {
    width: 100%;
    justify-content: space-between;
    font-size: 0.875rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .search-bar {
    width: 100%;
    max-width: none;
  }

  /* Table responsive */
  .table-container {
    margin-top: 1rem;
  }

  .quote-cell {
    max-width: 150px;
  }

  /* Form responsive */
  .card {
    padding: 1rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
    display: flex;
    margin-bottom: 0.5rem;
  }

  .action-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 998;
}

.sidebar-overlay.show {
  display: block;
}

