/* admin.css - Estilos premium y modernos para el Panel Administrativo */

:root {
  --admin-bg: #07090e;
  --admin-card-bg: rgba(13, 17, 24, 0.7);
  --admin-border: rgba(0, 176, 255, 0.15);
  --admin-border-focus: rgba(0, 176, 255, 0.4);
  --admin-glow: rgba(0, 176, 255, 0.2);
  --admin-text-primary: #f8fafc;
  --admin-text-secondary: #94a3b8;
  --admin-text-muted: #64748b;
  --admin-success: #10b981;
  --admin-danger: #ef4444;
}

body.admin-page {
  background-color: var(--admin-bg);
  color: var(--admin-text-primary);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  position: relative;
  overflow-x: hidden;
}

/* Background Glow Effect */
.admin-bg-glow {
  position: fixed;
  top: -10%;
  left: 20%;
  width: 60vw;
  height: 60vh;
  background: radial-gradient(circle, rgba(0, 176, 255, 0.08) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
}

/* Shell Layout */
.admin-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Auth Gate (Login screen) */
.admin-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
  padding: 2.5rem;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  animation: fadeIn 0.5s ease-out;
}

.admin-gate .admin-logo {
  width: 90px;
  height: 90px;
  border-radius: 18px;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 20px rgba(0, 176, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-gate h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.admin-gate p {
  color: var(--admin-text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Topbar Header */
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.admin-topbar h2 {
  font-size: 1.4rem;
  margin: 0 0 4px 0;
  font-weight: 800;
}

.admin-topbar p {
  font-size: 0.85rem;
  color: var(--admin-text-secondary);
  margin: 0;
}

.admin-top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Base Buttons Override */
.admin-shell button.btn, 
.admin-shell a.btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--admin-text-primary);
  padding: 0.6rem 1.2rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-shell button.btn:hover,
.admin-shell a.btn:hover {
  background: var(--admin-text-primary);
  color: #000;
  box-shadow: 0 0 15px rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

#adminLogoutBtn {
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

#adminLogoutBtn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.35);
}

/* User Info Card (Hero) */
.admin-hero {
  background: linear-gradient(135deg, rgba(0, 176, 255, 0.05) 0%, rgba(13, 17, 24, 0.7) 100%);
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(20px);
}

.admin-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-hero h2 {
  font-size: 1.5rem;
  margin: 0.5rem 0 1rem 0;
  font-weight: 800;
}

.admin-presence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.admin-presence-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-presence-label {
  font-size: 0.75rem;
  color: var(--admin-text-secondary);
}

.admin-presence-card strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--admin-text-primary);
}

/* Sections Configuration */
.admin-section, 
.admin-users-section {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.admin-section-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-section-header h3 {
  font-size: 1.25rem;
  margin: 0;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 50%, var(--admin-text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-section-intro {
  color: var(--admin-text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

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

.dev-form label,
.admin-section label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-text-secondary);
}

.admin-shell input[type="text"],
.admin-shell input[type="url"],
.admin-shell input[type="number"],
.admin-shell input[type="password"],
.admin-shell textarea,
.admin-shell select {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-primary);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: all 0.25s ease;
  outline: none;
}

.admin-shell input:focus,
.admin-shell textarea:focus,
.admin-shell select:focus {
  border-color: var(--admin-border-focus);
  box-shadow: 0 0 12px var(--admin-glow);
  background: rgba(0, 0, 0, 0.5);
}

.admin-shell select option {
  background: #0f172a;
  color: #fff;
}

/* Table styling for CEO Tools */
.admin-table-scroll {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
}

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

.admin-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  font-weight: 700;
  color: var(--admin-text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--admin-text-primary);
  white-space: nowrap;
}

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

/* User search input */
.admin-filter-row {
  margin-bottom: 1.25rem;
}

#adminCeoEmailSearch {
  width: 100%;
  max-width: 480px;
}

/* Interactive feedback elements */
.admin-message {
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.3s;
}

.admin-message:empty {
  display: none;
}

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

/* Welcome overlay screen */
.admin-welcome {
  position: fixed;
  inset: 0;
  background: #07090e;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.admin-welcome-card {
  text-align: center;
  padding: 3rem;
  animation: pulseWelcome 2s infinite alternate;
}

.admin-welcome-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.admin-welcome h2 {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 0.75rem;
}

.admin-welcome p {
  color: var(--admin-text-secondary);
  font-size: 1rem;
}

.admin-welcome-line {
  height: 2px;
  width: 60px;
  background: var(--color-secondary);
  margin: 1.5rem auto 0;
  box-shadow: 0 0 10px var(--color-secondary);
}

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

@keyframes pulseWelcome {
  from { transform: scale(0.98); }
  to { transform: scale(1.02); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .admin-shell {
    padding: 1rem;
  }
  .admin-topbar, 
  .admin-hero, 
  .admin-section, 
  .admin-users-section {
    padding: 1.25rem;
  }
  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-top-actions {
    width: 100%;
  }
  .admin-top-actions button {
    flex: 1;
    text-align: center;
  }
}
