/* ==========================================================================
   SISTEMA DE DESIGN - CORTESIAS DE PARQUE (UI/UX PRO MAX)
   Estética: Modern Water Park Premium, Clean, Glassmorphism, Fully Responsive
   ========================================================================== */

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

:root {
  /* Paleta de Cores Principal */
  --primary: #0077ff;
  --primary-hover: #0056b3;
  --primary-light: #e6f0ff;
  --secondary: #00b4d8;
  --accent: #06d6a0;
  
  /* Status Colors */
  --status-pending-bg: #fef3c7;
  --status-pending-text: #b45309;
  --status-active-bg: #d1fae5;
  --status-active-text: #047857;
  --status-inactive-bg: #fee2e2;
  --status-inactive-text: #b91c1c;
  --status-used-bg: #dbeafe;
  --status-used-text: #1d4ed8;

  /* Cores de Fundo e Superfícies */
  --bg-main: #f3f6f9;
  --bg-card: #ffffff;
  --bg-alt: #f8fafc;
  --border-color: #e2e8f0;

  /* Tipografia e Cores de Texto */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  /* Sombras e Bordas */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px rgba(0, 119, 255, 0.12);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* Base Layout Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   PUBLIC TICKET VIEW (cortesias.php)
   ========================================================================== */
.ticket-wrapper {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.ticket-header {
  text-align: center;
  margin-bottom: 24px;
}

.ticket-header img.logo {
  max-height: 85px;
  width: auto;
  object-fit: contain;
  margin-bottom: 12px;
}

.ticket-title {
  font-size: 1.6rem;
  color: #0088cc;
  margin-bottom: 16px;
  font-weight: 700;
}

/* Badge de Status */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 32px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 20px;
}

.status-badge.pendente { background-color: #ffc107; color: #ffffff; }
.status-badge.ativo { background-color: #10b981; color: #ffffff; }
.status-badge.inativo, .status-badge.cancelado { background-color: #ef4444; color: #ffffff; }
.status-badge.utilizado { background-color: #3b82f6; color: #ffffff; }

/* Grid de Informações da Reserva */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.info-card {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid #f1f5f9;
}

.info-card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.info-card-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  word-break: break-word;
}

/* Alerta de Limite de Horário */
.alert-box {
  background-color: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  color: #92400e;
  font-size: 0.95rem;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-box i {
  font-size: 1.2rem;
  color: #b45309;
  margin-top: 2px;
}

.alert-box strong { font-weight: 700; }

.section-title {
  font-size: 1.2rem;
  color: #0088cc;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.responsible-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.responsible-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.responsible-detail {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.guest-card {
  background: #f4fbff;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid #e0f2fe;
}

.guest-number-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.guest-details {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.minor-box {
  background: #ffffff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  margin-bottom: 16px;
  border: 1px solid #e2e8f0;
}

.minor-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.minor-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}

.qrcode-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 16px;
}

.qrcode-box {
  background: #ffffff;
  padding: 16px 20px 12px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
}

.qrcode-target {
  display: flex;
  justify-content: center;
  align-items: center;
}

.qrcode-target svg, .qrcode-target img, .qrcode-target canvas {
  width: 165px !important;
  height: 165px !important;
  display: block;
}

.qrcode-label {
  font-size: 0.88rem;
  color: #64748b;
  margin-top: 8px;
  font-weight: 500;
  text-align: center;
}

.guest-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

/* ==========================================================================
   PAINEL ADMIN - NAVBAR REFORMULADO (UI/UX PRO MAX)
   ========================================================================== */

.admin-navbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.04);
  height: 70px;
  display: flex;
  align-items: center;
}

.admin-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  position: relative;
}

/* Marca / Logo */
.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: #0a2540;
  letter-spacing: -0.3px;
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 800;
  background: #e0f2fe;
  color: #0284c7;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

/* Navigation Menu Wrapper (Desktop) */
.admin-nav-wrapper {
  display: flex;
  align-items: center;
  gap: 28px;
}

.admin-menu-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #475569;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary);
  background: #f1f5f9;
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

.btn-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 119, 255, 0.25);
  white-space: nowrap;
  min-height: 38px;
}

.btn-header-cta:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(0, 119, 255, 0.35);
}

/* User Badge Widget */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-full);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0077ff 0%, #00b4d8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0, 119, 255, 0.3);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.user-role {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 500;
}

.btn-logout {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fee2e2;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: var(--transition);
  text-decoration: none;
  margin-left: 4px;
}

.btn-logout:hover {
  background: #ef4444;
  color: #ffffff;
}

.mobile-menu-toggle {
  display: none;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 1.2rem;
  color: #0f172a;
  cursor: pointer;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

/* ==========================================================================
   PAINEL ADMIN (login.php, index.php, etc.)
   ========================================================================== */

/* Form de Login */
.login-body {
  background: linear-gradient(135deg, #0a2540 0%, #004b93 50%, #0077ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.login-card .logo {
  max-height: 80px;
  margin-bottom: 16px;
}

.login-title {
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* Forms e Inputs */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: var(--font-family);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  transition: var(--transition);
  min-height: 44px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 119, 255, 0.15);
}

select.form-control {
  cursor: pointer;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-family);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  width: 100%;
  min-height: 44px;
}

.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover { background: var(--primary-hover); color: #ffffff; box-shadow: 0 4px 14px rgba(0, 119, 255, 0.35); }
.btn-success { background: var(--accent); color: #ffffff; }
.btn-success:hover { background: #05b88a; color: #ffffff; }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover { background: #cbd5e1; color: #0f172a; }
.btn-danger { background: #ef4444; color: #ffffff; }
.btn-danger:hover { background: #dc2626; }

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
  width: auto;
  min-height: 38px;
}

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

/* Dashboard Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: #e0f2fe; color: #0284c7; }
.stat-icon.green { background: #d1fae5; color: #059669; }
.stat-icon.yellow { background: #fef3c7; color: #d97706; }
.stat-icon.purple { background: #f3e8ff; color: #7e22ce; }

.stat-value {
  font-size: 1.8rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: #0f172a;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Tabelas */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch;
}

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

.data-table th {
  background: #f8fafc;
  padding: 14px 18px;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background-color: #f8fafc; }

/* Alertas de Notificação */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-warning { background: #fffbeb; border: 1px solid #fef3c7; color: #92400e; }

/* Dynamic Guest Form Builder */
.guest-item-form {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  position: relative;
}

.guest-item-form .remove-guest-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #fee2e2;
  color: #ef4444;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
}

/* Print Styles */
@media print {
  body { background: #ffffff; }
  .guest-actions, .admin-navbar, .btn { display: none !important; }
  .ticket-wrapper { max-width: 100%; padding: 0; }
  .info-card, .responsible-card, .guest-card { border: 1px solid #ccc !important; box-shadow: none !important; }
}

/* Utility Classes */
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.text-center { text-align: center; }
.w-auto { width: auto; }

/* ==========================================================================
   REGRAS DE RESPONSIVIDADE COMPLETA (SMARTPHONES E TABLETS)
   ========================================================================== */

@media (max-width: 992px) {
  .admin-navbar {
    height: 64px;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Drawer Mobile Deslizante */
  .admin-nav-wrapper {
    position: absolute;
    top: calc(100% + 8px);
    left: 16px;
    right: 16px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.18);
    border: 1px solid #e2e8f0;
    padding: 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1000;
  }

  .admin-nav-wrapper.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .admin-menu-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
  }

  .admin-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .nav-link {
    padding: 12px 16px;
    font-size: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    justify-content: flex-start;
    width: 100%;
  }

  .btn-header-cta {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.95rem;
  }

  .user-badge {
    width: 100%;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: var(--radius-md);
    margin-top: 4px;
    border: 1px solid #e2e8f0;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .brand-tag {
    display: none;
  }

  /* Cabeçalhos de Página */
  .d-flex.justify-between.align-center {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .d-flex.justify-between.align-center > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .d-flex.justify-between.align-center .btn {
    width: 100% !important;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
    gap: 12px;
  }

  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .grid-2-cols {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  form[action="cortesias_admin.php"], 
  form[action="socios.php"] {
    grid-template-columns: 1fr !important;
  }

  .data-table th, .data-table td {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .login-card {
    padding: 30px 20px;
  }
}

@media (max-width: 480px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .ticket-wrapper {
    padding: 16px 12px 32px;
  }

  .info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .info-card {
    padding: 12px;
  }

  .info-card-value {
    font-size: 1rem;
  }

  .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}
