/* ===== RESET E BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.4;
}

/* ===== CONTAINER PRINCIPAL ===== */
#container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  margin: 10px auto;
  max-width: 1400px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* ===== HEADER ===== */
header {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.4rem;
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.navbar-light .navbar-brand:hover {
  color: #f8f9fa !important;
  transform: scale(1.05);
  transition: all 0.3s ease;
}

/* ===== SEPARADORES ===== */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #4facfe, transparent);
  margin: 10px 0;
}

/* ===== TÍTULOS ===== */
h1 {
  color: #2c3e50;
  font-weight: 700;
  margin-bottom: 15px;
  text-align: center;
  font-size: 2.2rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2, h3, h4 {
  color: #34495e;
  margin-bottom: 10px;
  font-weight: 600;
}

h2 {
  font-size: 1.6rem;
  border-bottom: 2px solid #4facfe;
  padding-bottom: 8px;
}

h3 {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

h4 {
  font-size: 1.1rem;
  color: #5a6c7d;
}

/* ===== SEÇÕES ===== */
section {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.anuncio-topo, .anuncio-lateral {
  background: linear-gradient(135deg, #ffeaa7, #fab1a0);
  border: 2px dashed #e17055;
  text-align: center;
  padding: 20px;
  border-radius: 12px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #2d3436;
}

.anuncio-topo::before, .anuncio-lateral::before {
  content: "📢 Espaço para Anúncio";
  font-size: 1rem;
}

/* ===== CONTAINER DA GRADE ===== */
.grid-container {
  display: grid;
  grid-template-columns: 30px repeat(16, 24px);
  grid-template-rows: 24px repeat(16, 24px);
  gap: 2px;
  margin: 20px auto;
  padding: 15px;
  background: linear-gradient(145deg, #f8f9fa, #e9ecef);
  border-radius: 12px;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.1);
  justify-content: center;
  overflow-x: auto;
}

/* ===== CÉLULAS DA GRADE ===== */
.empty-cell {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  width: 30px;
  height: 24px;
}

.top-number, .side-number {
  background: linear-gradient(145deg, #667eea, #764ba2);
  color: white;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 6px;
  font-size: 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.grid-cell {
  background: linear-gradient(145deg, #ffffff, #f1f3f4);
  border-radius: 6px;
  box-shadow: 
    0 3px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid transparent;
  width: 24px;
  height: 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.grid-cell::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transition: left 0.5s;
}

.grid-cell:hover::before {
  left: 100%;
}

.grid-cell:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  border-color: #4facfe;
}

/* ===== ESTADOS DAS CÉLULAS ===== */
.selected-cell {
  background: linear-gradient(145deg, #4facfe, #00f2fe) !important;
  border-color: #0984e3 !important;
  box-shadow: 
    0 0 15px rgba(79, 172, 254, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.15) !important;
  animation: pulse 2s infinite;
}

.grid-cell.active {
  background: linear-gradient(145deg, #00b894, #00a085) !important;
  border-color: #00a085 !important;
  box-shadow: 
    0 0 15px rgba(0, 184, 148, 0.5),
    0 3px 6px rgba(0, 0, 0, 0.15) !important;
  animation: activeGlow 1.5s infinite alternate;
}

.extra-selected {
  background: linear-gradient(145deg, #ff6b6b, #ee5a52) !important;
  border-color: #d63031 !important;
  box-shadow: 
    0 0 15px rgba(255, 107, 107, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.15) !important;
}

.extra-col-selected {
  background: linear-gradient(145deg, #fdcb6e, #f39c12) !important;
  border-color: #e17055 !important;
  box-shadow: 
    0 0 20px rgba(253, 203, 110, 0.6),
    0 3px 6px rgba(0, 0, 0, 0.15) !important;
  animation: extraGlow 2s infinite;
}

/* ===== ANIMAÇÕES ===== */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes activeGlow {
  0% { box-shadow: 0 0 15px rgba(0, 184, 148, 0.5), 0 3px 6px rgba(0, 0, 0, 0.15); }
  100% { box-shadow: 0 0 25px rgba(0, 184, 148, 0.8), 0 4px 8px rgba(0, 0, 0, 0.2); }
}

@keyframes extraGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(253, 203, 110, 0.6), 0 3px 6px rgba(0, 0, 0, 0.15); }
  50% { box-shadow: 0 0 30px rgba(253, 203, 110, 0.9), 0 4px 8px rgba(0, 0, 0, 0.2); }
}

/* ===== GRUPOS DE BOTÕES ===== */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  justify-content: center;
}

.button-group button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: linear-gradient(145deg, #ffffff, #f1f3f4);
  cursor: pointer;
  font-weight: 700;
  color: #555;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  font-size: 0.85rem;
}

.button-group button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.button-group button:hover::before {
  width: 80px;
  height: 80px;
}

.button-group button:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  background: linear-gradient(145deg, #4facfe, #00f2fe);
  color: white;
  border-color: #0984e3;
  box-shadow: 0 6px 12px rgba(79, 172, 254, 0.25);
}

.button-group button.selected {
  background: linear-gradient(145deg, #667eea, #764ba2);
  color: white;
  border-color: #5a67d8;
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
  transform: scale(1.08);
}

.button-group button:disabled {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: #adb5bd;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ===== BOTÕES DE COLUNAS EXTRAS ===== */
#extra-buttons + div {
  margin-top: 8px;
  display: none;
  background: rgba(255, 107, 107, 0.05);
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: 10px;
  padding: 12px;
}

#extra-buttons + div.show {
  display: block;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#extra-buttons + div button {
  width: 28px;
  height: 28px;
  margin: 2px;
  border-radius: 6px;
  border: 1px solid #ffcdd2;
  background: linear-gradient(145deg, #fff5f5, #ffebee);
  cursor: pointer;
  font-weight: 700;
  color: #d32f2f;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(255, 107, 107, 0.1);
  position: relative;
  overflow: hidden;
  font-size: 0.8rem;
}

#extra-buttons + div button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 107, 107, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

#extra-buttons + div button:hover::before {
  width: 60px;
  height: 60px;
}

#extra-buttons + div button:hover {
  transform: translateY(-2px) scale(1.1);
  background: linear-gradient(145deg, #ffcdd2, #ef9a9a);
  color: #b71c1c;
  border-color: #f44336;
  box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

#extra-buttons + div button.selected {
  background: linear-gradient(145deg, #ff5722, #d84315);
  color: white;
  border-color: #bf360c;
  box-shadow: 0 4px 12px rgba(255, 87, 34, 0.4);
  transform: scale(1.15);
  animation: selectedPulse 2s infinite;
}

@keyframes selectedPulse {
  0%, 100% { 
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.4);
  }
  50% { 
    box-shadow: 0 6px 16px rgba(255, 87, 34, 0.6);
  }
}

#extra-buttons + div button:active {
  transform: scale(0.95);
}

/* Título para seção de colunas extras */
#extra-buttons + div::before {
  content: "🎯 Selecionar Colunas da Linha Extra";
  display: block;
  font-weight: 700;
  color: #d32f2f;
  margin-bottom: 8px;
  font-size: 0.9rem;
  text-align: center;
}

/* ===== CONTROLES DE FORMULÁRIO ===== */
.form-control {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
}

.form-control:focus {
  border-color: #4facfe;
  box-shadow: 0 0 0 0.15rem rgba(79, 172, 254, 0.2);
  background: white;
}

.form-range {
  height: 6px;
  background: linear-gradient(90deg, #4facfe, #00f2fe);
  border-radius: 8px;
  outline: none;
}

.form-range::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(145deg, #667eea, #764ba2);
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* ===== BOTÕES PRINCIPAIS ===== */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  position: relative;
  overflow: hidden;
  margin: 3px;
  font-size: 0.9rem;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-success {
  background: linear-gradient(145deg, #00b894, #00a085);
  box-shadow: 0 3px 10px rgba(0, 184, 148, 0.25);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 184, 148, 0.35);
}

.btn-warning {
  background: linear-gradient(145deg, #fdcb6e, #f39c12);
  box-shadow: 0 3px 10px rgba(253, 203, 110, 0.25);
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(253, 203, 110, 0.35);
}

.btn-danger {
  background: linear-gradient(145deg, #ff6b6b, #ee5a52);
  box-shadow: 0 3px 10px rgba(255, 107, 107, 0.25);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 107, 107, 0.35);
}

/* ===== SEÇÃO DE OUTPUT ===== */
.output-section {
  background: linear-gradient(145deg, #2d3436, #636e72);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.output-label {
  color: #74b9ff;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.output-label::before {
  content: '🔐';
  font-size: 1.1rem;
}

.output-box {
  width: 100%;
  min-height: 60px;
  background: #1e272e;
  border: 1px solid #40407a;
  border-radius: 8px;
  padding: 12px;
  color: #00d2d3;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  resize: vertical;
  margin-bottom: 15px;
  transition: border-color 0.3s ease;
}

.output-box:focus {
  outline: none;
  border-color: #74b9ff;
  box-shadow: 0 0 8px rgba(116, 185, 255, 0.25);
}

/* ===== RADIO BUTTONS ===== */
input[type="radio"] {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  accent-color: #4facfe;
}

label {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.3s ease;
}

label:hover {
  color: #4facfe;
}

/* ===== ASIDE (COLUNA LATERAL) ===== */
aside section {
  background: linear-gradient(145deg, rgba(116, 185, 255, 0.08), rgba(79, 172, 254, 0.08));
  border-left: 3px solid #4facfe;
}

aside h2 {
  color: #2d3436;
  border-bottom-color: #74b9ff;
}

/* ===== FOOTER ===== */
footer {
  background: linear-gradient(135deg, #2d3436, #636e72);
  color: white;
  padding: 20px;
  border-radius: 12px 12px 0 0;
  margin-top: 30px;
}

footer a {
  color: #74b9ff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #0984e3;
  text-decoration: underline;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  #container {
    margin: 5px;
    border-radius: 12px;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .grid-container {
    grid-template-columns: 22px repeat(16, 18px);
    grid-template-rows: 18px repeat(16, 18px);
    gap: 1px;
    padding: 10px;
  }
  
  .grid-cell {
    width: 18px;
    height: 18px;
  }
  
  .top-number, .side-number {
    font-size: 8px;
  }
  
  .button-group button {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
  
  #extra-buttons + div button {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }
  
  section {
    padding: 12px;
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  .grid-container {
    grid-template-columns: 18px repeat(16, 16px);
    grid-template-rows: 16px repeat(16, 16px);
    gap: 1px;
  }
  
  .grid-cell {
    width: 16px;
    height: 16px;
  }
  
  .button-group button {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
  }
  
  #extra-buttons + div button {
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
  }
}

/* ===== SCROLLBAR PERSONALIZADA ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(145deg, #4facfe, #00f2fe);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(145deg, #667eea, #764ba2);
} 
.output-label i {
  font-size: 1.2rem;
}
