/* =====================================================
   MODAL DE CRIAÇÃO DE SIMULADO
===================================================== */

.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0,0,0,0.85) !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 999999 !important;
  padding: 20px !important;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
  display: flex !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  animation: slideUp 0.3s ease;
  position: relative !important;
  z-index: 1000000 !important;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 25px;
  border-bottom: 1px solid #e1e8ed;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: white;
}

.modal-header h2 {
  font-size: 1.5em;
  color: #2c3e50;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2em;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
}

.modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

.modal-body {
  padding: 25px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 transparent;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.modal-footer {
  padding: 20px 25px;
  border-top: 1px solid #e1e8ed;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: white;
}

/* FORMULÁRIO DO MODAL */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #555;
}

.form-group input[type="text"],
.form-group input[type="datetime-local"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  font-size: 1em;
}

.form-group input:focus {
  outline: none;
  border-color: #076fde;
}

/* TAGS */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-btn {
  padding: 8px 16px;
  border: 2px solid #e1e8ed;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9em;
}

.tag-btn:hover {
  border-color: #28a745;
  background: #f0f9f4;
}

.tag-btn.active {
  background: #28a745;
  color: white;
  border-color: #28a745;
}

/* RADIO GROUP */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.radio-label:hover {
  border-color: #076fde;
  background: #f8f9ff;
}

.radio-label input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #076fde;
}

.radio-label span {
  font-size: 1em;
  color: #555;
}

/* =====================================================
   SIDEBAR DE SIMULADOS
===================================================== */

.simulados-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  z-index: 999998 !important;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.simulados-sidebar.open {
  transform: translateX(0);
}

.sidebar-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0,0,0,0.85) !important;
  z-index: 999997 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: none !important;
}

.sidebar-overlay.show {
  display: block !important;
}

.sidebar-header {
  padding: 25px;
  border-bottom: 2px solid #e1e8ed;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  font-size: 1.5em;
  color: #2c3e50;
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 2em;
  color: #999;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
}

.sidebar-close:hover {
  background: #f5f5f5;
  color: #333;
}

.sidebar-content {
  padding: 20px;
  height: calc(100vh - 90px);
  overflow-y: auto;
}

/* =====================================================
   BLOQUEIO DE SCROLL - CORRIGE FAIXA BRANCA
===================================================== */

body.modal-open,
html.modal-open {
  overflow: hidden !important;
  height: 100vh !important;
  width: 100vw !important;
}

body.modal-open {
  padding-right: 0 !important;
}

/* =====================================================
   Z-INDEX DO HEADER/MENU
===================================================== */

#masthead,
#colophon,
.site-header,
.site-footer,
#main-navigation,
.main-navigation,
.header-fixo-app,
.mainmenu-fixo-app {
  z-index: 99998 !important;
}

/* =====================================================
   RESPONSIVO - MOBILE
===================================================== */

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .header-thin {
    padding: 15px;
    margin-bottom: 20px;
  }
  
  .header-thin h1 {
    font-size: 1.3em;
  }
  
  .header-thin p {
    font-size: 0.85em;
  }
  
  .contador-selecao {
    flex-direction: column;
    gap: 15px;
    text-align: center;
    padding: 15px;
  }
  
  .contador-info {
    flex-direction: column;
    gap: 10px;
  }
  
  .contador-numero {
    font-size: 2em;
  }
  
  .contador-acoes {
    width: 100%;
    flex-direction: column;
  }
  
  .contador-acoes .btn {
    width: 100%;
  }
  
  .filters {
    padding: 15px;
  }
  
  .filters h3 {
    font-size: 1.1em;
  }
  
  .filter-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .filter-actions-unified {
    flex-direction: column;
    gap: 8px;
  }
  
  .filter-actions-unified .btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 0.9em;
  }
  
  .btn-atalho {
    margin-left: 0 !important;
  }
  
  .questao-card {
    padding: 15px;
  }
  
  .questao-card.modo-selecao {
    padding-left: 50px;
  }
  
  .questao-checkbox {
    left: 15px;
  }
  
  .questao-titulo {
    font-size: 1em;
  }
  
  .questao-preview {
    font-size: 0.85em;
  }
  
  .questao-info {
    gap: 6px;
  }
  
  .badge {
    font-size: 0.75em !important;
    padding: 4px 8px !important;
  }
  
  .simulados-sidebar {
    width: 100%;
    max-width: 100%;
  }
  
  .sidebar-header {
    padding: 15px;
  }
  
  .sidebar-header h2 {
    font-size: 1.2em;
  }
  
  .sidebar-content {
    padding: 15px;
  }
  
  .modal-content {
    width: 95%;
    max-width: 95%;
    max-height: 90vh;
    margin: 0;
  }
  
  .modal-header {
    padding: 15px;
  }
  
  .modal-header h2 {
    font-size: 1.2em;
  }
  
  .modal-body {
    padding: 15px;
  }
  
  .modal-footer {
    padding: 15px;
    flex-direction: column;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
  
  .tags-container {
    gap: 6px;
  }
  
  .tag-btn {
    font-size: 0.8em;
    padding: 6px 12px;
  }
  
  .radio-label {
    padding: 10px;
  }
  
  .form-group input[type="text"],
  .form-group input[type="datetime-local"],
  .form-group select {
    font-size: 16px;
  }
  
  .empty-state {
    padding: 40px 15px;
  }
  
  .empty-state svg {
    width: 80px;
    height: 80px;
  }
  
  .empty-state h3 {
    font-size: 1.2em;
  }
}

@media (max-width: 480px) {
  .header-thin h1 {
    font-size: 1.1em;
  }
  
  .contador-numero {
    font-size: 1.8em;
    padding: 8px 16px;
  }
  
  .questao-card {
    padding: 12px;
  }
  
  .modal-close,
  .sidebar-close {
    width: 35px;
    height: 35px;
    font-size: 1.5em;
  }
}