
/* Admin Panel Styles */

.admin-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--dark);
}

.admin-sidebar {
  width: 250px;
  background-color: rgba(26, 31, 44, 0.9);
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.admin-logo {
  padding: 0 1.5rem;
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-logo h2 {
  font-size: 1.5rem;
}

.admin-logo span {
  color: var(--primary);
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--gray);
  cursor: pointer;
  font-size: 1.2rem;
}

.sidebar-close-btn:hover {
  color: var(--light);
}

.admin-menu {
  display: flex;
  flex-direction: column;
}

.admin-menu-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  color: var(--gray);
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.admin-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--light);
}

.admin-menu-item.active {
  background-color: rgba(139, 92, 246, 0.15);
  color: var(--primary);
  border-left: 4px solid var(--primary);
}

.admin-menu-item i {
  margin-right: 0.75rem;
  font-size: 1.2rem;
  width: 20px;
  text-align: center;
}

.admin-content {
  flex: 1;
  overflow-y: auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-header-title {
  display: flex;
  align-items: center;
}

.admin-header-title h1 {
  font-size: 1.8rem;
  color: var(--light);
}

.menu-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--gray);
  margin-right: 1rem;
  font-size: 1.2rem;
  cursor: pointer;
}

.menu-toggle-btn:hover {
  color: var(--light);
}

.admin-user-info {
  display: flex;
  align-items: center;
}

.admin-user-info span {
  margin-right: 1rem;
  color: var(--light);
}

.admin-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-avatar i {
  color: var(--gray);
}

.admin-page {
  padding: 2rem;
  display: none;
  overflow-y: auto;
}

.admin-page.active {
  display: block;
}

/* Dashboard Stats */
.stats-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(139, 92, 246, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-right: 1rem;
}

.stat-info h3 {
  color: var(--gray);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.stat-info p {
  font-size: 1.8rem;
  font-weight: bold;
}

/* Admin Tables */
.action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.add-button, .sync-button {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  transition: background-color 0.3s;
  cursor: pointer;
}

.add-button i, .sync-button i {
  margin-right: 0.5rem;
}

.add-button:hover, .sync-button:hover {
  background-color: var(--primary-dark);
}

.sync-button {
  background-color: var(--secondary);
}

.sync-button:hover {
  background-color: var(--secondary-dark);
}

.admin-table-container {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  overflow: auto;
  max-width: 100%;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.admin-table th {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  text-align: left;
  font-weight: 500;
  color: var(--light);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--gray-light);
}

.admin-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

.table-poster {
  width: 50px;
  height: 75px;
  border-radius: 0.25rem;
  overflow: hidden;
}

.table-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-thumbnail {
  width: 80px;
  height: 45px;
  border-radius: 0.25rem;
  overflow: hidden;
}

.table-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

.table-actions button {
  width: 32px;
  height: 32px;
  border-radius: 0.25rem;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: background-color 0.3s;
  cursor: pointer;
}

.edit-btn {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.edit-btn:hover {
  background-color: rgba(16, 185, 129, 0.2);
}

.delete-btn {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.delete-btn:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
}

.status-ongoing {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-completed {
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--primary);
}

.status-coming {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-vip {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-free {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

/* Admin Forms */
.image-preview {
  margin-top: 1rem;
  max-width: 100%;
  height: 150px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  overflow: hidden;
}

.image-preview img {
  max-width: 100%;
  height: 100%;
  object-fit: contain;
}

progress {
  width: 100%;
  height: 10px;
  margin-top: 0.5rem;
  border-radius: var(--radius);
  background-color: rgba(255, 255, 255, 0.1);
}

progress::-webkit-progress-bar {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
}

progress::-webkit-progress-value {
  background-color: var(--primary);
  border-radius: var(--radius);
}

/* Modal styles - improving scroll behavior */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1001;
  overflow-y: auto;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-content {
  position: relative;
  background-color: rgba(26, 31, 44, 0.95);
  margin: 2rem auto;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: 700px;
  width: 100%;
  max-height: 85vh; /* Increased max-height */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
  z-index: 10;
}

.close-modal:hover {
  color: var(--light);
}

/* Form submit button */
.submit-button {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
  width: 100%;
  margin-top: 1.5rem;
  font-size: 1rem;
}

.submit-button:hover {
  background-color: var(--primary-dark);
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--light);
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: var(--light);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.toast {
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  min-width: 250px;
  max-width: 350px;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--error);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast i {
  margin-right: 10px;
  font-size: 1.2rem;
}

/* Overlay */
.admin-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 900;
  display: none;
}

/* Responsive Admin Panel */
@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    left: -250px;
    top: 0;
    bottom: 0;
    transition: left 0.3s ease;
  }
  
  .admin-sidebar.active {
    left: 0;
  }
  
  .sidebar-close-btn {
    display: block;
  }
  
  .menu-toggle-btn {
    display: block;
  }
  
  .admin-header-title h1 {
    font-size: 1.5rem;
  }
  
  .stats-container {
    grid-template-columns: 1fr;
  }
  
  .admin-page {
    padding: 1rem;
  }

  .modal {
    padding: 0;
  }

  .modal-content {
    width: 95%;
    margin: 1rem auto;
    padding: 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .action-bar {
    justify-content: center;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px; /* Prevents iOS zoom on input fields */
  }
  
  .submit-button {
    padding: 1rem;
  }
}
