/* assets/custom.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* GitHub Primer Dark Mode Palette */
    --bs-body-bg: #0d1117;
    --bs-body-color: #c9d1d9;
    --bs-card-bg: #161b22;
    --bs-primary: #58a6ff;
    --bs-secondary: #8b949e;
    --bs-success: #238636;
    --bs-success-text: #3fb950;
    --bs-info: #58a6ff;
    --bs-warning: #d29922;
    --bs-danger: #f85149;

    --card-radius: 6px;
    --card-border-color: #30363d;
    --card-border: 1px solid var(--card-border-color);
    --card-shadow: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji" !important;
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

/* ---------------- Card Styling ---------------- */
.card {
    --bs-card-bg: #161b22;
    background-color: var(--bs-card-bg) !important;
    border: var(--card-border) !important;
    border-radius: var(--card-radius) !important;
    box-shadow: none !important;
}

.card:hover {
    border-color: #8b949e !important;
}

.card-header {
    background-color: #161b22 !important;
    border-bottom: 1px solid #30363d !important;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 1rem !important;
    color: var(--bs-body-color) !important;
    display: flex;
    align-items: center;
}

.card-body {
    padding: 1rem !important;
}

/* ---------------- Navigation ---------------- */
.navbar {
    background-color: #161b22 !important;
    border-bottom: 1px solid #30363d;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--bs-body-color) !important;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bs-body-color) !important;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--bs-body-color) !important;
    opacity: 1;
}

/* ---------------- Global Layout Utilities ---------------- */
.container-fluid {
    padding: 0 2rem !important;
    max-width: 1920px;
    margin: 0 auto;
}

/* Action Bar */
.action-bar {
    background-color: #0d1117;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #30363d;
}

.action-bar h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--bs-body-color);
}

.text-primary {
    color: var(--bs-primary) !important;
}

.text-success {
    color: var(--bs-success-text) !important;
}

.text-warning {
    color: var(--bs-warning) !important;
}

.text-danger {
    color: var(--bs-danger) !important;
}

.text-info {
    color: var(--bs-info) !important;
}

.text-muted,
.text-secondary {
    color: var(--bs-secondary) !important;
}

.action-bar .stats-row {
    display: flex;
    gap: 1rem;
    /* More compact for boxes */
    align-items: center;
}

/* ---------------- KPI Box Styling ---------------- */
.kpi-box {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    min-width: 140px;
    justify-content: center;
}

.kpi-label {
    font-size: 0.75rem;
    color: #8b949e;
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-number {
    font-size: 1.25rem;
    font-weight: 600;
    color: #c9d1d9;
    line-height: 1.2;
}

.kpi-icon {
    font-size: 1rem;
    color: #8b949e;
    opacity: 0.5;
}

/* ---------------- Typography ---------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--bs-body-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* ---------------- AG Grid Overrides ---------------- */
.ag-theme-alpine-dark {
    --ag-background-color: #0d1117 !important;
    --ag-header-background-color: #161b22 !important;
    --ag-foreground-color: #c9d1d9 !important;
    --ag-row-hover-color: #21262d !important;
    --ag-odd-row-background-color: #0d1117 !important;
    --ag-border-color: #30363d !important;
    --ag-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    --ag-font-size: 13px !important;
    --ag-header-height: 48px !important;
    --ag-info-notice-background-color: #161b22 !important;
    border: 1px solid #30363d !important;
    border-radius: 6px;
}

.cursor-pointer,
.cursor-pointer .ag-row {
    cursor: pointer !important;
}

.ag-theme-alpine-dark .ag-root-wrapper {
    background-color: #0d1117 !important;
    border: none !important;
}

.ag-header-cell-label {
    font-weight: 600 !important;
    color: #8b949e !important;
    font-size: 0.75rem;
}

.row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.col,
[class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.mb-5 {
    margin-bottom: 2rem !important;
}

.dash-ag-grid {
    width: 100%;
    height: 100%;
}

.btn-primary {
    background-color: #1f6feb !important;
    border-color: rgba(240, 246, 252, 0.1) !important;
    color: #f0f6fc !important;
}

.btn-primary:hover {
    background-color: #388bfd !important;
}

.btn-success {
    background-color: var(--bs-success) !important;
    border-color: rgba(240, 246, 252, 0.1) !important;
    color: #f0f6fc !important;
}

.btn-success:hover {
    background-color: #2ea043 !important;
}

.btn-secondary {
    background-color: #21262d !important;
    border-color: rgba(240, 246, 252, 0.1) !important;
    color: #c9d1d9 !important;
}

.btn-secondary:hover {
    background-color: #30363d !important;
}

.form-control,
.form-select {
    background-color: #0d1117 !important;
    border: 1px solid #30363d !important;
    color: #c9d1d9 !important;
}

.form-control:focus,
.form-select:focus {
    background-color: #0d1117 !important;
    border-color: #58a6ff !important;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3) !important;
}

.modal-content {
    background-color: #161b22 !important;
    border: 1px solid #30363d !important;
    color: #c9d1d9 !important;
}

.modal-header,
.modal-footer {
    border-color: #30363d !important;
}

.close {
    color: #c9d1d9 !important;
}

/* ---------------- Status Pill Styling ---------------- */

/* We will apply these classes to the AG Grid Cell */
.status-cell {
    display: flex !important;
    align-items: center;
    /* justify-content: center; */
    height: 100%;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 2rem;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.status-online {
    color: #3fb950;
    /* GitHub Green Text */
    border-color: rgba(56, 139, 253, 0.0);
    /* Transparent border or subtle */
    background-color: rgba(46, 160, 67, 0.15);
}

.status-offline {
    color: #8b949e;
    /* GitHub Muted */
    border-color: rgba(110, 118, 129, 0.0);
    background-color: rgba(110, 118, 129, 0.15);
}

/* The Dot */
.status-pill::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-online::before {
    background-color: #3fb950;
    box-shadow: 0 0 4px rgba(63, 185, 80, 0.4);
}

.status-offline::before {
    background-color: #8b949e;
}

/* ---------------- Dash Dropdown Dark Theme ---------------- */
.dash-dropdown-dark .Select-control,
.Select-control {
    background-color: #0d1117 !important;
    border: 1px solid #30363d !important;
    color: #c9d1d9 !important;
    min-height: 32px;
}

.dash-dropdown-dark .Select-control:hover,
.Select-control:hover {
    border-color: #58a6ff !important;
}

.dash-dropdown-dark .Select-menu-outer,
.Select-menu-outer {
    background-color: #161b22 !important;
    border: 1px solid #30363d !important;
    margin-top: 2px;
}

.dash-dropdown-dark .Select-menu,
.Select-menu {
    background-color: #161b22 !important;
}

.dash-dropdown-dark .Select-option,
.Select-option {
    background-color: #161b22 !important;
    color: #c9d1d9 !important;
    padding: 8px 12px;
}

.dash-dropdown-dark .Select-option:hover,
.dash-dropdown-dark .Select-option.is-focused,
.Select-option:hover,
.Select-option.is-focused {
    background-color: #21262d !important;
}

.dash-dropdown-dark .Select-option.is-selected,
.Select-option.is-selected {
    background-color: #1f6feb !important;
    color: #f0f6fc !important;
}

.dash-dropdown-dark .Select-value-label,
.dash-dropdown-dark .Select-placeholder,
.Select-value-label,
.Select-placeholder {
    color: #8b949e !important;
}

.dash-dropdown-dark .Select-input input,
.Select-input input {
    color: #c9d1d9 !important;
}

.dash-dropdown-dark .Select-clear-zone,
.dash-dropdown-dark .Select-arrow-zone,
.Select-clear-zone,
.Select-arrow-zone {
    color: #8b949e !important;
}

.dash-dropdown-dark .Select.is-focused .Select-control,
.Select.is-focused .Select-control {
    border-color: #58a6ff !important;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3) !important;
}

/* Selected value display */
.dash-dropdown-dark .Select-value,
.Select-value {
    color: #c9d1d9 !important;
}

.dash-dropdown-dark .Select--single>.Select-control .Select-value,
.Select--single>.Select-control .Select-value {
    color: #c9d1d9 !important;
    line-height: 30px;
}

/* No results message */
.Select-noresults {
    background-color: #161b22 !important;
    color: #8b949e !important;
    padding: 8px 12px;
}

/* ---------------- Action Column Styling ---------------- */
.action-cell {
    transition: background-color 0.2s;
}

.action-cell:hover {
    background-color: rgba(88, 166, 255, 0.1) !important;
}

.hover-highlight:hover {
    background-color: rgba(88, 166, 255, 0.1) !important;
}

/* ---------------- Table Breadcrumb Bar ---------------- */
.table-breadcrumb {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 0.9rem;
}

.table-breadcrumb .breadcrumb-link {
    transition: color 0.2s;
}

.table-breadcrumb .breadcrumb-link:hover {
    color: var(--bs-primary) !important;
}

/* ---------------- Table Browser Grid ---------------- */
.table-browser-grid .ag-row {
    cursor: pointer !important;
}

.table-browser-grid .ag-row:hover .ag-cell {
    color: var(--bs-primary) !important;
}

/* ---------------- Editor Panel (Offcanvas) ---------------- */
.editor-panel {
    background-color: #161b22 !important;
    border-left: 1px solid #30363d !important;
    color: #c9d1d9 !important;
}

.editor-panel .offcanvas-header {
    border-bottom: 1px solid #30363d;
    background-color: #0d1117;
}

.editor-panel .offcanvas-body {
    display: flex;
    flex-direction: column;
    background-color: #161b22;
}

/* ---------------- Action Icon (Pencil) ---------------- */
.action-icon {
    opacity: 0.3;
    transition: opacity 0.2s;
    font-size: 0.85rem;
}

.ag-row:hover .action-icon {
    opacity: 1;
}

/* ---------------- Category Chips ---------------- */
.category-chip {
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    border: 1px solid transparent;
}

.category-chip:hover {
    border-color: var(--bs-primary) !important;
    opacity: 0.9;
}

/* ---------------- Row Highlight (search jump) ---------------- */
@keyframes row-highlight {
    0% {
        background-color: rgba(88, 166, 255, 0.3);
    }

    100% {
        background-color: transparent;
    }
}

.ag-row-highlight {
    animation: row-highlight 2s ease-out;
}

/* ---------------- Table Footer (Pagination) ---------------- */
.table-footer {
    background-color: #0d1117 !important;
    border-top: 1px solid #30363d !important;
}

/* ================ PLAYER MANAGEMENT - MASTER-DETAIL LAYOUT ================ */

/* Main container with split-pane layout */
.player-management-container {
    display: flex;
    height: calc(100vh - 180px);
    gap: 1rem;
    min-height: 600px;
}

/* Master list panel (left side) */
.master-list-panel {
    width: 38%;
    min-width: 400px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    overflow: hidden;
}

.master-list-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #30363d;
    background-color: #0d1117;
}

.master-list-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.master-list-search {
    flex: 1;
}

.master-list-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Detail panel (right side) */
.detail-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    overflow: hidden;
}

#detail-panel-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.detail-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #8b949e;
}

.detail-panel-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.detail-panel-header {
    padding: 1rem;
    border-bottom: 1px solid #30363d;
    background-color: #0d1117;
}

.detail-panel-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1rem;
}

#detail-tab-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

#character-actions-panel,
#account-actions-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.actions-panel-hint {
    flex: 0 0 auto;
}

.inventory-tab-content,
.spells-tab-content,
.quests-tab-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#inventory-items-container,
#character-spells-list {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.quests-sections {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: hidden;
}

.quests-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#character-active-quests-list,
#character-completed-quests-list {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.quests-grid-host {
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.quests-empty-state {
    flex: 1;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#quests-alert-container {
    flex-shrink: 0;
}

/* Entity header in detail panel */
.entity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.entity-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.entity-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #c9d1d9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.entity-subtitle {
    font-size: 0.9rem;
    color: #8b949e;
}

.entity-quick-actions {
    display: flex;
    gap: 0.5rem;
}

/* Segmented control for Accounts/Characters toggle */
.segmented-control {
    display: inline-flex;
    background-color: #21262d;
    border-radius: 6px;
    padding: 2px;
    border: 1px solid #30363d;
}

.segmented-control .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.segmented-control .btn:not(.active) {
    background-color: transparent;
    color: #8b949e;
}

.segmented-control .btn:not(.active):hover {
    color: #c9d1d9;
    background-color: rgba(110, 118, 129, 0.15);
}

.segmented-control .btn.active {
    background-color: #1f6feb;
    color: #f0f6fc;
}

/* Quick filter chips */
.quick-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    background-color: #21262d;
    color: #8b949e;
    user-select: none;
}

.filter-chip:hover {
    border-color: #58a6ff;
    color: #c9d1d9;
}

.filter-chip.active {
    background-color: #1f6feb;
    color: #f0f6fc;
    border-color: #1f6feb;
}

.filter-chip .chip-count {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    min-width: 1.25rem;
    text-align: center;
}

.filter-chip.active .chip-count {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Command Palette Modal */
.command-palette-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    z-index: 1100;
}

.command-palette {
    width: 600px;
    max-width: 90vw;
    max-height: 400px;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.command-palette-input-wrapper {
    padding: 1rem;
    border-bottom: 1px solid #30363d;
}

.command-palette-input {
    width: 100%;
    background-color: transparent;
    border: none;
    color: #c9d1d9;
    font-size: 1.1rem;
    outline: none;
}

.command-palette-input::placeholder {
    color: #6e7681;
}

.command-palette-results {
    max-height: 300px;
    overflow-y: auto;
}

.command-palette-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.1s;
}

.command-palette-item:hover,
.command-palette-item.selected {
    background-color: #21262d;
}

.command-palette-item-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #30363d;
    border-radius: 6px;
    color: #8b949e;
}

.command-palette-item-info {
    flex: 1;
}

.command-palette-item-title {
    font-weight: 500;
    color: #c9d1d9;
}

.command-palette-item-subtitle {
    font-size: 0.8rem;
    color: #8b949e;
}

.command-palette-item-badge {
    font-size: 0.75rem;
}

.command-palette-hint {
    padding: 0.75rem 1rem;
    border-top: 1px solid #30363d;
    font-size: 0.75rem;
    color: #6e7681;
    display: flex;
    gap: 1rem;
}

.command-palette-hint kbd {
    background-color: #21262d;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.7rem;
}

/* Detail panel tabs */
.detail-tabs {
    border-bottom: 1px solid #30363d;
}

.detail-tabs .nav-link {
    color: #8b949e;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.75rem 1rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.detail-tabs .nav-link:hover {
    color: #c9d1d9;
    border-bottom-color: #30363d;
}

.detail-tabs .nav-link.active {
    color: #58a6ff;
    border-bottom-color: #58a6ff;
    background-color: transparent;
}

/* Action buttons in detail panel */
.action-buttons-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s ease;
}

/* Action form panel (slide-over style) */
.action-form-panel {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

.action-form-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #30363d;
}

.action-form-panel-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #c9d1d9;
}

/* Info cards in overview */
.info-card {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    height: 100%;
}

.info-card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #30363d;
    font-weight: 600;
    font-size: 0.85rem;
    color: #c9d1d9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-card-body {
    padding: 0.75rem 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    border-bottom: 1px solid #21262d;
}

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

.info-label {
    color: #8b949e;
    font-size: 0.85rem;
}

.info-value {
    color: #c9d1d9;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Related entities list */
.related-entity-card {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.related-entity-card:hover {
    border-color: #58a6ff;
    background-color: #161b22;
}

.related-entity-card.active {
    border-color: #58a6ff;
    background-color: rgba(88, 166, 255, 0.1);
}

/* Row selection indicator in master list */
.master-list-row-selected {
    background-color: rgba(88, 166, 255, 0.15) !important;
    border-left: 3px solid #58a6ff;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .player-management-container {
        flex-direction: column;
        height: auto;
    }

    .master-list-panel {
        width: 100%;
        max-width: none;
        height: 400px;
    }

    .detail-panel {
        min-height: 500px;
    }
}

/* Keyboard shortcut hint badge */
.kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: #21262d;
    border: 1px solid #30363d;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: monospace;
    color: #8b949e;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1200;
}

.action-toast {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.action-toast.success {
    border-left: 3px solid #3fb950;
}

.action-toast.error {
    border-left: 3px solid #f85149;
}

.action-toast.info {
    border-left: 3px solid #58a6ff;
}

/* ---------------- AI Chat Widget ---------------- */
.chat-widget-container {
    font-family: 'Inter', sans-serif;
}

.chat-window {
    width: 580px;
    height: 500px;
    min-width: 300px;
    min-height: 400px;
    max-width: 90vw;
    max-height: 80vh;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both;
}

.chat-header {
    background: linear-gradient(135deg, #1f6feb 0%, #388bfd 100%);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #30363d;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.chat-header strong {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: #0d1117;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 3px;
}

.msg-user {
    align-self: flex-end;
    background-color: #1f6feb;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 18px 18px 4px 18px;
    max-width: 85%;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.msg-ai {
    align-self: flex-start;
    background-color: #21262d;
    color: #c9d1d9;
    padding: 10px 14px;
    border-radius: 18px 18px 18px 4px;
    max-width: 90%;
    font-size: 0.9rem;
    border: 1px solid #30363d;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.msg-ai p {
    margin-bottom: 0.5rem;
}

.msg-ai p:last-child {
    margin-bottom: 0;
}

.msg-ai pre {
    background-color: #0d1117;
    border-radius: 6px;
    padding: 8px;
    border: 1px solid #30363d;
    overflow-x: auto;
    margin-top: 8px;
    margin-bottom: 8px;
}

.msg-ai code {
    color: #58a6ff;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85em;
}

.chat-input-area {
    padding: 12px;
    background-color: #161b22;
    border-top: 1px solid #30363d;
}

.chat-input-area .form-control {
    border-radius: 20px 0 0 20px !important;
    background-color: #0d1117 !important;
    border: 1px solid #30363d !important;
    padding-left: 16px;
}

.chat-input-area .form-control:focus {
    border-color: #58a6ff !important;
    box-shadow: none !important;
}

.chat-input-area .btn {
    border-radius: 0 20px 20px 0 !important;
    padding-left: 16px;
    padding-right: 16px;
}

.chat-button {
    width: 56px;
    height: 56px;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(31, 111, 235, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(31, 111, 235, 0.5);
}
