

.sidebar {
  width: 100%;
  height: 45%;
  background-color: var(--sidebar-bg);
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 20;
  order: 2;
  box-shadow: -5px 0 15px rgba(0,0,0,0.3);
}

@media (min-width: 768px) {
  .sidebar {
    width: 350px;
    height: 100%;
    border-top: none;
    border-left: 1px solid var(--sidebar-border);
    order: 2;
  }
}

@media (min-width: 1024px) {
  .sidebar {
    width: 400px;
  }
}

/* Tab Header */
.sidebar-tabs {
  display: flex;
  align-items: stretch;
  height: 60px;
  background-color: #111827;
  border-bottom: 1px solid var(--sidebar-border);
}

.tab-main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  cursor: pointer;
  transition: background 0.2s;
  border-right: 1px solid var(--sidebar-border);
}

.tab-main:hover {
  background-color: #1f2937;
}

.tab-main.active {
  background-color: #1f2937;
  border-bottom: 2px solid var(--primary);
}

.status-text-tab {
  font-size: 1.25rem;
  font-weight: bold;
  margin: 0;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-actions {
    display: flex;
}

.tab-icon-btn {
  background: none;
  border: none;
  border-left: 1px solid var(--sidebar-border);
  color: var(--text-muted);
  width: 60px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.tab-icon-btn:hover {
  background-color: #374151;
  color: white;
}

.tab-icon-btn.active {
  background-color: #1f2937;
  color: var(--primary);
  box-shadow: inset 0 -2px 0 0 var(--primary);
}

/* Tab Content Area */
.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

/* TAB 1: GAME CONTROLS */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto; /* Push to bottom of space if extra room */
}

.action-buttons-row {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.action-buttons-row > button {
  flex: 1;
}

.raise-container {
  padding-top: 0.5rem;
}

.range-slider {
  width: 100%;
  height: 8px;
  background: #374151;
  border-radius: 4px;
  appearance: none;
  outline: none;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--success);
  border-radius: 50%;
  cursor: pointer;
}

.range-slider:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
  color: white;
  text-transform: uppercase;
}

.btn:active { transform: scale(0.98); }
.btn:hover { opacity: 0.9; }

.btn:disabled, .btn.disabled-look { 
    opacity: 1 !important; 
    cursor: not-allowed; 
    pointer-events: none; 
    background-color: #4b5563 !important;
    color: #d1d5db !important;
    border: 1px solid #374151;
}

.btn-primary { background-color: var(--primary); }
.btn-success { background-color: var(--success); }
.btn-danger { background-color: var(--danger); }
.btn-fold { background-color: #ef4444; }
.btn-check { background-color: #22c55e; }
.btn-call { background-color: #eab308; color: black; }
.btn-raise { background-color: #f97316; }
.btn-reset { background-color: #ef4444; }

.big-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding: 1rem;
}

.single-line-action {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    width: 100%;
    font-size: 1.125rem;
    white-space: nowrap;
}

/* Game Over In-Tab */
.game-over-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes message up, buttons down */
    text-align: left;
    gap: 1.5rem;
    animation: fadeIn 0.3s ease;
    height: 100%; 
}

.win-message-container { 
    width: 100%; 
    text-align: left;
}

.win-title-sidebar {
    font-size: 1rem;
    font-weight: bold;
    color: #ffffff;
    margin: 0;
    line-height: 1.6;
    white-space: pre-wrap;
    text-align: left;
}

/* TAB 2: LOG */
.log-list {
  display: flex;
  flex-direction: column;
  font-family: monospace;
  font-size: 0.85rem;
  color: #d1d5db;
  gap: 0.5rem;
}

.log-entry {
    padding: 4px 8px;
    border-left: 2px solid #4b5563;
    background: rgba(255,255,255,0.03);
}

/* TAB 3: SETTINGS */
.settings-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.5rem; /* row-gap column-gap */
  align-items: center;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}

.checkbox-group label {
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text-main);
    order: -1;
    margin-right: 0.5rem;
}

.checkbox-group input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.form-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.input-field {
  width: 100px;
  background-color: var(--bg-input);
  color: white;
  border: 1px solid #4b5563;
  border-radius: 4px;
  padding: 0.5rem;
  font-size: 0.9rem;
}

.settings-actions {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  flex-direction: row; 
  gap: 1rem;
  grid-column: 1 / -1; /* Span both columns */
}
.settings-actions .btn {
    flex: 1;
}

/* Info Cluster */
.info-cluster {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.info-spent {
  text-align: center;
  color: white;
  font-size: 0.9rem;
  margin-bottom: 0.1rem;
  font-weight: 500;
}

.info-row {
  display: flex;
  justify-content: space-between; /* Spread out for tab view */
  align-items: center;
  padding: 4px 0;
  font-size: 0.8rem;
}

.info-label {
  color: var(--text-muted); 
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.info-value {
  color: white;
  font-family: monospace;
  font-weight: bold;
  font-size: 0.8rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}