* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.container {
    display: flex;
    flex: 1;
    padding: 30px 40px;
    gap: 40px;
    height: calc(100vh - 80px);
}

/* Sidebar */
.sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
    height: 100%;
}

.img-card {
    width: 300px;
    max-height: 45%;
    position: relative;
    background: #111;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border: 1px solid #333;
    aspect-ratio: 9 / 16;
    margin: 0 auto;
}

.img-card.needs-photo-correction {
    border: 3px solid #ff9800;
    box-shadow: 0 0 18px rgba(255, 152, 0, 0.28);
}

.img-card .bg-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(8px);
    opacity: 0.5;
    z-index: 0;
}

.img-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: transform 0.2s;
}

.img-card img:hover {
    transform: scale(1.02);
}

.img-card span {
    display: none;
}

.photo-correction-toggle {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(17, 17, 17, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.photo-correction-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.photo-correction-toggle span {
    display: block;
    width: 16px;
    height: 16px;
    border: 2px solid #ff9800;
    border-radius: 4px;
    position: relative;
    background: rgba(255, 152, 0, 0.08);
}

.photo-correction-toggle input:checked + span {
    background: #ff9800;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.65);
}

.photo-correction-toggle input:checked + span::before,
.photo-correction-toggle input:checked + span::after {
    content: "";
    position: absolute;
    top: 6px;
    left: 2px;
    width: 9px;
    height: 2px;
    border-radius: 2px;
    background: #111;
}

.photo-correction-toggle input:checked + span::before {
    transform: rotate(45deg);
}

.photo-correction-toggle input:checked + span::after {
    transform: rotate(-45deg);
}

/* Content Area */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bot-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

#bot-name {
    font-size: 32px;
    font-weight: 500;
}

#bot-age {
    font-size: 22px;
    color: #ccc;
    font-style: italic;
    min-width: 78px;
    display: inline-flex;
    align-items: center;
}

.btn-edit-age {
    width: 17px;
    height: 17px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: opacity 0.15s, transform 0.15s;
}

.btn-edit-age:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.icon-edit {
    width: 17px;
    height: 17px;
    display: block;
}

.age-input {
    width: 52px;
    height: 34px;
    border: 1px solid rgba(255, 77, 166, 0.65);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-size: 22px;
    font-style: italic;
    text-align: center;
    outline: none;
}

.age-input:focus {
    border-color: #ff4da6;
    box-shadow: 0 0 10px rgba(255, 77, 166, 0.22);
}

#bot-matches {
    margin-left: 20px;
    color: #888;
    font-size: 16px;
}

.top-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.btn-original {
    padding: 8px 16px;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-original:hover {
    background: #444;
}

.btn-view-mode {
    margin-left: 0;
}

.hidden {
    display: none !important;
}

/* Textarea Grid */
.textarea-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: 1fr 2fr;
    gap: 20px;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.textarea-grid::-webkit-scrollbar {
    width: 6px;
}

.textarea-grid::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group:nth-child(1),
.input-group:nth-child(2),
.input-group:nth-child(3) {
    grid-column: span 2;
}

.input-group:nth-child(4),
.input-group:nth-child(5) {
    grid-column: span 3;
}

label {
    color: #ff4da6;
    font-size: 15px;
    font-weight: 500;
}

.field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.char-counter {
    color: #bdbdbd;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    transition: color 0.15s;
}

.char-counter.over-limit {
    color: #ff3b3b;
}

.textarea-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    background: #d9d9d9;
    border-radius: 12px;
    padding: 15px;
    padding-bottom: 40px;
}

textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    resize: none;
    color: #111;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
}

textarea::-webkit-scrollbar {
    width: 4px;
}

textarea::-webkit-scrollbar-thumb {
    background: #999;
    border-radius: 4px;
}

.btn-ai {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-ai img {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 2px #ff1493);
}

.btn-ai:hover {
    transform: scale(1.1);
}

.btn-ai.loading img {
    animation: spin 1s linear infinite;
}

.block-widget {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px;
    background: rgba(217, 217, 217, 0.78);
    border: 1px solid rgba(17, 17, 17, 0.12);
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.block-tool-btn {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #ff1493;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
}

.block-tool-btn:hover {
    background: rgba(255, 20, 147, 0.14);
    transform: translateY(-1px);
}

.block-tool-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.review-check {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.review-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.review-check span {
    width: 17px;
    height: 17px;
    border: 2px solid #ff1493;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.35);
    position: relative;
    transition: background 0.15s, box-shadow 0.15s;
}

.review-check input:checked + span {
    background: #ff1493;
    box-shadow: 0 0 0 3px rgba(255, 20, 147, 0.18);
}

.review-check input:checked + span::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.block-widget.copied,
.block-widget.pasted {
    box-shadow: 0 0 0 3px rgba(0, 255, 204, 0.22);
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Footer Toolbar */
.toolbar {
    height: 80px;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    gap: 24px;
}

.flags {
    display: flex;
    gap: 15px;
}

.flag {
    width: 36px;
    height: 26px;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.2s;
    border-radius: 4px;
}

.flag:hover {
    opacity: 0.8;
}

.flag.active {
    opacity: 1;
    box-shadow: 0 0 0 3px #00ffcc;
}

.controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.translation-status {
    min-width: 320px;
    max-width: 460px;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 8px;
    border: 1px solid rgba(255, 77, 166, 0.45);
    background: rgba(255, 77, 166, 0.08);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.translation-status[hidden] {
    display: none;
}

.translation-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: #ff4da6;
    box-shadow: 0 0 10px rgba(255, 77, 166, 0.85);
    animation: pulseStatus 1s ease-in-out infinite;
}

.translation-status-timer {
    margin-left: auto;
    color: #00ffcc;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.translation-status.is-success {
    border-color: rgba(0, 255, 204, 0.4);
    background: rgba(0, 255, 204, 0.08);
}

.translation-status.is-success .translation-status-dot {
    background: #00ffcc;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.75);
    animation: none;
}

.translation-status.is-error {
    border-color: rgba(255, 152, 0, 0.55);
    background: rgba(255, 152, 0, 0.1);
}

.translation-status.is-error .translation-status-dot {
    background: #ff9800;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.75);
    animation: none;
}

@keyframes pulseStatus {
    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.85);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

.pagination {
    color: #ccc;
    font-size: 16px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 15px;
}

.page-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    width: 45px;
    text-align: center;
    border-radius: 6px;
    outline: none;
    padding: 4px 0;
    transition: all 0.2s;
}

.page-input:focus {
    border-color: #ff4da6;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 77, 166, 0.2);
}

.revision-status {
    font-size: 14px;
    font-weight: 600;
    margin-right: 20px;
    color: #888;
}

.nav-btn {
    background: transparent;
    border: 1px solid #555;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: #333;
}

.btn-icon {
    background: transparent;
    border: 1px solid #ff4da6;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon img {
    width: 24px;
    height: 24px;
    filter: invert(0.5) sepia(1) saturate(5) hue-rotate(300deg);
}

.btn-icon:hover {
    background: rgba(255, 77, 166, 0.1);
}

.btn-icon.loading img {
    animation: spin 1s linear infinite;
}

.btn-save {
    background: linear-gradient(90deg, #ff007f, #9900ff);
    color: #fff;
    border: none;
    padding: 0 50px;
    height: 44px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 16px;
}

.btn-save:hover {
    opacity: 0.9;
}

.snackbar {
    position: fixed;
    left: 50%;
    bottom: 96px;
    transform: translate(-50%, 12px);
    min-width: 190px;
    padding: 12px 18px;
    border-radius: 8px;
    background: #262626;
    border: 1px solid #444;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    transition: opacity 0.18s, transform 0.18s;
}

.snackbar.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* --- Original View Styles --- */
.btn-original.active-original {
    background: #ff4da6;
    border-color: #ff4da6;
    color: #fff;
}

.btn-original.active-original:hover {
    background: #e63995;
}

.btn-top-icon,
.btn-view-list-icon {
    width: 42px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-top-icon svg,
.btn-view-list-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

textarea.viewing-original {
    color: #014976;
}

/* --- List View --- */
.list-view {
    flex: 1;
    height: 100vh;
    padding: 28px 40px 36px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
}

.list-header {
    width: min(1220px, 100%);
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.list-header h1 {
    font-size: 28px;
    font-weight: 600;
}

.list-header p {
    color: #888;
    font-size: 14px;
    margin-top: 6px;
}

.list-panel {
    width: min(1220px, 100%);
    margin: 0 auto;
    flex: 1;
    overflow: auto;
    border: 1px solid #333;
    border-radius: 8px;
    background: #111;
}

.bots-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.bots-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0f596d;
}

.bots-table th,
.bots-table td {
    padding: 12px 12px;
    text-align: left;
    border-bottom: 1px solid #2a2a2a;
    color: #f5f5f5;
    font-size: 15px;
    vertical-align: middle;
    white-space: nowrap;
}

.bots-table th {
    height: 52px;
    font-weight: 600;
}

.bots-table tbody tr {
    background: #181818;
    transition: background 0.15s;
}

.bots-table tbody tr:hover {
    background: #222;
}

.bots-table th:nth-child(1),
.bots-table td:nth-child(1) {
    width: 56px;
    padding-right: 6px;
}

.bots-table th:nth-child(2),
.bots-table td:nth-child(2) {
    width: 56px;
    padding-left: 4px;
    padding-right: 6px;
}

.bots-table th:nth-child(4),
.bots-table td:nth-child(4),
.bots-table th:nth-child(5),
.bots-table td:nth-child(5) {
    width: 82px;
    text-align: center;
}

.bots-table th:nth-child(6),
.bots-table td:nth-child(6),
.bots-table th:nth-child(7),
.bots-table td:nth-child(7),
.bots-table th:nth-child(9),
.bots-table td:nth-child(9),
.bots-table th:nth-child(10),
.bots-table td:nth-child(10) {
    width: 96px;
}

.bots-table th:nth-child(8),
.bots-table td:nth-child(8) {
    width: 118px;
}

.sort-header {
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: #fff;
    text-align: left;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.sort-header:hover {
    color: #00ffcc;
}

.sort-indicator {
    display: inline-block;
    width: 14px;
    color: #00ffcc;
}

.bot-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #333;
    border: 1px solid #444;
}

.bot-name-cell {
    overflow: hidden;
    text-overflow: ellipsis;
}

.asset-status-cell {
    text-align: center !important;
}

.photo-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.photo-status-dot.has-photo {
    background: #00ff38;
    box-shadow: 0 0 8px rgba(0, 255, 56, 0.55);
}

.photo-status-dot.missing-photo {
    background: #ff1f3d;
    box-shadow: 0 0 8px rgba(255, 31, 61, 0.45);
}

.photo-status-dot.correction-photo {
    background: #ff9800;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.7);
}

.review-yes {
    color: #00ffcc !important;
    font-weight: 600;
}

.review-no {
    color: #ff4da6 !important;
    font-weight: 600;
}

.view-row-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #555;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.view-row-btn:hover {
    background: rgba(255, 77, 166, 0.12);
    border-color: #ff4da6;
}

.eye-icon {
    width: 20px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.eye-icon::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.empty-list {
    height: 140px;
    color: #888 !important;
    text-align: center !important;
}
