/* CSS Administración - Barbería Classic & Co. */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  --bg-darkest: #070707;
  --bg-dark: #0f0f0f;
  --bg-card: #161616;
  --bg-input: #1e1e1e;
  
  --color-gold: #d4af37;
  --color-gold-hover: #f3e5ab;
  --color-red: #ea4335;
  --color-red-hover: #ff6b5a;
  --color-green: #34a853;
  
  --text-white: #f5f5f5;
  --text-gray-light: #cccccc;
  --text-gray: #888888;
  
  --border-color: #2a2a2a;
  --border-gold: rgba(212, 175, 55, 0.3);
  
  --radius-sm: 4px;
  --radius-md: 8px;
  
  --font-body: 'Montserrat', sans-serif;
  --transition-fast: 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-darkest);
  color: var(--text-white);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Pantalla de Bloqueo / Login */
#login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-darkest);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}

#login-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.login-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  text-align: center;
}

.login-card h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.login-card h2 span {
  color: var(--color-gold);
}

.login-card p {
  color: var(--text-gray);
  font-size: 0.85rem;
  margin-bottom: 30px;
}

/* Form Controls */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: var(--text-gray-light);
}

.form-control {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  width: 100%;
}

.btn-primary {
  background-color: var(--color-gold);
  color: var(--bg-darkest);
}

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

.btn-danger {
  background-color: transparent;
  border-color: rgba(234, 67, 53, 0.4);
  color: var(--color-red);
}

.btn-danger:hover {
  background-color: var(--color-red);
  color: var(--text-white);
  border-color: var(--color-red);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-white);
}

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

/* Layout Principal Admin */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--bg-dark);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 20px;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-brand h1 {
  font-size: 1.3rem;
  letter-spacing: 1px;
  margin-bottom: 30px;
}

.sidebar-brand h1 span {
  color: var(--color-gold);
}

.sidebar-menu {
  list-style: none;
  flex-grow: 1;
}

.sidebar-item {
  margin-bottom: 10px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-gray-light);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
}

.sidebar-link:hover,
.sidebar-link.active {
  background-color: var(--bg-card);
  color: var(--color-gold);
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-gray);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.logout-btn:hover {
  color: var(--color-red);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  margin-left: 260px;
  padding: 40px;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.main-header h2 {
  font-size: 1.8rem;
}

.main-header p {
  color: var(--text-gray);
  font-size: 0.85rem;
}

/* Paneles de Pestañas (Tab Panels) */
.tab-panel {
  display: none;
}

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

/* Dashboard Forms and Grids */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

.admin-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 30px;
  margin-bottom: 30px;
}

.admin-card h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  color: var(--color-gold);
}

/* Tabla de Servicios */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th, 
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-gray);
  font-weight: 600;
}

.admin-table td {
  font-size: 0.85rem;
}

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

.table-actions {
  display: flex;
  gap: 10px;
}

.table-actions button {
  width: auto;
  padding: 6px 12px;
  font-size: 0.75rem;
}

/* Grid de Galería en Admin */
.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.admin-gallery-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.admin-gallery-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.admin-gallery-body {
  padding: 15px;
}

.admin-gallery-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Grid de Publicaciones en Admin */
.admin-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.admin-post-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.admin-post-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.admin-post-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.admin-post-title {
  font-size: 1rem;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-post-content {
  font-size: 0.8rem;
  color: var(--text-gray-light);
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* Toast de Notificación */
#toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--bg-card);
  border-left: 4px solid var(--color-gold);
  color: var(--text-white);
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

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

/* Modal en Admin */
.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(7,7,7,0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.admin-modal.active {
  opacity: 1;
  pointer-events: all;
}

.admin-modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 30px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 35px rgba(0,0,0,0.8);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.admin-modal.active .admin-modal-content {
  transform: scale(1);
}

.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.admin-modal-header h3 {
  font-size: 1.15rem;
}

.admin-modal-close {
  color: var(--text-gray);
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition-fast);
}

.admin-modal-close:hover {
  color: var(--text-white);
}

.modal-actions {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

.modal-actions button {
  flex-grow: 1;
}

/* Responsive */
@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 20px;
  }
  
  .sidebar-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
  }
  
  .sidebar-link {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  .sidebar-footer {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
    padding: 20px;
  }
}

/* --- Estilos Agenda / Turnos Admin --- */
.agenda-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 15px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 25px;
}

.agenda-filter-bar .filter-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.agenda-filter-bar label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-gold);
}

.agenda-filter-bar input[type="date"] {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
}

.barber-config-box {
  background-color: rgba(212, 175, 55, 0.05);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 25px;
}

.barber-config-box h4 {
  color: var(--color-gold);
  margin-bottom: 8px;
}

.barber-config-box p {
  font-size: 0.8rem;
  color: var(--text-gray-light);
  margin-bottom: 15px;
}

.barber-select-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.barber-select {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
}

@media (max-width: 768px) {
  .agenda-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  
  .agenda-filter-bar .filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}

/* ============================================================
   GALERÍA — Drop Zone de Upload
   ============================================================ */
.gallery-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease;
  background-color: rgba(255,255,255,0.02);
  user-select: none;
  position: relative;
}

.gallery-dropzone:hover {
  border-color: var(--color-gold);
  background-color: rgba(212, 175, 55, 0.04);
}

.gallery-dropzone.dz-active {
  border-color: var(--color-gold);
  background-color: rgba(212, 175, 55, 0.08);
  animation: dz-pulse 0.6s ease infinite alternate;
}

@keyframes dz-pulse {
  from { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
  to   { box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.15); }
}
