* {
    box-sizing: border-box;
}

body {
    background-color: #1A1A1A;
    color: #E0E0E0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.agent-session-page-body {
    height: 100vh;
    overflow: hidden;
}

/* ADDED: Styles for Global Controls in Header */
#global-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #252526;
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #333;
}

#global-controls .control-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

#global-controls #network-capture-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

#global-controls #network-capture-status-indicator.status-on {
    background-color: #28a745; /* Green */
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.7);
}

#global-controls #network-capture-status-indicator.status-off {
    background-color: #dc3545; /* Red */
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.7);
}

/* In agent.css */
#global-controls #network-capture-status-indicator.status-connecting {
    background-color: #6c757d; /* Grey */
    /* Optional: Add a subtle animation */
    animation: pulse-grey 2s infinite;
}

@keyframes pulse-grey { 
  0% { box-shadow: 0 0 0 0 rgba(108, 117, 125, 0.4); } 
  70% { box-shadow: 0 0 0 8px rgba(108, 117, 125, 0); } 
  100% { box-shadow: 0 0 0 0 rgba(108, 117, 125, 0); } 
}

#global-controls .agent-btn {
    margin-left: 0; /* Override default margin */
    font-weight: 600;
}

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

.customer-switcher-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #252526;
    padding: 0 15px;
    border-radius: 8px;
    border: 1px solid #333;
    color: #FBC02D;
    position: relative; /* Needed for custom arrow */
}

.customer-switcher-select {
    -webkit-appearance: none; /* Remove default styling for Chrome/Safari */
    -moz-appearance: none;    /* Remove default styling for Firefox */
    appearance: none;         /* Remove default styling for modern browsers */
    background: transparent;
    border: none;
    color: #E0E0E0;
    font-size: 1em;
    font-weight: 500;
    padding: 12px 35px 12px 5px; /* Add padding to the right for the arrow */
    cursor: pointer;
    width: 100%;
}

.customer-switcher-container::after {
    content: '▼';
    font-size: 12px;
    color: #FBC02D;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none; /* Allows clicks to pass through to the select element */
}


.customer-switcher-select:focus {
    outline: none;
}

.customer-switcher-select option {
    background-color: #252526;
    color: #E0E0E0;
}


.dashboard-content-section {
    background-color: #1E1E1E;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 25px;
}

.application-form {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.application-form input {
    flex-grow: 1;
    padding: 12px;
    background-color: #252526;
    border: 1px solid #444;
    border-radius: 5px;
    color: #E0E0E0;
    font-size: 1rem;
}

.api-key-display-container {
    margin-top: 30px;
    background-color: #252526;
    border: 1px solid #444;
    border-left: 4px solid #28a745;
    border-radius: 8px;
    padding: 20px;
}

.api-key-display-container h3 {
    margin-top: 0;
    color: #28a745;
}

.api-key-box {
    background-color: #1A1A1A;
    padding: 15px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Consolas', 'Monaco', monospace;
}

#new-api-key-text {
    font-size: 1.1rem;
    color: #FBC02D;
    word-break: break-all;
}

#copy-api-key-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 15px;
}

#copy-api-key-btn:hover {
    color: #fff;
}

/* Re-using button styles from previous implementation for consistency */
.action-btn-disable {
    background-color: #fd7e14; /* Orange */
    color: #fff;
}
.action-btn-disable:hover {
    background-color: #e66a00;
}
.action-btn-enable {
    background-color: #20c997; /* Teal */
    color: #fff;
}
.action-btn-enable:hover {
    background-color: #1baa80;
}

.agent-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden; 
}

.agent-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
    justify-content: space-between;
    flex-shrink: 0; 
}

.agent-header img {
    height: 40px;
}

.agent-header h1 {
    margin: 0;
    font-size: 2em;
}

.agent-header p {
    margin: 0;
    color: #AAA;
}

.dashboard-content h2, .session-history-controls h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-top: 0;
}

#customer-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.customer-card {
    background-color: #1E1E1E;
    border: 1px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease-in-out;
    border-left: 5px solid #6c757d;
}

.customer-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.card-header { padding: 15px; border-bottom: 1px solid #333; font-weight: bold; font-size: 1.2em; color: #f0f0f0; }
.card-body { padding: 15px; flex-grow: 1; display: flex; align-items: center; gap: 15px; font-size: 0.95em; }
.status-indicator { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.status-text { text-transform: capitalize; color: #ccc; }
.card-footer { padding: 15px; background-color: #252526; border-top: 1px solid #333; border-radius: 0 0 8px 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.join-btn, .history-btn { width: 100%; padding: 12px; color: #000; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; font-size: 1em; transition: background-color 0.2s, color 0.2s; }
.join-btn:disabled { background-color: #444 !important; color: #888; cursor: not-allowed; }
.history-btn { background-color: #6c757d; color: #fff; }
.history-btn:hover { background-color: #5a6268; }

.status-offline { border-left-color: #6c757d; }
.status-offline .status-indicator { background-color: #6c757d; }
.status-online { border-left-color: #28a745; }
.status-online .status-indicator { background-color: #28a745; }
.status-online .join-btn { background-color: #17a2b8; color: #fff; }
.status-online .join-btn:hover { background-color: #1bb2c9; }
.status-requesting-help { border-left-color: #FBC02D; animation: pulse-yellow 2s infinite; }
.status-requesting-help .status-indicator { background-color: #FBC02D; }
.status-requesting-help .join-btn { background-color: #FBC02D; }
.status-requesting-help .join-btn:hover { background-color: #ffca41; }
.status-requesting-setup { border-left-color: #7e22ce; animation: pulse-purple 2s infinite; }
.status-requesting-setup .status-indicator { background-color: #7e22ce; }
.status-requesting-setup .join-btn.setup-btn { background-color: #7e22ce; color: #fff; }
.status-requesting-setup .join-btn.setup-btn:hover { background-color: #8f3be3; }
.status-pending-approval { border-left-color: #fd7e14; animation: pulse-orange 2s infinite;}
.status-pending-approval .status-indicator { background-color: #fd7e14; }
.status-in-session { border-left-color: #007bff; }
.status-in-session .status-indicator { background-color: #007bff; }

@keyframes pulse-yellow { 0% { box-shadow: 0 0 0 0 rgba(251, 192, 45, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(251, 192, 45, 0); } 100% { box-shadow: 0 0 0 0 rgba(251, 192, 45, 0); } }
@keyframes pulse-orange { 0% { box-shadow: 0 0 0 0 rgba(253, 126, 20, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(253, 126, 20, 0); } 100% { box-shadow: 0 0 0 0 rgba(253, 126, 20, 0); } }
@keyframes pulse-purple { 0% { box-shadow: 0 0 0 0 rgba(126, 34, 206, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(126, 34, 206, 0); } 100% { box-shadow: 0 0 0 0 rgba(126, 34, 206, 0); } }

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column; 
    min-height: 0;
}

main.session-view-container {
    flex-direction: row; 
    gap: 20px;
    flex-wrap: nowrap; 
}

.main-content-wrapper {
    flex: 1; 
    display: flex;
    flex-direction: column; 
    min-width: 0; 
}

#mirror-container {
    background-color: #101010;
    border: 1px solid #333;
    border-radius: 8px;
    flex-grow: 1; 
    display: grid;
    overflow: hidden; 
    position: relative;
}

.dashboard-v2 {
    background-color: #121212; 
}

.dashboard-v2 .agent-header {
    border-bottom-color: #444;
}

.dashboard-main-content {
    display: flex;
    flex-direction: column;
    gap: 30px; 
    padding-top: 20px;
}

.dashboard-main-content h2 {
    font-size: 1.5em;
    color: #E0E0E0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.metric-card {
    background-color: #1E1E1E;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #FBC02D;
}

.metric-card .metric-title {
    font-size: 0.9em;
    color: #aaa;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.metric-card .metric-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #fff;
    line-height: 1.1;
}

.metric-card .metric-description {
    font-size: 0.8em;
    color: #777;
    margin-top: 5px;
}

.placeholder-message {
    background-color: #1E1E1E;
    color: #777;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    border: 1px dashed #333;
}


#request-list, #full-customer-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    background-color: #1E1E1E;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px 20px;
    display: grid;
    grid-template-columns: 1fr 150px 320px; 
    align-items: center;
    gap: 20px;
    transition: background-color 0.2s ease;
}

.list-item:hover {
    background-color: #2a2a2a;
}

.list-item-customer-name {
    font-weight: 600;
    font-size: 1.1em;
    color: #E0E0E0;
}

.list-item-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-item-status .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.list-item-status .status-text {
    text-transform: capitalize;
    font-size: 0.95em;
    color: #ccc;
}

.list-item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.list-item-actions .agent-btn {
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 600;
    white-space: nowrap;
}

.list-item-actions .history-btn {
    background-color: #3a3a3a;
    color: #ccc;
}
.list-item-actions .history-btn:hover {
    background-color: #4a4a4a;
}

.request-item {
    border-left: 4px solid #FBC02D;
    animation: pulse-yellow 2s infinite;
}

.status-online .status-indicator { background-color: #28a745; }
.status-requesting-help .status-indicator { background-color: #FBC02D; }
.status-requesting-setup .status-indicator { background-color: #7e22ce; }
.status-pending-approval .status-indicator { background-color: #fd7e14; }
.status-in-session .status-indicator { background-color: #007bff; }
.status-offline .status-indicator { background-color: #6c757d; }
.status-offline .list-item-customer-name,
.status-offline .status-text { color: #777; }

.list-item-actions .go-live-btn {
    background-color: #28a745;
    color: #fff;
}
.list-item-actions .go-live-btn:hover {
    background-color: #218838;
}

.list-item-actions .action-btn-start { background-color: #FBC02D; color: #000; }
.list-item-actions .action-btn-start:hover { background-color: #ffcf4a; }

.list-item-actions .action-btn-setup { background-color: #7e22ce; color: #fff; }
.list-item-actions .action-btn-setup:hover { background-color: #8f3be3; }

.list-item-actions .action-btn-request { background-color: #17a2b8; color: #fff; }
.list-item-actions .action-btn-request:hover { background-color: #1bb2c9; }

.list-item-actions .agent-btn:disabled {
    background-color: #444 !important;
    color: #888;
    cursor: not-allowed;
}

#mirror-iframe, #agent-drawing-canvas, #replay-drawing-canvas { grid-area: 1 / 1; margin: 0; transform-origin: top left; }
#mirror-iframe { border: none; background-color: white; pointer-events: none; }
#agent-drawing-canvas { pointer-events: auto; cursor: default; }
#replay-drawing-canvas { pointer-events: none; }
#mirror-iframe .agent-focus { outline: 3px solid #007bff !important; box-shadow: 0 0 10px rgba(0, 123, 255, 0.7) !important; transition: outline 0.1s ease-in-out, box-shadow 0.1s ease-in-out; }
.agent-controls { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; padding: 15px; background-color: #252526; border: 1px solid #333; border-top: none; border-radius: 0 0 8px 8px; }
.agent-controls p { margin: 0; }

.agent-btn { background-color: #444; color: #fff; border: 1px solid #666; border-radius: 5px; padding: 8px 15px; cursor: pointer; margin-left: 10px; transition: background-color 0.2s; }
.agent-btn:hover { background-color: #555; }
.agent-btn.end-session { background-color: #dc3545; border-color: #dc3545; }
.agent-btn.end-session:hover { background-color: #c82333; }
.agent-btn:disabled { background-color: #333; color: #777; cursor: not-allowed; border-color: #555; }
.agent-btn i { pointer-events: none; }

.header-actions { margin-left: auto; padding-left: 20px; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); display: flex; justify-content: center; align-items: center; z-index: 200; backdrop-filter: blur(5px); }
.modal-content { background-color: #1E1E1E; border: 1px solid #444; border-radius: 12px; width: 90%; max-width: 700px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; max-height: 80vh; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 25px; border-bottom: 1px solid #333; }
.modal-header h2 { margin: 0; font-size: 1.5rem; }
.modal-close-btn { background: none; border: none; color: #aaa; font-size: 2.5rem; font-weight: bold; cursor: pointer; line-height: 1; padding: 0; }
.modal-close-btn:hover { color: #fff; }
.modal-body { padding: 25px; overflow-y: auto; color: #ccc; }
.modal-body p { margin-top: 0; margin-bottom: 20px; line-height: 1.6; }

#masking-rules-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.masking-rule-item { display: flex; justify-content: space-between; align-items: center; background-color: #252526; padding: 15px; border-radius: 6px; border-left: 3px solid #7e22ce; }
.masking-rule-selector { font-family: 'Consolas', 'Monaco', monospace; font-size: 1rem; color: #E0E0E0; word-break: break-all; }
.delete-rule-btn { background: none; border: none; color: #999; cursor: pointer; font-size: 1.1rem; padding: 5px; margin-left: 15px; transition: color 0.2s ease-in-out; }
.delete-rule-btn:hover { color: #dc3545; }
.delete-rule-btn i { pointer-events: none; }

#active-session-controls { display: flex; gap: 10px; align-items: center; }
#drawing-toolbar { display: flex; gap: 5px; background-color: #3a3a3a; padding: 5px; border-radius: 5px; }
.tool-btn.active, .agent-btn.active { background-color: #007bff; border-color: #007bff; }
.cobrowse-masked-element {
    background: #333 !important;
    border-radius: 4px;
    color: transparent !important;
    text-shadow: 0 0 8px rgba(0,0,0,0.5) !important;
    display: inline-block;
    vertical-align: top;
}
.cobrowse-masked-element * { visibility: hidden !important; }

.agent-btn.primary-action { background-color: #007bff; border-color: #007bff; }
.agent-btn.primary-action:hover { background-color: #0069d9; }
.session-history-controls { margin-bottom: 20px; }
#session-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 15px; }
.session-history-item { background-color: #1E1E1E; border: 1px solid #333; border-radius: 8px; padding: 20px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.session-history-item .session-info { font-size: 1.1em; }
.session-history-item .session-meta { display: flex; gap: 20px; color: #aaa; }

.replay-controls { gap: 15px; }
.replay-controls #play-pause-btn {
    width: 40px;
    height: 34px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
}
.speed-controls {
    display: flex;
    background-color: #3a3a3a;
    border-radius: 5px;
}
.speed-btn {
    background: none;
    border: none;
    color: #ccc;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    margin: 0;
}
.speed-btn.active {
    background-color: #007bff;
    color: white;
    border-radius: 5px;
}

.log-entry {
    align-items: flex-start;
    gap: 8px;
}

.log-entry .log-icon {
    margin-top: 3px;
    color: #888;
    width: 16px; 
    text-align: center;
}

#main-panel-behavior:empty::after {
    content: "No user behavior events (like rage or dead clicks) have been recorded.";
    display: block;
    text-align: center;
    color: #888;
    padding: 50px 20px;
}

#main-panel-behavior {
    overflow-y: auto;
    padding: 5px;
}

#main-panel-console {
    overflow-y: auto;
    padding: 5px;
}

.log-type-behavior {
    border-left: 3px solid #a2d2fb;
}

.log-type-behavior.log-rage-click {
    background-color: rgba(220, 53, 69, 0.1);
}
.log-type-behavior.log-rage-click .log-icon {
    color: #dc3545;
}

.log-type-behavior.log-dead-click {
    background-color: rgba(251, 192, 45, 0.1);
}
.log-type-behavior.log-dead-click .log-icon {
    color: #FBC02D;
}

.log-type-behavior .log-message {
    color: #E0E0E0;
}
.log-type-behavior code.log-element-selector {
    background-color: #3a3a3a;
    color: #fce08d;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
}
.log-type-behavior .log-element-text {
    color: #aaa;
    font-style: italic;
}

#timeline-slider { flex-grow: 1; cursor: pointer; }
.replay-cursor { position: fixed; width: 20px; height: 20px; opacity: 0.7; border: 2px solid black; border-radius: 50%; pointer-events: none; z-index: 10001; transform: translate(-50%, -50%); display: none; transition: top 0.05s linear, left 0.05s linear; }
#mirror-iframe .highlight { outline: 3px solid #FBC02D !important; box-shadow: 0 0 15px rgba(251, 192, 45, 0.7) !important; transition: outline 0.1s ease-in-out, box-shadow 0.1s ease-in-out; }

.hidden { display: none !important; }

#log-window {
    position: relative; 
    flex-basis: 450px; 
    max-width: 600px;
    min-width: 350px;
    height: auto; 
    background-color: #252526;
    border-left: 1px solid #444;
    display: flex;
    flex-direction: column;
    z-index: 100;
    flex-shrink: 0; 
}

#log-resizer {
    position: absolute;
    top: 0;
    left: -2px; 
    width: 5px; 
    height: 100%;
    cursor: col-resize; 
    z-index: 101; 
}

#log-window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px 0 0;
    background-color: #333333;
    border-bottom: 1px solid #1a1a1a;
    font-weight: bold;
    flex-shrink: 0;
}

.log-main-tabs {
    display: flex;
}

.log-main-tab-btn {
    background: none;
    border: none;
    color: #aaa;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
}
.log-main-tab-btn.active {
    color: #fff;
    background-color: #252526;
    border-bottom-color: #0e639c;
}

#close-logs-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
}
#close-logs-btn:hover { color: #fff; }

#log-main-panels {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

.log-main-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
}
.log-main-panel.active {
    display: flex;
}

#main-panel-console {
    overflow-y: auto;
    padding: 5px;
}
.log-entry {
    padding: 4px 8px;
    border-bottom: 1px solid #333;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    display: flex;
}
.log-entry .timestamp { color: #888; margin-right: 10px; }
.log-entry.console-error { background-color: rgba(220, 53, 69, 0.1); border-left: 3px solid #dc3545; color: #ff8a8a; }
.log-entry.console-warn { background-color: rgba(251, 192, 45, 0.1); border-left: 3px solid #FBC02D; color: #fce08d; }
.log-entry.console-info { border-left: 3px solid #0e639c; }
.log-entry.log-type-action { color: #a2d2fb; border-left: 3px solid #a2d2fb;}

.network-toolbar {
    padding: 6px 8px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.network-toolbar .filter-icon { color: #888; }
#network-filter-input {
    flex-grow: 1;
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-radius: 4px;
    color: #eee;
    padding: 4px 8px;
    font-size: 13px;
}
#network-filter-input:focus { outline: 1px solid #0e639c; }

.network-type-filters {
    padding: 6px 8px;
    border-bottom: 1px solid #333;
    display: flex;
    gap: 5px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.network-type-filter-btn {
    background-color: #3e3e3e;
    border: 1px solid #555;
    color: #ccc;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
}
.network-type-filter-btn:hover { background-color: #4a4a4a; }
.network-type-filter-btn.active { background-color: #0e639c; border-color: #0e639c; color: white; }

.network-log-list-container {
    flex-grow: 1;
    overflow-y: auto;
    position: relative;
}
.network-log-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr;
    font-weight: bold;
    color: #aaa;
    padding: 8px;
    border-bottom: 1px solid #444;
    position: sticky;
    top: 0;
    background-color: #252526;
    z-index: 1;
}
#network-log-list { font-size: 12px; }
#network-initial-message {
    display: none;
    text-align: center;
    color: #888;
    padding-top: 50px;
}
#network-initial-message.active { display: block; }
#network-initial-message .small { font-size: 12px; color: #666; }

.network-request-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr;
    border-bottom: 1px solid #333;
    cursor: pointer;
}
.network-request-row:hover { background-color: #333333; }
.network-request-row.expanded { background-color: #0e639c; color: white; }
.network-request-row > div { padding: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.network-col-name { color: #eee; }
.network-col-status.status-error { color: #ff8a8a; }
.network-col-status.status-warn { color: #fce08d; }

.network-details {
    display: none;
    grid-column: 1 / -1;
    background-color: #1e1e1e;
    color: #ccc;
    cursor: default;
}
.network-request-row.expanded .network-details { display: block; }
.network-tabs { display: flex; border-bottom: 1px solid #333; padding: 0 10px; }
.network-tab-btn { background: none; border: none; color: #aaa; padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 2px solid transparent; }
.network-tab-btn:hover { color: white; }
.network-tab-btn.active { color: #FBC02D; border-bottom-color: #FBC02D; }
.network-panels .network-panel { display: none; padding: 10px; }
.network-panels .network-panel.active { display: block; }
.network-panel h4 { margin: 0 0 10px 0; color: #FBC02D; border-bottom: 1px solid #555; padding-bottom: 5px; }
.network-panel table { width: 100%; border-collapse: collapse; }
.network-panel td { padding: 4px; border-bottom: 1px solid #3a3a3c; vertical-align: top; }
.network-panel tr:last-child td { border-bottom: none; }
.network-panel td:first-child { font-weight: bold; color: #ddd; width: 30%; }
.network-panel pre { white-space: pre-wrap; word-break: break-all; margin: 0; font-size: 12px; max-height: 300px; overflow-y: auto; background-color: #252526; padding: 10px; border-radius: 4px; }
pre.empty-message { background: none; text-align: center; color: #888; }

body.dashboard-body {
    display: flex;
    flex-direction: row; 
    height: 100vh;
    overflow: hidden;
}

.dashboard-sidebar {
    width: 240px;
    background-color: #1E1E1E;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid #333;
}

.sidebar-header img {
    height: 40px;
    width: auto;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 20px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: #aaa;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}

.nav-link:hover {
    background-color: #252526;
    color: #fff;
}

.nav-link.active {
    background-color: #2a2a2a;
    color: #FBC02D;
    border-left-color: #FBC02D;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: center;
}

.sidebar-footer .agent-btn {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #3a3a3a;
    padding: 10px 20px; 
}

.sidebar-footer .agent-btn:hover {
    background-color: #4a4a4a;
}

.dashboard-main-view {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: #1A1A1A;
}

.dashboard-main-view .agent-header {
    background-color: #1E1E1E;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 20px 30px;
    margin-bottom: 0;
}
.dashboard-main-view .agent-header h1 { margin: 0; font-size: 1.8em; }
.dashboard-main-view .agent-header p { margin: 5px 0 0 0; }

.dashboard-panel {
    display: none;
    padding: 30px;
    flex-direction: column;
    gap: 30px;
}

.dashboard-panel.active {
    display: flex;
}

.agent-container.dashboard-v2 {
    display: block; 
}


.dashboard-charts {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.chart-container {
    background-color: #1E1E1E;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 25px;
    position: relative;
}

.bar-chart-container {
    height: 390px;
}

.canvas-wrapper {
    height: 360px;
    position: relative;
    margin-bottom: 0;
}

.session-history-controls { 
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px; 
}

.session-history-controls h2 {
    margin: 0;
    padding: 0;
    border: none;
}

.filter-buttons {
    display: inline-block;
    margin-left: 20px;
    background-color: #252526;
    border-radius: 5px;
    padding: 5px;
}

.filter-buttons .agent-btn {
    background-color: transparent;
    border: none;
    color: #aaa;
    margin-left: 0; /* Override default margin */
}

.filter-buttons .agent-btn:hover {
    background-color: #444;
}

.filter-buttons .agent-btn.active {
    background-color: #007bff;
    color: white;
}

.filter-buttons .agent-btn.active:hover {
    background-color: #007bff;
}

.session-info .cobrowse-tag,
.session-info .rage-click-tag,
.session-info .dead-click-tag {
    font-size: 0.9em;
    font-weight: bold;
    margin-left: 10px;
    border: 1px solid;
    padding: 2px 6px;
    border-radius: 4px;
}

.session-info .cobrowse-tag {
    color: #FBC02D;
    border-color: #FBC02D;
}

.session-info .rage-click-tag {
    color: #dc3545;
    border-color: #dc3545;
}

.session-info .dead-click-tag {
    color: #fd7e14;
    border-color: #fd7e14;
}

#session-list, #all-sessions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.session-history-item .session-info { 
    flex-grow: 1; 
    flex-basis: 50%;
}

.chart-container h3 {
    margin: 0 0 20px 0;
    font-size: 1.2em;
    color: #E0E0E0;
}

.pie-charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.placeholder-message.small {
    padding: 20px;
    font-size: 0.9em;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    background: none;
    border: none;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    padding: 20px 10px 0 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #ccc;
    cursor: default;
}

.legend-color-box {
    width: 12px;
    height: 12px;
    display: inline-block;
    flex-shrink: 0;
}

.legend-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

/* Styles for new Date Filter Feature */

.session-history-controls > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

#all-sessions-date-filter-btn, #history-date-filter-btn {
    padding: 8px 12px;
}

.date-filter-inputs {
    display: flex;
    gap: 20px;
    margin: 20px 0 25px 0;
}

.date-filter-inputs .input-group {
    flex: 1;
}

.date-filter-inputs label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
    font-size: 0.9em;
}

.date-filter-inputs input[type="datetime-local"] {
    width: 100%;
    padding: 10px;
    background-color: #252526;
    border: 1px solid #444;
    border-radius: 5px;
    color: #E0E0E0;
    font-family: inherit;
    font-size: 1rem;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.active-filter-display {
    background-color: #2a2d30;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: #ccc;
}

.active-filter-display span {
    font-weight: 600;
    color: #FBC02D;
}

.active-filter-display button {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
}

.active-filter-display button:hover {
    color: #fff;
}

/* This new wrapper helps in positioning the markers over the slider */
#timeline-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    height: 34px; /* Match the replay control button height */
}

/* Ensure the slider takes up the full width of the new wrapper */
#timeline-slider {
    width: 100%;
    margin: 0;
}

/* This container will hold all the event markers */
#timeline-markers-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Let clicks pass through to the slider by default */
    pointer-events: none; 
}

/* Styling for an individual event marker on the timeline */
.timeline-marker {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 16px; /* Taller than the slider track for visibility */
    border-radius: 2px;
    cursor: pointer;
    /* Markers themselves are clickable */
    pointer-events: auto; 
    z-index: 2;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Specific color for rage-click events */
.timeline-marker.rage-click {
    background-color: #dc3545; /* Red */
}

/* Specific color for dead-click events */
.timeline-marker.dead-click {
    background-color: #fd7e14; /* Orange */
}

/* Tooltip that appears on hover to identify the event type */
.timeline-marker::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1E1E1E;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 3;
}

/* Show the tooltip on hover */
.timeline-marker:hover::after {
    opacity: 1;
    visibility: visible;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 25px;
    padding: 10px;
}

.pagination-controls .page-btn {
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: #ccc;
    cursor: pointer;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
    min-width: 40px;
    text-align: center;
}

.pagination-controls .page-btn:hover:not(:disabled) {
    background-color: #444;
    color: #fff;
}

.pagination-controls .page-btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
    cursor: default;
}

.pagination-controls .page-btn:disabled {
    background-color: #1e1e1e;
    color: #555;
    cursor: not-allowed;
    border-color: #333;
}

.pagination-controls .ellipsis {
    color: #777;
    padding: 0 5px;
}

.section-subtitle {
    font-size: 0.95em;
    color: #aaa;
    margin-top: -10px;
    margin-bottom: 20px;
    max-width: 800px;
}

.rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #252526;
    padding: 15px;
    border-radius: 6px;
}

.masking-rule-item {
     border-left: 3px solid #7e22ce;
}

.path-rule-item {
    border-left: 3px solid #fd7e14;
}

.rule-selector, .rule-pattern {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1rem;
    color: #E0E0E0;
    word-break: break-all;
}

.delete-rule-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    margin-left: 15px;
    transition: color 0.2s ease-in-out;
}

.delete-rule-btn:hover {
    color: #dc3545;
}

.delete-rule-btn i {
    pointer-events: none;
}

/* Update sidebar footer button text */
#manage-masking-btn span {
    font-weight: 500;
}

/* Update modal title */
#masking-rules-modal h2 {
    font-size: 1.5rem;
}

/* Make sidebar icons uniform width */
.sidebar-nav i {
    width: 24px;
    text-align: center;
    font-size: 1.1em;
}

/* Style for session paused message */
#session-paused-message {
    text-align: center;
    color: #ccc;
    display: none; /* Initially hidden */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    background-color: #1a1a1a;
}
#session-paused-message .paused-icon {
    font-size: 4rem;
    color: #fd7e14;
    margin-bottom: 20px;
}
#session-paused-message h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #fff;
}