/* Glassmorphism Auth Container */
.admin-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  position: relative;
  z-index: 1;
}

.auth-box {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 2.5rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.auth-box h2 {
  margin-top: 0;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
}

.auth-box p {
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(5, 11, 13, 0.6);
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--teal-bright);
  background: rgba(5, 11, 13, 0.8);
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.25);
}

.error-text {
  color: #ff4b4b !important;
  margin-top: 1rem !important;
  margin-bottom: 0 !important;
  font-weight: 500;
}

.hidden {
  display: none !important;
}

/* Dashboard Layout */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1rem, 3vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 11, 13, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-main {
  padding: 2rem clamp(1rem, 3vw, 3rem);
  max-width: 1200px;
  margin: 0 auto;
}

.admin-tabs {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.25rem;
  display: flex;
  gap: 0.75rem;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-heading {
  margin-bottom: 2rem;
}

.section-heading.split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.section-heading h2 {
  margin: 0;
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}

/* Stats Dashboard */
.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  padding: 1.5rem 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 245, 212, 0.3);
  box-shadow: 0 12px 30px rgba(0, 245, 212, 0.08);
}

.stat-value {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Cards & Panels */
.tool-card {
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 2.5rem;
}

.tool-card h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.tool-card p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.status-text {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 500;
}

/* Gallery Admin */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.admin-image-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-image-card:hover {
  transform: scale(1.02);
  border-color: var(--teal-bright);
  box-shadow: 0 8px 24px rgba(0, 245, 212, 0.15);
}

.admin-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-image-card .delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 75, 75, 0.95);
  color: white;
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 800;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.admin-image-card .delete-btn:hover {
  background: rgb(255, 40, 40);
  transform: scale(1.1);
}

/* Packages Admin List */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.admin-item {
  background: var(--panel);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-item:hover {
  border-color: rgba(0, 245, 212, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.admin-item-info {
  flex-grow: 1;
  min-width: 0;
}

.admin-item-info h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-item-info p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.admin-item-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.admin-item-actions .button.edit {
  background: rgba(255, 190, 11, 0.12);
  color: var(--gold);
  border: 1px solid rgba(255, 190, 11, 0.3);
}

.admin-item-actions .button.edit:hover {
  background: rgba(255, 190, 11, 0.22);
  border-color: var(--gold);
  box-shadow: 0 6px 16px rgba(255, 190, 11, 0.15);
}

.admin-item-actions .button.danger {
  background: rgba(255, 75, 75, 0.12);
  color: #ff4b4b;
  border: 1px solid rgba(255, 75, 75, 0.3);
}

.admin-item-actions .button.danger:hover {
  background: rgba(255, 75, 75, 0.22);
  border-color: #ff4b4b;
  box-shadow: 0 6px 16px rgba(255, 75, 75, 0.15);
}

/* Form layouts */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
}

/* Responsive Styles for Admin Dashboard */
@media (max-width: 768px) {
  .admin-main {
    padding: 1.5rem 1rem;
  }

  .admin-item {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .admin-item-info h4 {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .admin-item-info h4 span {
    margin-left: 0 !important;
  }

  .admin-item-actions {
    width: 100%;
    gap: 0.75rem;
  }

  .admin-item-actions .button {
    flex: 1;
    justify-content: center;
    padding: 0.75rem;
    font-size: 0.85rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-actions .button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .auth-box {
    padding: 1.5rem;
  }

  .admin-header {
    padding: 0.75rem 1rem;
  }

  .admin-header .brand {
    font-size: 1.1rem;
    font-weight: 700;
  }

  .section-heading h2 {
    font-size: 1.5rem;
  }
}

/* Search and Filter Container */
.search-filter-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  background: var(--panel);
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.search-wrapper {
  position: relative;
  flex: 1;
}

.search-wrapper .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.95rem;
  pointer-events: none;
}

#package-search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(5, 11, 13, 0.6);
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#package-search-input:focus {
  outline: none;
  border-color: var(--teal-bright);
  background: rgba(5, 11, 13, 0.8);
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.25);
}

.filter-wrapper select {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(5, 11, 13, 0.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238e9fa5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 5 3 3 3-3'/%3E%3C/svg%3E") no-repeat right 1rem center;
  appearance: none;
  -webkit-appearance: none;
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 160px;
}

.filter-wrapper select:focus {
  outline: none;
  border-color: var(--teal-bright);
  background-color: rgba(5, 11, 13, 0.8);
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.25);
}

/* Package Group styling */
.package-group-section {
  margin-bottom: 2.5rem;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.package-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.package-group-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: capitalize;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.package-group-header h3::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal-bright);
  box-shadow: 0 0 8px var(--teal-bright);
}

/* Specific colors for group dot indicators */
.group-wedding .package-group-header h3::before { background: var(--teal-bright); box-shadow: 0 0 8px var(--teal-bright); }
.group-portrait .package-group-header h3::before { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.group-streaming .package-group-header h3::before { background: #00b4a6; box-shadow: 0 0 8px #00b4a6; }
.group-funeral .package-group-header h3::before { background: var(--wine); box-shadow: 0 0 8px var(--wine); }
.group-naming .package-group-header h3::before { background: #e0aaff; box-shadow: 0 0 8px #e0aaff; }
.group-corporate .package-group-header h3::before { background: #0077b6; box-shadow: 0 0 8px #0077b6; }
.group-concert .package-group-header h3::before { background: #ff5400; box-shadow: 0 0 8px #ff5400; }
.group-birthday .package-group-header h3::before { background: #f72585; box-shadow: 0 0 8px #f72585; }
.group-others .package-group-header h3::before { background: #7209b7; box-shadow: 0 0 8px #7209b7; }

.package-count-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.no-packages-found {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  font-weight: 500;
  font-size: 1rem;
}

/* Responsive adjustment for search container */
@media (max-width: 768px) {
  .search-filter-container {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem;
  }
  
  .filter-wrapper select {
    width: 100%;
  }
}
