/* =============================================================================
   CUSTOM MODALS - Custom Modal Dialog System
   ============================================================================= */

/* =============================================================================
   MODAL OVERLAY
   ============================================================================= */

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: color-mix(in srgb, var(--bg-body) 84%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: fadeIn var(--duration-fast) var(--ease-standard);
}

/* =============================================================================
   MODAL ANIMATIONS
   ============================================================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =============================================================================
   MODAL CONTENT CONTAINER
   ============================================================================= */

.custom-modal-content {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 12%, transparent), transparent 42%),
        linear-gradient(135deg, var(--bg-card) 0%, var(--bg-body) 100%);
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-color));
    border-radius: 12px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.62), var(--shadow-glow-soft);
    min-width: min(350px, calc(100vw - 20px));
    max-width: min(500px, calc(100vw - 20px));
    max-height: calc(100vh - 40px);
    width: calc(100vw - 20px);
    animation: arcanePanelIn var(--duration-normal) var(--ease-emphasis);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* =============================================================================
   MODAL HEADER
   ============================================================================= */

.custom-modal-header {
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent),
        linear-gradient(135deg, color-mix(in srgb, var(--bg-card) 92%, white 8%) 0%, var(--bg-card) 100%);
    color: var(--accent);
    padding: 18px 24px;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* =============================================================================
   MODAL BODY
   ============================================================================= */

.custom-modal-body {
    padding: 24px;
    color: #ddd;
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* =============================================================================
   MODAL INPUT FIELDS
   ============================================================================= */

.custom-modal-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    margin-top: 12px;
    transition: var(--transition-interactive);
}

.custom-modal-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent), var(--shadow-glow-soft);
}

/* =============================================================================
   MODAL FOOTER
   ============================================================================= */

.custom-modal-footer {
    padding: 16px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--bg-body);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* =============================================================================
   MODAL BUTTONS
   ============================================================================= */

.custom-modal-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-interactive);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-modal-btn-primary {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    color: #fff;
    box-shadow: var(--shadow-glow-soft);
}

.custom-modal-btn-primary:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-hover) 86%, white), var(--accent));
    box-shadow: var(--shadow-glow-strong);
    transform: translateY(var(--hover-lift-y));
}

.custom-modal-btn-secondary {
    background: var(--border-dark);
    color: #ccc;
    border: 1px solid var(--border-light);
}

.custom-modal-btn-secondary:hover {
    background: var(--bar-bg);
    color: #fff;
    border-color: var(--accent);
    box-shadow: var(--shadow-glow-soft);
    transform: translateY(var(--hover-lift-y));
}

.custom-modal-btn-danger {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

.custom-modal-btn-danger:hover {
    background: linear-gradient(135deg, #ef5350 0%, #d32f2f 100%);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.5);
    transform: translateY(-1px);
}

/* =============================================================================
   ADVENTURE LOG MODAL
   ============================================================================= */

/* Expand button in adventure log panel header */
.expand-log-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: auto;
}
.expand-log-btn:hover {
    color: var(--accent, #ff9800);
    background: rgba(255, 152, 0, 0.1);
}

/* Panel header needs flex to position expand button */
.sidebar-panel > .panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal overlay */
.alog-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

/* Modal container */
.alog-modal-container {
    width: 100%;
    max-width: 700px;
    height: 85vh;
    max-height: 900px;
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    border: 1px solid rgba(255, 152, 0, 0.25);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 152, 0, 0.05);
}

/* Modal header */
.alog-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 152, 0, 0.04);
    flex-shrink: 0;
}

.alog-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent, #ff9800);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alog-modal-title svg {
    color: var(--accent, #ff9800);
    opacity: 0.8;
}

.alog-modal-username {
    color: #fff;
    text-transform: none;
    letter-spacing: 0;
}

.alog-modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alog-modal-count {
    color: #888;
    font-size: 0.8rem;
}

.alog-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.alog-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Modal body — scrollable activity list */
.alog-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 16px;
}

.alog-modal-body::-webkit-scrollbar {
    width: 6px;
}

.alog-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.alog-modal-body::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.alog-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Modal list items — enhanced for larger view */
.alog-modal-list .log-item {
    padding: 12px 8px;
    gap: 14px;
    border-bottom: 1px solid #1a1a1a;
    transition: background 0.15s;
    border-radius: 6px;
}

.alog-modal-list .log-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.alog-modal-list .log-icon {
    width: 44px;
    height: 44px;
}

.alog-modal-list .log-text {
    font-size: 0.95rem;
}

.alog-modal-list .log-date {
    font-size: 0.8rem;
    color: #777;
}

/* Modal footer */
.alog-modal-footer {
    padding: 10px 20px;
    border-top: 1px solid #1a1a1a;
    flex-shrink: 0;
}

.alog-modal-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.alog-modal-footer-text {
    color: #555;
    font-size: 0.78rem;
    font-style: italic;
    flex: 1;
}

/* =============================================================================
   FEEDBACK / CONTACT DEVELOPER MODAL
   ============================================================================= */

.feedback-modal-content {
    max-width: min(480px, calc(100vw - 20px));
}

.feedback-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
}

.feedback-tab {
    background: none;
    border: none;
    color: #888;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.feedback-tab:hover {
    color: #ccc;
}

.feedback-tab.active {
    color: var(--accent, #ff9800);
    border-bottom-color: var(--accent, #ff9800);
}

.inbox-has-reply {
    border-left: 3px solid #4caf50;
}

.feedback-body {
    padding: 16px 20px 20px;
}

.feedback-field {
    margin-bottom: 14px;
    position: relative;
}

.feedback-field label {
    display: block;
    color: #ccc;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feedback-select,
.feedback-input {
    width: 100%;
    background: var(--bg-dropdown);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #e0e0e0;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.feedback-select:focus,
.feedback-input:focus,
.feedback-textarea:focus {
    outline: none;
    border-color: var(--accent, #ff9800);
}

.feedback-textarea {
    width: 100%;
    background: var(--bg-dropdown);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #e0e0e0;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    max-height: 250px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.feedback-counter {
    display: block;
    text-align: right;
    color: #555;
    font-size: 0.75rem;
    margin-top: 3px;
}

.feedback-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.feedback-actions .cancel-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: #aaa;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.feedback-actions .cancel-btn:hover {
    border-color: #666;
    color: #fff;
}

.feedback-actions .submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.feedback-status {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-top: 8px;
}

.feedback-status-error {
    background: rgba(255, 82, 82, 0.15);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.3);
}

.feedback-status-success {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

/* =============================================================================
   FEEDBACK INBOX (Developer)
   ============================================================================= */

.feedback-inbox-content {
    max-width: min(600px, calc(100vw - 20px));
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.inbox-toolbar {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.inbox-filter {
    max-width: 180px;
    font-size: 0.82rem;
    padding: 5px 8px;
}

.inbox-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff5252;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: 8px;
}

.inbox-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    max-height: 60vh;
}

.inbox-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #555;
    gap: 12px;
}

.inbox-loading {
    text-align: center;
    padding: 30px;
    color: #666;
}

.inbox-message {
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.inbox-message.inbox-unread {
    border-left: 3px solid #ff9800;
}

.inbox-message.inbox-resolved {
    opacity: 0.65;
}

.inbox-msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.inbox-category {
    font-size: 1.1rem;
}

.inbox-subject {
    font-weight: 600;
    color: #e0e0e0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inbox-date {
    color: #666;
    font-size: 0.78rem;
    white-space: nowrap;
}

.inbox-msg-from {
    color: #888;
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.inbox-msg-from strong {
    color: #ccc;
}

.inbox-status-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 8px;
}

.inbox-tag-unread {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.inbox-tag-read {
    background: rgba(100, 100, 100, 0.2);
    color: #888;
}

.inbox-tag-resolved {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.inbox-msg-body {
    color: #bbb;
    font-size: 0.88rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 8px 0;
    border-top: 1px solid #1e1e1e;
}

.inbox-reply-display {
    background: #0d1b0d;
    border: 1px solid #1a3a1a;
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 8px;
    font-size: 0.83rem;
    color: #8bc34a;
}

.inbox-msg-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.inbox-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: #aaa;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.inbox-btn:hover {
    border-color: #555;
    color: #fff;
}

.inbox-btn-read:hover { border-color: #ff9800; color: #ff9800; }
.inbox-btn-resolve:hover { border-color: #4caf50; color: #4caf50; }
.inbox-btn-reply:hover { border-color: #2196f3; color: #2196f3; }
.inbox-btn-delete:hover { border-color: #ff5252; color: #ff5252; }

/* Feedback Status Menu */
.feedback-status-menu {
    background: var(--bg-dropdown);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.status-option {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 0.82rem;
    padding: 7px 12px;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    white-space: nowrap;
}

.status-option:hover {
    background: var(--bar-bg);
    color: #fff;
}

/* Feedback Conversation Thread */
.feedback-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

.thread-entry {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.thread-user {
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-left: 3px solid #2196f3;
}

.thread-dev {
    background: #0d1b0d;
    border: 1px solid #1a3a1a;
    border-left: 3px solid #4caf50;
}

.thread-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.thread-author {
    font-weight: 600;
    font-size: 0.78rem;
}

.thread-user .thread-author { color: #64b5f6; }
.thread-dev .thread-author { color: #81c784; }

.thread-date {
    color: #666;
    font-size: 0.72rem;
}

.thread-entry-body {
    color: #ccc;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Inline Reply Box */
.thread-reply-box {
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-body);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
}

.thread-reply-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: #e0e0e0;
    padding: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    min-height: 40px;
    box-sizing: border-box;
}

.thread-reply-input:focus {
    border-color: #555;
    outline: none;
}

.thread-reply-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    justify-content: flex-end;
}

.thread-reply-counter {
    color: #555;
    font-size: 0.72rem;
    margin-right: auto;
}

/* ---- Compact message cards (My Messages + Dev Inbox) ---- */
.inbox-message-card {
    background: #1a1a2e;
    border: 1px solid #2a2a3e;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.inbox-message-card:hover {
    background: #222244;
    border-color: #3a3a5e;
}
.inbox-message-card.inbox-unread {
    border-left: 3px solid #ffc107;
}
.inbox-message-card.inbox-resolved {
    opacity: 0.6;
}
.inbox-card-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.inbox-card-row .inbox-category {
    font-size: 1.1rem;
}
.inbox-card-row .inbox-subject {
    font-weight: 600;
    color: #e0e0e0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.inbox-card-from {
    color: #888;
    font-size: 0.78rem;
    margin-top: 4px;
}
.inbox-card-from strong {
    color: #bbb;
}
.inbox-card-preview {
    color: #999;
    font-size: 0.82rem;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inbox-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    font-size: 0.72rem;
    color: #666;
}
.inbox-thread-count {
    color: #7c4dff;
    font-weight: 600;
}

/* ---- Conversation detail modal — chat layout ---- */
.feedback-chat-modal {
    max-width: 480px;
    width: 95%;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    border-radius: 16px;
    overflow: hidden;
    padding: 0;
}

/* Chat header */
.chat-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #141428;
    border-bottom: 1px solid #2a2a3e;
    min-height: 48px;
}
.chat-back-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}
.chat-back-btn:hover { color: #e0e0e0; background: #ffffff10; }
.chat-header-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.chat-header-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-header-status {
    font-size: 0.72rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-header-actions {
    display: flex;
    gap: 4px;
}
.chat-action-btn {
    background: none;
    border: 1px solid transparent;
    color: #888;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.chat-action-btn:hover { background: #ffffff10; color: #e0e0e0; }
.chat-action-btn.danger:hover { background: #ff6b6b22; color: #ff6b6b; }

/* Messages area */
.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    min-height: 120px;
    max-height: 55vh;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #0d0d1a;
}

/* Day divider */
.chat-day-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}
.chat-day-divider span {
    background: #1a1a2e;
    color: #666;
    font-size: 0.68rem;
    padding: 2px 10px;
    border-radius: 10px;
    letter-spacing: 0.02em;
}

/* Chat bubble rows */
.chat-bubble-row {
    display: flex;
    margin-bottom: 2px;
}
.chat-bubble-me {
    justify-content: flex-end;
}
.chat-bubble-them {
    justify-content: flex-start;
}

/* Bubble */
.chat-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
    position: relative;
}
.chat-bubble-me .chat-bubble {
    background: #1a3a5c;
    color: #d6eaff;
    border-bottom-right-radius: 4px;
}
.chat-bubble-them .chat-bubble {
    background: #1e1e32;
    color: #d0d0d0;
    border-bottom-left-radius: 4px;
}

.chat-bubble-author {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.chat-bubble-me .chat-bubble-author {
    color: #64b5f6;
}
.chat-bubble-them .chat-bubble-author {
    color: #81c784;
}

.chat-bubble-text {
    display: block;
}

.chat-bubble-time {
    display: block;
    font-size: 0.62rem;
    color: #666;
    margin-top: 3px;
    text-align: right;
}
.chat-bubble-them .chat-bubble-time {
    text-align: left;
}

.chat-bubble-pending .chat-bubble {
    opacity: 0.72;
}

.chat-send-btn:disabled,
.chat-send-btn.chat-send-busy {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Empty state */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 12px;
    min-height: 200px;
    color: #555;
    text-align: center;
}
.chat-empty-state p {
    font-size: 0.85rem;
    margin: 0;
}
.chat-empty-state strong {
    color: #aaa;
}

/* Chat input bar */
.chat-input-bar {
    padding: 8px 12px 10px;
    background: #141428;
    border-top: 1px solid #2a2a3e;
}
.chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #1a1a2e;
    border: 1px solid #2a2a3e;
    border-radius: 20px;
    padding: 4px 4px 4px 14px;
    transition: border-color 0.15s;
}
.chat-input-wrap:focus-within {
    border-color: #4a4a6e;
}
.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 0.85rem;
    font-family: inherit;
    padding: 6px 0;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    outline: none;
}
.chat-input::placeholder {
    color: #555;
}
.chat-send-btn {
    background: #3a7bd5;
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}
.chat-send-btn:hover {
    background: #2b6cc4;
    transform: scale(1.05);
}
.chat-send-btn:active {
    transform: scale(0.95);
}
.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
}

/* User unread indicator */
.inbox-message-card.inbox-user-unread {
    border-left: 3px solid #7c4dff;
    background: #1e1e38;
}
.inbox-new-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7c4dff;
    flex-shrink: 0;
    box-shadow: 0 0 6px #7c4dff88;
}
.convo-read-toggle {
    white-space: nowrap;
}

/* Unread badge on "My Messages" tab */
.tab-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #7c4dff;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 4px;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1;
}

/* Unread badge in dropdown "Contact Developer" */
.user-msg-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #7c4dff;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    border-radius: 8px;
    padding: 0 3px;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1;
}

/* Unread badge on footer Contact Developer */
.footer-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #7c4dff;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    border-radius: 8px;
    padding: 0 3px;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1;
}

.alog-modal-clear-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: #888;
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.alog-modal-clear-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

/* =============================================================================
   ADVENTURE LOG MODAL - RESPONSIVE
   ============================================================================= */

@media (max-width: 600px) {
    .alog-modal-overlay {
        padding: 10px;
    }
    .alog-modal-container {
        height: 92vh;
        max-height: none;
        border-radius: 10px;
    }
    .alog-modal-header {
        padding: 12px 14px;
    }
    .alog-modal-title {
        font-size: 0.95rem;
    }
    .alog-modal-body {
        padding: 4px 10px;
    }
    .alog-modal-list .log-icon {
        width: 36px;
        height: 36px;
    }
    .alog-modal-list .log-item {
        padding: 10px 4px;
        gap: 10px;
    }
}

/* =============================================================================
   MANUAL VERIFICATION PROOF + DEVELOPER INBOX
   ============================================================================= */

.verify-proof-code-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 14px 0;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px dashed rgba(255, 215, 0, 0.35);
    background: rgba(255, 215, 0, 0.06);
}

.verify-proof-code-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
}

.verify-proof-code-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--gold, #ffd700);
}

.verify-proof-upload-section {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.verify-proof-file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px dashed var(--border-color, #444);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-sub, #aaa);
    transition: border-color 0.2s, background 0.2s;
}

.verify-proof-file-label:hover {
    border-color: rgba(255, 152, 0, 0.45);
    background: rgba(255, 152, 0, 0.06);
}

.verify-proof-preview-img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #333);
    object-fit: contain;
}

.verify-proof-note {
    width: 100%;
    min-height: 56px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #444);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-main, #fff);
    font-size: 0.82rem;
    resize: vertical;
}

.verify-proof-note-label {
    font-size: 0.75rem;
    color: #888;
}

.verify-adventure-guide-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.verify-adventure-guide-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 96px;
    max-width: 120px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.verify-adventure-guide-icon {
    width: 62px;
    height: 62px;
    object-fit: contain;
    border-radius: 6px;
}

.verify-adventure-guide-label {
    font-size: 0.72rem;
    color: var(--text-sub, #aaa);
    text-align: center;
    line-height: 1.3;
}

.verify-inbox-item {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    background: rgba(255, 255, 255, 0.03);
}

.verify-inbox-item.verify-inbox-highlight {
    border-color: rgba(255, 152, 0, 0.55);
    box-shadow: 0 0 0 1px rgba(255, 152, 0, 0.25);
}

.verify-inbox-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.verify-inbox-rsn {
    font-size: 1rem;
    color: var(--gold, #ffd700);
}

.verify-inbox-meta {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

.verify-inbox-code {
    font-size: 0.78rem;
    color: #aaa;
    white-space: nowrap;
}

.verify-inbox-msg {
    font-size: 0.82rem;
    color: var(--text-sub, #bbb);
    margin: 0 0 10px;
    line-height: 1.45;
}

.verify-inbox-img-link {
    display: block;
    margin-bottom: 10px;
}

.verify-inbox-img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #333);
    object-fit: contain;
}

.verify-inbox-note-input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #444);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main, #fff);
    font-size: 0.82rem;
    margin-bottom: 10px;
}

.verify-inbox-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
