/* =============================================
   Admin Panel Styles
   ============================================= */

/* === Login Page === */
.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
}

.back-to-home {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.back-to-home:hover {
  color: var(--foreground);
}

.back-to-home svg {
  width: 1.25rem;
  height: 1.25rem;
}

.login-card {
  width: 100%;
  max-width: 24rem;
  padding: 2rem;
}

.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  background: hsla(262, 83%, 58%, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.login-icon svg {
  width: 2rem;
  height: 2rem;
  color: var(--primary);
}

.login-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.login-header p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 500;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  padding: 0.625rem 2.5rem 0.625rem 0.75rem;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--foreground);
  transition: all 0.2s;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px hsla(262, 83%, 58%, 0.15);
}

.input-wrapper input::placeholder {
  color: var(--muted-foreground);
}

.toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  padding: 0.25rem;
}

.toggle-password:hover {
  color: var(--foreground);
}

.toggle-password svg {
  width: 1rem;
  height: 1rem;
}

.btn-primary {
  width: 100%;
  padding: 0.625rem 1rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

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

/* === Admin Dashboard === */
.admin-dashboard {
  min-height: 100vh;
  padding: 1rem;
}

@media (min-width: 768px) {
  .admin-dashboard { padding: 2rem; }
}

.admin-container {
  max-width: 56rem;
  margin: 0 auto;
}

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

.admin-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.admin-header p {
  color: var(--muted-foreground);
}

.btn-outline {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--secondary);
}

.btn-outline svg {
  width: 1rem;
  height: 1rem;
}

/* === Tabs === */
.admin-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  background: var(--secondary);
  border-radius: 0.75rem;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}

.admin-tab {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  color: var(--muted-foreground);
  transition: all 0.2s;
  white-space: nowrap;
}

.admin-tab:hover {
  color: var(--foreground);
}

.admin-tab.active {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.admin-tab svg {
  width: 1rem;
  height: 1rem;
}

@media (max-width: 640px) {
  .admin-tab span { display: none; }
  .admin-tab svg { width: 1.25rem; height: 1.25rem; }
}

/* Tab content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* === Admin Cards === */
.admin-card {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-card h2,
.admin-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.admin-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-card h3 svg {
  width: 1.25rem;
  height: 1.25rem;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-form .input-group input,
.admin-form .input-group textarea,
.admin-form .input-group select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--foreground);
  transition: all 0.2s;
}

.admin-form .input-group input:focus,
.admin-form .input-group textarea:focus,
.admin-form .input-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px hsla(262, 83%, 58%, 0.15);
}

.admin-form .input-group textarea {
  min-height: 80px;
  resize: vertical;
}

.admin-form .input-group input::placeholder,
.admin-form .input-group textarea::placeholder {
  color: var(--muted-foreground);
}

.btn-save {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  align-self: flex-start;
}

.btn-save:hover { filter: brightness(1.1); }
.btn-save svg { width: 1rem; height: 1rem; }

/* Photo upload */
.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-photo-preview {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid hsla(262, 83%, 58%, 0.3);
}

.upload-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px dashed hsla(262, 83%, 58%, 0.5);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.upload-label:hover {
  background: hsla(262, 83%, 58%, 0.05);
}

.upload-label svg {
  width: 1rem;
  height: 1rem;
}

.upload-label input[type="file"] {
  display: none;
}

/* === Reviews Manager === */
.review-item {
  border-radius: 0.5rem;
  background: hsla(240, 10%, 14%, 0.3);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.review-item-header {
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: background-color 0.2s;
}

.review-item-header.clickable {
  cursor: pointer;
}

.review-item-header.clickable:hover {
  background: hsla(240, 10%, 14%, 0.5);
}

.drag-handle {
  cursor: grab;
  padding: 0.25rem;
  border-radius: 0.25rem;
  color: var(--muted-foreground);
}

.drag-handle:hover {
  background: hsla(240, 10%, 14%, 0.5);
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.review-thumb {
  width: 4rem;
  height: 4rem;
  border-radius: 0.5rem;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  border: 1px solid hsla(240, 10%, 20%, 0.5);
}

.review-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
}

.review-thumb-overlay svg {
  width: 1.25rem;
  height: 1.25rem;
  color: white;
  fill: white;
}

.review-thumb-placeholder {
  width: 4rem;
  height: 4rem;
  border-radius: 0.5rem;
  background: hsla(262, 83%, 58%, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.review-thumb-placeholder svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--primary);
}

.review-info {
  flex: 1;
  min-width: 0;
}

.review-info h3 {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
}

.review-info p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  background: var(--secondary);
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.toggle-switch.active {
  background: var(--primary);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: white;
  transition: transform 0.2s;
}

.toggle-switch.active::after {
  transform: translateX(1.25rem);
}

.btn-icon {
  padding: 0.375rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

.btn-icon:hover {
  background: var(--secondary);
}

.btn-icon svg {
  width: 1rem;
  height: 1rem;
}

.btn-icon.destructive svg {
  color: var(--destructive);
}

/* Review expanded form */
.review-form {
  padding: 0 1rem 1rem;
  border-top: 1px solid hsla(240, 10%, 20%, 0.3);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1rem;
}

.review-form .input-group input,
.review-form .input-group textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--foreground);
}

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

.char-count {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.hint-text {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Thumbnail upload in review form */
.thumb-upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.thumb-upload-row img {
  width: 5rem;
  height: 3rem;
  border-radius: 0.25rem;
  object-fit: cover;
  border: 1px solid var(--border);
}

.btn-add {
  padding: 0.375rem 0.75rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: filter 0.2s;
}

.btn-add:hover { filter: brightness(1.1); }
.btn-add svg { width: 1rem; height: 1rem; }

/* === Appointments === */
.filter-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.filter-btn.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.filter-btn:not(.active):hover {
  background: var(--secondary);
}

.appointment-item {
  padding: 1rem;
  border-radius: 0.5rem;
  background: hsla(240, 10%, 14%, 0.3);
  transition: background-color 0.2s;
  margin-bottom: 0.75rem;
}

.appointment-item:hover {
  background: hsla(240, 10%, 14%, 0.5);
}

.appointment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.appointment-info {
  flex: 1;
  min-width: 0;
}

.appointment-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.appointment-name svg {
  width: 1rem;
  height: 1rem;
}

.appointment-name span.name {
  font-weight: 500;
}

.appointment-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: hsla(262, 83%, 58%, 0.2);
  color: var(--primary);
}

.appointment-details {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.appointment-details .description {
  color: hsla(0, 0%, 98%, 0.8);
  margin-top: 0.5rem;
}

/* iCal Sync */
.ical-url-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ical-url-display {
  flex: 1;
  background: hsla(240, 10%, 14%, 0.5);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ical-instructions {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.ical-instructions strong {
  color: var(--foreground);
}

/* === Blocked Slots === */
.blocked-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .blocked-form-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.blocked-form-grid .input-group input,
.blocked-form-grid .input-group select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: hsla(240, 10%, 14%, 0.3);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--foreground);
}

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

.blocked-form-grid .btn-col {
  display: flex;
  align-items: flex-end;
}

.blocked-slot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: hsla(240, 10%, 14%, 0.3);
  transition: background-color 0.2s;
  margin-bottom: 0.5rem;
}

.blocked-slot-item:hover {
  background: hsla(240, 10%, 14%, 0.5);
}

.blocked-slot-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.blocked-slot-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: hsla(0, 84%, 60%, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.blocked-slot-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--destructive);
}

.blocked-slot-text p {
  font-weight: 500;
  text-transform: capitalize;
}

.blocked-slot-text .reason {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-weight: 400;
}

.blocked-slot-text .full-day {
  font-size: 0.75rem;
  color: var(--destructive);
  font-weight: 400;
}

/* Loading spinner */
.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.empty-state {
  text-align: center;
  color: var(--muted-foreground);
  padding: 2rem;
}

/* Toast notification */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: fade-up 0.3s ease-out;
  max-width: 24rem;
}

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

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