/* Utility Sidebar Styles */

/* --- Learning Items --- */
.learning-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.learning-item {
    position: relative;
    padding: var(--s-3);
    background: var(--surface);
    border-radius: var(--r-m);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all var(--dur-fast) var(--ease-out);
}

.learning-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-button);
}

/* Item Types */
.learning-item.mistake {
    background: var(--coral-tint);
    border-left: 3px solid var(--coral);
}

.learning-item.explanation {
    background: var(--teal-tint);
    border-left: 3px solid var(--teal);
}

.learning-item.translation {
    background: var(--yellow-tint);
    border-left: 3px solid var(--yellow);
}

.learning-item.exploration {
    background: var(--green-tint);
    border-left: 3px solid var(--green);
}

.item-content {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink);
    margin-bottom: var(--s-2);
    line-height: 1.4;
}

/* Tooltips */
.item-with-tooltip {
    position: relative;
}

.item-with-tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background-color: var(--ink);
    color: var(--bg);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-s);
    font-size: var(--text-xs);
    white-space: pre-wrap;
    max-width: 250px;
    width: max-content;
    z-index: 100;
    box-shadow: var(--shadow-float);
    transition: all var(--dur-fast) var(--ease-out);
    pointer-events: none;
}

.item-with-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--r-pill);
    overflow: hidden;
    margin-top: var(--s-2);
}

.progress-fill {
    height: 100%;
    background: currentColor;
    border-radius: var(--r-pill);
    transition: width var(--dur-med) var(--ease-out);
}

/* Delete Button */
.delete-button {
    position: absolute;
    top: var(--s-2);
    right: var(--s-2);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--ink-soft);
    opacity: 0.5;
    cursor: pointer;
    border-radius: var(--r-s);
    transition: all var(--dur-fast) var(--ease-out);
}

.delete-button:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

/* --- Add Learning Item Form --- */
.add-learning-item-form {
    background: var(--surface-muted);
    border-radius: var(--r-m);
    padding: var(--s-3);
    margin-bottom: var(--s-4);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.add-learning-item-form h4 {
    margin: 0 0 var(--s-3) 0;
    font-size: var(--text-sm);
    color: var(--ink);
}

.learning-item-type-selector,
.mistake-fields input,
.explanation-fields input,
.translation-fields input,
.exploration-fields input,
.mistake-fields select {
    width: 100%;
    padding: var(--s-2);
    margin-bottom: var(--s-2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--r-s);
    background: var(--surface);
    color: var(--ink);
    font-size: var(--text-sm);
}

.form-buttons {
    display: flex;
    gap: var(--s-2);
    justify-content: flex-end;
    margin-top: var(--s-2);
}

.save-learning-item-button {
    background: var(--teal);
    color: white;
    padding: var(--s-1) var(--s-3);
    border-radius: var(--r-s);
    font-weight: 600;
}

.cancel-learning-item-button {
    background: transparent;
    color: var(--ink-soft);
    padding: var(--s-1) var(--s-3);
}

/* --- Settings Panel --- */
.panel-section {
    margin-bottom: var(--s-5);
    padding-bottom: var(--s-4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.panel-section-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: var(--s-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.panel-field {
    margin-bottom: var(--s-3);
}

.panel-field label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: var(--s-1);
}

.panel-field select,
.panel-field input {
    width: 100%;
    padding: var(--s-2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--r-s);
    background: var(--surface-muted);
    color: var(--ink);
    font-size: var(--text-sm);
}

/* --- Branches --- */
.branch-list-container {
    padding: var(--s-3);
    overflow-y: auto;
}

.branch-list {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.branch-item {
    padding: var(--s-3);
    background: var(--surface-muted);
    border-radius: var(--r-m);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--dur-fast) var(--ease-out);
}

.branch-item:hover {
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    border-color: rgba(78, 205, 196, 0.2);
}

.branch-item--active {
    background: var(--surface);
    border-color: var(--teal);
    box-shadow: var(--shadow-soft);
    border-left: 3px solid var(--teal);
}

.branch-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.branch-dialect {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.branch-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-count {
    font-size: var(--text-xs);
    color: var(--ink-soft);
}

.branch-actions {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-left: var(--s-2);
}

.branch-button {
    width: 28px;
    height: 28px;
    border-radius: var(--r-s);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: transparent;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
}

.branch-button:hover {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
}

.branch-button--delete:hover {
    background: var(--coral);
    border-color: var(--coral);
}

.sidebar-section-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    /* Divider line */
    margin: var(--s-4) 0;
}

.empty-state {
    padding: var(--s-6) var(--s-4);
    text-align: center;
    color: var(--ink-soft);
    font-style: italic;
    font-size: var(--text-sm);
}