/* profile.css — styles shared between profile.ejs and publicprofile.ejs */

/* Trainer row: single-line flex layout */
.trainer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}

.trainer-row:last-child {
    border-bottom: none;
}

.trainer-name {
    flex: 0 0 170px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.small-input-trainer {
    flex: 0 0 60px;
    text-align: center;
}

.trainer-progress {
    flex: 1 1 0;
    min-width: 0;
}

.trainer-progress .progress {
    height: 22px;
    background-color: #cccccc;
    margin-bottom: 0;
}

[data-bs-theme="dark"] .trainer-progress .progress {
    background-color: #444;
}

.progress-bar {
    max-width: 100%;
}

.progress-bar[aria-valuenow="0"] {
    min-width: 2em;
    background: transparent;
    box-shadow: none;
}

.progress-bar[aria-valuenow="1"],
.progress-bar[aria-valuenow="2"],
.progress-bar[aria-valuenow="3"],
.progress-bar[aria-valuenow="4"],
.progress-bar[aria-valuenow="5"] {
    min-width: 2em;
}

.removetrainer {
    display: none;
    flex: 0 0 auto;
    cursor: pointer;
    color: darkred;
}

.plus {
    flex: 0 0 auto;
    cursor: pointer;
}

h3 {
    padding-bottom: 1em;
}

.input-mode-select {
    flex: 0 0 auto;
    width: auto !important;
    font-size: 11px;
    height: 26px;
    padding: 0 20px 0 4px;
    display: none;
}

#user_trainer_list.show-input-modes .input-mode-select {
    display: block;
}

.rank-input-mode-toggle {
    margin-bottom: 10px;
}

.rank-input-mode-toggle label {
    margin-right: 15px;
    font-weight: normal;
}

.trainer-type-header {
    font-weight: bold;
    font-size: 13px;
    padding: 8px 0 2px 0;
    color: #888;
    border-bottom: 1px solid rgba(128, 128, 128, 0.3);
    margin-top: 4px;
}

textarea {
    resize: none;
}

/* Save indicator */
.save-indicator {
    font-size: 0.8rem;
    margin-bottom: 6px;
    min-height: 1.4em;
}

.save-indicator span { display: none; }

.save-indicator--saving .save-saving { display: inline; color: #adb5bd; }
.save-indicator--saved  .save-saved  { display: inline; color: #4caf7d; }
.save-indicator--error  .save-error  { display: inline; color: #f44336; }

/* Exile summary layout */
.exile-summary {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.exile-picture img {
    width: 150px;
    image-rendering: pixelated;
}

.exile-details {
    flex: 0 0 auto;
}

.exile-notes {
    flex: 1 1 0;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.exile-notes textarea {
    margin-top: 4px;
    flex: 1 1 auto;
    min-height: 80px;
}

/* Exile info table */
.exile-info-table {
    width: auto;
    margin-bottom: 0;
}

.exile-info-table th {
    text-align: right;
    padding: 2px 12px 2px 0;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: top;
}

.exile-info-table td {
    padding: 2px 0;
}

@media (max-width: 768px) {
    .exile-summary {
        flex-wrap: wrap;
    }

    .exile-notes {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .exile-summary {
        flex-direction: column;
        align-items: center;
    }

    .exile-picture {
        text-align: center;
    }

    .exile-details,
    .exile-notes {
        width: 100%;
    }
}

/* Profile picture — clickable indicator */
.picture-clickable {
    cursor: pointer;
    transition: opacity 0.2s;
}

.picture-clickable:hover {
    opacity: 0.8;
}

/* Picture picker modal */
.picture-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.picture-thumb {
    width: 80px;
    height: auto;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    opacity: 0.6;
    transition: opacity 0.2s, border-color 0.2s;
}

.picture-thumb:hover {
    opacity: 1;
    border-color: #6c757d;
}

.picture-thumb.selected {
    opacity: 1;
    border-color: #0d6efd;
    box-shadow: 0 0 6px rgba(13, 110, 253, 0.5);
}

/* Searchable trainer dropdown */
.trainer-search-wrapper {
    position: relative;
}

.trainer-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid rgba(128, 128, 128, 0.3);
    border-top: none;
    border-radius: 0 0 4px 4px;
    background: var(--bs-body-bg, #fff);
}

.trainer-search-dropdown.open {
    display: block;
}

.trainer-search-item {
    padding: 4px 10px;
    cursor: pointer;
    font-size: 13px;
}

.trainer-search-item:hover,
.trainer-search-item.active {
    background: var(--bs-primary, #0d6efd);
    color: #fff;
}

.trainer-search-header {
    padding: 4px 10px;
    font-weight: bold;
    font-size: 12px;
    color: #888;
    cursor: default;
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .trainer-name {
        flex: 0 0 110px;
        font-size: 11px;
    }
    .small-input-trainer {
        flex: 0 0 45px;
        font-size: 12px;
    }
    .input-mode-select {
        font-size: 10px;
        padding: 0 16px 0 2px;
    }
    .trainer-progress .progress {
        height: 18px;
    }
    .progress-bar {
        font-size: 9px;
    }
}
