/* ===== IMPORTAÇÕES ===== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
@import "../inc/shared.css";

/* ===== VARIÁVEIS GLOBAIS ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
}

/* ===== RESET BÁSICO ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: 80px;
}

/* Carrega estilos específicos baseado na página */
body.admin-page {
  @import "../admin/admin.css";
}

body.public-page {
  @import "public.css";
}

/* ===== NAVBAR RESPONSIVA ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 1000;
  padding: 0 1rem;
}

.navbar-brand .navbar-item {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.navbar-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
}

.navbar-burger span {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--text);
  transition: all 0.3s ease;
}

.navbar-burger span:not(:last-child) {
  margin-bottom: 4px;
}

.navbar-burger.is-active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.navbar-burger.is-active span:nth-child(2) {
  opacity: 0;
}

.navbar-burger.is-active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 768px) {
  .navbar-burger {
    display: flex;
  }
  
  .navbar-menu {
    position: fixed;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .navbar-menu.is-active {
    max-height: 400px;
  }
  
  .navbar-item {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }
}

/* ===== LAYOUT DASHBOARD ===== */
.dash-shell {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  padding: 2rem 1rem;
}

@media (max-width: 1024px) {
  .dash-shell {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .sidebar {
    order: 2;
  }
  
  .dash-main {
    order: 1;
  }
}

.sidebar {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.dash-main {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* ===== TABELAS RESPONSIVAS ===== */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 768px) {
  .table-responsive {
    border: 0;
  }
  
  .table,
  .table thead,
  .table tbody,
  .table th,
  .table td,
  .table tr {
    display: block;
  }
  
  .table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  .table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: 1rem;
  }
  
  .table td {
    border: none;
    position: relative;
    padding-left: 50%;
    padding-bottom: 0.5rem;
  }
  
  .table td:before {
    content: attr(data-label) ": ";
    position: absolute;
    left: 6px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-muted);
  }
}

/* ===== CARDS E COMPONENTES ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-image {
  aspect-ratio: 4/3;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-content {
  padding: 1.5rem;
}

/* ===== BOTÕES ===== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.button.is-primary {
  background: var(--primary);
  color: white;
}

.button.is-primary:hover {
  background: var(--primary-dark);
}

.button.is-success {
  background: var(--success);
  color: white;
}

.button.is-danger {
  background: var(--danger);
  color: white;
}

.button.is-warning {
  background: var(--warning);
  color: white;
}

.button.is-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.button.is-fullwidth {
  width: 100%;
}

/* ===== FORMULÁRIOS ===== */
.field {
  margin-bottom: 1.5rem;
}

.label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.input,
.textarea,
.select select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus,
.textarea:focus,
.select select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* ===== GRID RESPONSIVO ===== */
.columns {
  display: grid;
  gap: 1.5rem;
}

.columns.is-multiline {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (max-width: 768px) {
  .columns.is-multiline {
    grid-template-columns: 1fr;
  }
}

/* ===== UTILITÁRIOS ===== */
.has-text-centered {
  text-align: center;
}

.has-text-weight-bold {
  font-weight: 700;
}

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.5rem; }
.mb-6 { margin-bottom: 2rem; }

.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.5rem; }
.mt-6 { margin-top: 2rem; }

.p-4 { padding: 1rem; }
.p-5 { padding: 1.5rem; }
.p-6 { padding: 2rem; }

/* ===== NOTIFICAÇÕES ===== */
.notification {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.notification.is-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.notification.is-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.notification.is-warning {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fed7aa;
}

/* ===== LOADING E ESTADOS ===== */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== LINKBIO ===== */
.linkbio-section {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.linkbio-container {
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 2rem;
  box-shadow: var(--shadow-lg);
}

.linkbio-btn {
  display: block;
  width: 100%;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 50px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.linkbio-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 480px) {
  .profile-photo {
    width: 100px;
    height: 100px;
  }
  
  .linkbio-btn {
    padding: 0.875rem;
    font-size: 0.9rem;
  }
}
