/* --- Panel Lateral (Sidebar) --- */
.sidebar {
  background-color: var(--white);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  border-radius: 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px;
  transition: width 0.3s ease, padding 0.3s ease;
}

.sidebar.collapsed {
    width: 100px;
    padding: 20px 10px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.sidebar-header h4 {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease, width 0.3s ease;
    opacity: 1;
}

.sidebar.collapsed .sidebar-header h4 {
    opacity: 0;
    width: 0;
}

.toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    padding: 5px 10px;
    transition: background-color 0.2s;
    font-size: 0.9em;
}

.toggle-btn:hover {
    background-color: var(--light-gray);
}

.sidebar.collapsed .radio-label,
.sidebar.collapsed .story-box,
.sidebar.collapsed .about-button .about-text {
    display: none;
}

.sidebar.collapsed .radio-span {
    justify-content: center;
    padding: 8px 0;
}

.sidebar.collapsed .radio-icon {
    margin-right: 0;
}

.sidebar.collapsed .about-button {
    justify-content: center;
}

.sidebar.collapsed .about-button i {
    margin-right: 0;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scrollbar */
}

.sidebar h4 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 15px;
}

/* --- Selector de Dimensiones (Estilo Shiny) --- */
.control-group {
    margin-bottom: 1.5rem;
}

.radio {
    display: flex;
    align-items: center;
}

.radio label {
    display: flex;
    margin-bottom: 3px; /* Reducido de 5px */
    font-size: 0.85em; /* Reducido de 0.9em */
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    flex-grow: 1; /* Make label take up available space */
}

.dimension-info-btn {
    color: #6c757d;
    margin-left: 8px;
    padding: 5px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.dimension-info-btn:hover {
    color: #333;
}

.radio label > input[type='radio'] {
    display: none;
}

.radio .radio-span {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 6px 10px; /* Reducido de 8px 12px */
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    background-color: #fff;
    transition: padding 0.3s ease;
}

.radio-icon {
    width: 25px;
    display: inline-block;
    text-align: center;
    flex-shrink: 0;
    margin-right: 10px;
    transition: margin 0.3s ease;
}

.radio-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease, width 0.3s ease;
    opacity: 1;
}

.sidebar.collapsed .radio-label {
    opacity: 0;
    width: 0;
}

.radio label:hover > .radio-span {
    background-color: #f0f5fa;
    border-color: #007bff;
}

.radio label > input[type='radio']:checked + .radio-span {
    background-color: #e9f5ff;
    border-left: 4px solid var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 700;
    color: #004085;
}

.radio label i {
    color: inherit;
    transition: color 0.2s ease;
}

/* --- Controles de comparación en el sidebar --- */
.compare-controls {
    margin-bottom: 1rem;
}

.compare-controls label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.compare-controls select {
    width: 100%;
    padding: 0.5rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}