﻿/* ============================================================
   RESPONSIVE NAVIGATION & GLOBAL STYLES
   ============================================================ */

/* Variáveis responsivas */
:root {
  --navbar-height: 70px;
  --container-padding: 20px;
  --mobile-padding: 15px;
}

/* ============================================================
   NAVBAR RESPONSIVA
   ============================================================ */

.navbar {
  position: relative;
}

/* Menu Hambúrguer */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 5px 10px;
  transition: transform 0.3s ease;
  z-index: 1001;
}

.navbar-toggle:hover {
  transform: scale(1.1);
  color: var(--brand-orange);
}

.navbar-toggle.active {
  position: fixed;
  right: 20px;
  top: 15px;
}

/* ============================================================
   MEDIA QUERIES - TABLET (max-width: 1024px)
   ============================================================ */

@media (max-width: 1024px) {
  .navbar-container {
    padding: 0 var(--mobile-padding);
  }

  .container,
  .mapa-container {
    padding: 0 var(--mobile-padding);
  }

  /* Ajustar grids para tablet */
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .spots-container {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* ============================================================
   MEDIA QUERIES - MOBILE LARGE (max-width: 768px)
   ============================================================ */

@media (max-width: 768px) {
  :root {
    --navbar-height: 60px;
  }

  /* Navbar Mobile */
  .navbar-toggle {
    display: block;
  }

  .navbar-container {
    flex-wrap: wrap;
    position: relative;
  }

  .navbar-brand {
    flex: 1;
  }

  .navbar-brand a {
    font-size: 20px !important;
  }

  .navbar-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a1a 0%, #2a2a2b 100%);
    padding: 80px 20px 20px;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    overflow-y: auto;
  }

  .navbar-menu.active {
    right: 0;
  }

  .navbar-menu ul {
    flex-direction: column;
    gap: 0;
  }

  .navbar-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar-menu a {
    display: block;
    padding: 15px 10px;
    font-size: 16px;
    transition: all 0.3s ease;
  }

  .navbar-menu a:hover {
    padding-left: 20px;
    background: rgba(214, 109, 36, 0.12);
  }

  .navbar-user {
    width: 100%;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Overlay quando menu está aberto */
  .navbar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    backdrop-filter: blur(2px);
  }

  .navbar-overlay.active {
    display: block;
  }

  /* Welcome Section */
  .welcome-section {
    padding: 30px 20px !important;
    margin-bottom: 25px !important;
  }

  .welcome-section h1 {
    font-size: 24px !important;
  }

  .welcome-section p {
    font-size: 14px !important;
  }

  /* Stats Grid - 2 colunas em mobile */
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px !important;
  }

  .stat-card {
    padding: 20px 15px !important;
  }

  .stat-number {
    font-size: 28px !important;
  }

  .stat-label {
    font-size: 13px !important;
  }

  /* Grids gerais */
  .grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Container */
  .container {
    margin: 20px auto;
    padding: 0 var(--mobile-padding);
  }

  /* Headings */
  h2 {
    font-size: 22px !important;
    margin-bottom: 15px !important;
  }

  /* Product Cards */
  .product-card {
    margin-bottom: 15px;
  }

  .product-image {
    height: 180px !important;
  }

  /* Profile */
  .profile-card {
    padding: 20px !important;
  }

  .profile-avatar {
    width: 80px !important;
    height: 80px !important;
    font-size: 32px !important;
  }

  /* Admin Tabs */
  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px !important;
  }

  .admin-tab {
    padding: 12px 18px !important;
    font-size: 14px !important;
    white-space: nowrap;
  }

  /* Tables */
  .table {
    font-size: 14px;
  }

  .table thead {
    display: none;
  }

  .table tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: white;
  }

  .table td {
    display: flex;
    justify-content: space-between;
    padding: 8px 5px !important;
    border: none !important;
    text-align: right !important;
  }

  .table td::before {
    content: attr(data-label);
    font-weight: bold;
    text-align: left;
    color: #333;
  }

  /* Buttons */
  button,
  .btn-logout,
  .btn-salvar,
  .btn-adicionar {
    font-size: 14px;
    padding: 10px 16px !important;
  }

  /* Mapa */
  .mapa-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .mapa-header h1 {
    font-size: 24px !important;
  }

  .controls {
    width: 100%;
    flex-direction: column;
  }

  .controls select,
  .controls button {
    width: 100%;
  }

  #map {
    height: 400px !important;
    margin-bottom: 20px;
  }

  .spots-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .spot-card {
    padding: 15px !important;
  }

  /* Modalidades */
  .modalidade-card {
    width: 100% !important;
    min-height: 220px !important;
  }

  .modalidade-icon {
    height: 60px !important;
    font-size: 40px !important;
  }

  .modalidade-info h3 {
    font-size: 1.2rem !important;
  }

  .modalidade-info p {
    font-size: 0.85rem !important;
  }

  .modalidade-categorias {
    width: 95vw !important;
    height: 70vh !important;
  }

  .categoria-tag {
    font-size: 0.9rem !important;
    padding: 10px 14px !important;
    max-width: 200px !important;
  }

  /* Form Groups */
  .form-group {
    margin-bottom: 18px !important;
  }

  .form-group label {
    font-size: 13px !important;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 14px !important;
    padding: 10px 12px !important;
  }
}

/* ============================================================
   MEDIA QUERIES - MOBILE SMALL (max-width: 480px)
   ============================================================ */

@media (max-width: 480px) {
  :root {
    --mobile-padding: 12px;
  }

  /* Stats em coluna única */
  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Navbar */
  .navbar-brand a {
    font-size: 18px !important;
  }

  .navbar-menu {
    width: 100%;
    right: -100%;
  }

  .navbar-menu.active {
    right: 0;
  }

  .navbar-toggle {
    font-size: 24px;
  }

  .role-badge {
    font-size: 10px !important;
    padding: 4px 10px !important;
  }

  /* Welcome Section */
  .welcome-section {
    padding: 20px 15px !important;
  }

  .welcome-section h1 {
    font-size: 20px !important;
  }

  .welcome-section p {
    font-size: 13px !important;
  }

  /* Cards */
  .stat-card {
    padding: 18px 12px !important;
  }

  .stat-number {
    font-size: 24px !important;
  }

  .stat-label {
    font-size: 12px !important;
  }

  /* Headings */
  h2 {
    font-size: 20px !important;
  }

  /* Mapa */
  #map {
    height: 300px !important;
  }

  .mapa-header h1 {
    font-size: 20px !important;
  }

  /* Modalidades */
  .modalidade-card {
    min-height: 200px !important;
  }

  .modalidade-icon {
    height: 50px !important;
    font-size: 32px !important;
  }

  .modalidade-info {
    padding: 15px !important;
  }

  .modalidade-info h3 {
    font-size: 1.1rem !important;
  }

  .modalidade-categorias::before {
    width: 500px !important;
    height: 500px !important;
  }

  .categoria-tag {
    font-size: 0.8rem !important;
    padding: 8px 12px !important;
    max-width: 160px !important;
  }

  /* Botões */
  .btn-primary {
    font-size: 15px !important;
    padding: 12px !important;
  }

  /* Container */
  .container {
    margin: 15px auto;
  }

  /* Product Cards */
  .product-image {
    height: 160px !important;
  }

  /* Profile Avatar */
  .profile-avatar {
    width: 70px !important;
    height: 70px !important;
    font-size: 28px !important;
  }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* Esconder em mobile */
.hide-mobile {
  display: block;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Mostrar apenas em mobile */
.show-mobile {
  display: none;
}

@media (max-width: 768px) {
  .show-mobile {
    display: block !important;
  }
}

/* Scrollbar para mobile */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  ::-webkit-scrollbar-track {
    background: #1a1a1b;
  }

  ::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--brand-orange);
  }
}

/* Prevenir zoom em inputs no iOS */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ============================================================
   DEVICE-SPECIFIC EXPERIENCE LAYER
   Desktop keeps the side dock. Tablet becomes a top-bar layout.
   Mobile becomes an app-style bottom navigation layout.
   ============================================================ */

:root {
  --content-max: 1240px;
  --device-gap: 22px;
  --device-pad: 24px;
}

main,
.profile-shell,
.map-page-shell,
.videos-shell,
.modalidades-shell,
.auth-container {
  min-width: 0;
}

.hero-shell,
.map-page-hero,
.map-toolbar,
.map-panel,
.spots-panel,
.videos-hero,
.videos-toolbar,
.videos-card,
.profile-overview-hero,
.profile-panel,
.moderation-hero,
.moderation-panel,
.auth-card,
.modalidades-hero,
.modalidade-card {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

button,
a,
input,
select,
textarea {
  min-width: 0;
}

@media (min-width: 769px) and (max-width: 1180px) {
  :root {
    --device-gap: 18px;
    --device-pad: 22px;
  }

  .landing-main,
  .profile-shell,
  .map-page-shell,
  .videos-shell,
  .moderation-shell {
    width: min(100% - 32px, 980px);
    padding-top: 28px;
    padding-bottom: 54px;
  }

  .modalidades-shell {
    width: min(100% - 32px, 980px);
    margin-top: 28px;
    margin-bottom: 54px;
  }

  .hero-shell,
  .map-page-hero,
  .videos-hero,
  .profile-overview-hero,
  .moderation-hero,
  .modalidades-hero {
    border-radius: 26px;
    padding: var(--device-pad);
  }

  .map-page-hero,
  .videos-hero,
  .profile-overview-hero,
  .profile-overview-grid,
  .moderation-hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  }

  .profile-overview-head {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .profile-overview-avatar {
    width: 112px;
    height: 112px;
  }

  .profile-stat-grid,
  .map-page-stats,
  .videos-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-toolbar,
  .videos-toolbar {
    position: sticky;
    top: 92px;
    z-index: 100;
  }

  .videos-grid,
  .spots-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #map {
    height: 560px;
  }
}

@media (max-width: 640px) {
  :root {
    --device-gap: 14px;
    --device-pad: 16px;
  }

  body {
    background:
      linear-gradient(180deg, #101923 0%, #111923 58%, #0f131a 100%);
  }

  .landing-main,
  .profile-shell,
  .map-page-shell,
  .videos-shell,
  .moderation-shell {
    width: min(100% - 14px, 480px);
    padding-top: 12px;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
    gap: var(--device-gap);
  }

  .modalidades-shell {
    width: min(100% - 14px, 480px);
    margin-top: 12px;
    margin-bottom: calc(22px + env(safe-area-inset-bottom));
  }

  .hero-shell,
  .map-page-hero,
  .map-toolbar,
  .map-panel,
  .spots-panel,
  .videos-hero,
  .videos-toolbar,
  .videos-card,
  .profile-overview-hero,
  .profile-panel,
  .moderation-hero,
  .moderation-panel,
  .auth-card,
  .modalidades-hero {
    border-radius: 20px;
    padding: var(--device-pad);
  }

  .landing-header,
  .map-section-head,
  .profile-section-head,
  .moderation-panel-head,
  .videos-card-top,
  .spot-card-top,
  .moderation-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .landing-header-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .landing-header-nav a {
    justify-content: center;
    text-align: center;
    padding: 10px 8px;
  }

  .brand-visual {
    grid-template-columns: 54px minmax(0, 1fr);
    column-gap: 12px;
    width: 100%;
  }

  .brand-logo {
    height: 54px;
  }

  .brand-mark {
    align-self: end;
    letter-spacing: 0.12em;
  }

  .brand-name {
    grid-column: 2;
    font-size: 1.65rem;
  }

  .hero-copy h1,
  .map-page-hero h1,
  .videos-hero h1,
  .profile-overview-copy h1,
  .profile-hero h1,
  .moderation-hero h1,
  .modalidades-title {
    font-size: 2.45rem !important;
    line-height: 0.98;
    letter-spacing: 0;
    max-width: none;
  }

  .feature-card h2,
  .issue-card h3,
  .network-showcase-intro h2 {
    font-size: 1.65rem;
    letter-spacing: 0;
  }

  .map-page-hero,
  .videos-hero,
  .profile-overview-hero,
  .profile-overview-grid,
  .profile-grid,
  .moderation-hero,
  .videos-toolbar,
  .map-form-grid,
  .profile-form-columns {
    grid-template-columns: 1fr;
  }

  .map-page-stats,
  .videos-stats,
  .profile-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .map-stat-card,
  .videos-stat-card,
  .profile-stat-card,
  .moderation-stat-card {
    padding: 14px;
  }

  .map-stat-card strong,
  .videos-stat-card strong,
  .profile-stat-card strong {
    font-size: 1.55rem;
  }

  .map-toolbar,
  .videos-toolbar {
    position: sticky;
    top: 8px;
    z-index: 300;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
  }

  .map-toolbar-actions,
  .map-form-actions,
  .videos-card-actions,
  .profile-overview-actions,
  .profile-photo-actions,
  .moderation-toolbar,
  .moderation-actions,
  .modalidade-modal-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .map-toolbar-actions button,
  .map-form-actions button,
  .videos-card-actions a,
  .profile-overview-actions a,
  .profile-primary-button,
  .profile-secondary-button,
  .moderation-actions button,
  .modalidade-modal-actions a,
  .modalidade-modal-actions button {
    width: 100%;
  }

  .videos-grid,
  .spots-grid,
  .profile-publication-list,
  .profile-follower-list,
  .profile-message-list,
  .moderation-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .videos-card,
  .spot-card,
  .profile-publication-card,
  .profile-follower-card,
  .profile-message-card,
  .moderation-card {
    border-radius: 18px;
  }

  #map {
    height: min(62vh, 420px) !important;
    min-height: 320px;
    border-radius: 18px;
  }

  .map-modal {
    align-items: end;
    padding: 10px;
  }

  .map-modal-card {
    width: 100%;
    max-height: 88vh;
    overflow: auto;
    border-radius: 22px;
  }

  .auth-container {
    width: min(100% - 14px, 460px);
    padding: 18px 0 calc(22px + env(safe-area-inset-bottom));
  }

  .auth-header h1 {
    font-size: 2.25rem !important;
    letter-spacing: 0;
  }

  .auth-card::before {
    letter-spacing: 0.1em;
  }
}

@media (max-width: 380px) {
  .hero-copy h1,
  .map-page-hero h1,
  .videos-hero h1,
  .profile-overview-copy h1,
  .profile-hero h1,
  .moderation-hero h1,
  .modalidades-title {
    font-size: 2.08rem !important;
  }

  .map-page-stats,
  .videos-stats,
  .profile-stat-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile comfort pass: keeps the main tools usable without crowding the viewport. */
@media (max-width: 768px) {
  .blob,
  .landing-orb {
    display: none !important;
  }
}

@media (max-width: 640px) {
  :root {
    --device-pad: 18px;
  }

  .map-page-shell,
  .videos-shell,
  .profile-shell,
  .moderation-shell {
    width: min(100% - 18px, 480px) !important;
    gap: 18px;
  }

  .map-page-hero,
  .map-toolbar,
  .map-panel,
  .spots-panel,
  .map-daily-panel,
  .videos-hero,
  .videos-toolbar,
  .videos-tabs,
  .profile-overview-hero,
  .profile-panel,
  .moderation-hero,
  .moderation-panel {
    padding: 18px !important;
  }

  .map-toolbar,
  .videos-toolbar {
    position: static;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
  }

  .map-page-hero p,
  .videos-hero p,
  .profile-overview-copy p,
  .map-section-head p,
  .profile-section-head p {
    line-height: 1.65;
  }

  .map-page-stats,
  .videos-stats,
  .profile-stat-grid,
  .daily-achievements-grid {
    grid-template-columns: 1fr !important;
  }

  .daily-achievement-card,
  .spot-card,
  .videos-card,
  .profile-publication-card,
  .profile-message-card {
    padding: 16px !important;
    gap: 12px;
  }

  .spot-card-actions,
  .spot-video-actions,
  .videos-card-actions,
  .profile-overview-actions,
  .profile-photo-actions,
  .map-form-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .spot-card-actions a,
  .spot-card-actions button,
  .spot-video-actions a,
  .spot-video-actions button,
  .videos-card-actions a,
  .profile-overview-actions a,
  .profile-photo-actions button,
  .map-form-actions button {
    width: 100%;
    min-height: 46px;
  }

  .spot-preview {
    border-radius: 16px;
  }

  .spot-video-list {
    padding: 10px;
  }

  .spot-video-item {
    gap: 10px;
  }

  .video-analysis-card {
    padding: 14px;
  }

  .video-analysis-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

  #map {
    height: min(54vh, 360px) !important;
    min-height: 300px;
  }

  .map-modal {
    align-items: end;
    padding: 8px;
  }

  .map-modal-card {
    padding: 18px;
    max-height: 88vh;
  }

  .videos-tabs {
    gap: 8px;
  }

  .videos-tab {
    min-height: 54px;
    padding: 0 14px;
  }

  .videos-shorts-feed {
    height: calc(100vh - 158px) !important;
    min-height: 430px !important;
    gap: 12px;
  }

  .videos-short-card {
    height: calc(100vh - 174px) !important;
    min-height: 430px !important;
    border-radius: 20px;
  }

  .videos-short-overlay {
    padding: 16px;
  }

  .videos-short-overlay h2,
  .videos-card-copy h2 {
    font-size: 1.12rem;
  }

  .profile-overview-head,
  .profile-photo-section,
  .profile-xp-head {
    grid-template-columns: 1fr !important;
    align-items: start;
    gap: 16px;
  }

  .profile-xp-head {
    display: flex;
    flex-direction: column;
  }

  .profile-avatar-shell,
  .profile-overview-avatar {
    width: 96px !important;
    height: 96px !important;
    border-radius: 20px;
  }

  .profile-follower-card {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .profile-mini-avatar {
    width: 46px;
    height: 46px;
  }
}

@media (max-width: 420px) {
  .hero-copy h1,
  .map-page-hero h1,
  .videos-hero h1,
  .profile-overview-copy h1,
  .profile-hero h1,
  .moderation-hero h1,
  .modalidades-title {
    font-size: 1.96rem !important;
  }

  .map-page-shell,
  .videos-shell,
  .profile-shell,
  .moderation-shell {
    width: min(100% - 12px, 420px) !important;
    gap: 14px;
  }

  .map-page-hero,
  .map-toolbar,
  .map-panel,
  .spots-panel,
  .map-daily-panel,
  .videos-hero,
  .videos-toolbar,
  .videos-tabs,
  .profile-overview-hero,
  .profile-panel,
  .moderation-hero,
  .moderation-panel {
    padding: 15px !important;
    border-radius: 18px;
  }

  .map-stat-card strong,
  .videos-stat-card strong,
  .profile-stat-card strong {
    font-size: 1.35rem;
  }

  .map-field input,
  .map-field select,
  .map-field textarea,
  .profile-field input,
  .profile-field select,
  .profile-field textarea {
    font-size: 16px;
  }

  #map {
    height: 300px !important;
    min-height: 280px;
  }

  .videos-shorts-feed {
    height: calc(100vh - 150px) !important;
    min-height: 380px !important;
  }

  .videos-short-card {
    height: calc(100vh - 166px) !important;
    min-height: 380px !important;
  }

  .videos-short-overlay p,
  .videos-card-copy p,
  .spot-card p,
  .profile-publication-card p {
    font-size: 0.94rem;
  }
}

@media (max-width: 640px) {
  body.landing-page .landing-main {
    width: min(100% - 16px, 480px);
    padding-top: 8px;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  body.landing-page .landing-hero {
    padding: 10px;
  }

  body.landing-page .landing-quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.site-dock-auth .auth-container {
    padding-top: 18px;
  }

  body.site-dock-auth .auth-card {
    gap: 18px;
    padding: 18px 16px;
    border-radius: 22px;
  }
}

