/* styles.css */

/* ---------------------------------------------
   1) Full‑height layout so CCP fills the column
---------------------------------------------- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
}

/* Header stays fixed height at top */
.header {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid #ccc;
    flex: 0 0 auto;
}

.company-logo {
    height: 40px;
    margin-right: 15px;
}

/* Non-production test entry page */
.test-environment-banner {
    flex: 0 0 auto;
    padding: 10px 20px;
    background: #b45309;
    color: #fff;
    font-size: 0.9em;
    line-height: 1.4;
}

.test-environment-banner strong {
    letter-spacing: 0.03em;
}

.test-environment-banner code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.92em;
}

.test-banner-lede {
    margin: 0 0 10px 0;
}

.transcript-api-status {
    margin: 0 0 12px 0;
    font-size: 0.88em;
    opacity: 0.95;
    word-break: break-all;
}

.transcript-api-config {
    margin-top: 8px;
}

.transcript-api-config label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88em;
}

.transcript-api-config-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.transcript-api-config-row input[type="url"] {
    flex: 1 1 220px;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.95em;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    box-sizing: border-box;
}

.transcript-api-config-row button {
    padding: 8px 14px;
    font-size: 0.9em;
    cursor: pointer;
    border-radius: 4px;
    border: none;
    background: #fff;
    color: #b45309;
    font-weight: 600;
}

.transcript-api-config-row button.btn-secondary {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.transcript-api-config-row button:hover {
    filter: brightness(0.95);
}

h1 {
    font-size: 1.5em;
    margin: 0;
}

/* Container flexes to fill remaining height */
.container {
    display: flex;
    flex: 1 1 auto;
    gap: 20px;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden; /* prevent body‑level scrollbars */
}

/* Each column scrolls its own content if needed */
.left-column,
.middle-column,
.right-column {
    display: flex;
    flex-direction: column;
    overflow: auto;
    box-sizing: border-box;
}

/* 3 columns: widths can be tweaked */
.left-column {
    flex: 1 1 300px;
    max-width: 350px;
}

.middle-column {
    flex: 1 1 300px;
    max-width: 350px;
    gap: 20px;
    padding-right: 10px;
}

.right-column {
    flex: 2 1 400px;
    gap: 20px;
}

/* Make the CCP container fill its column vertically */
#ccp-container {
    flex: 1 1 auto;
    min-height: 0; /* allows proper flex shrink */
    border: 1px solid #ccc;
    background: #fff;
}

/* ---------------------------------------------
   2) Common panel/card styling
---------------------------------------------- */
.contact-info,
.chat-customer-info,
.outbound-dialer,
.amazon-q-recommendations,
.post-call-retry,
.post-call-summary,
.call-transcript {
    border: 1px solid #ccc;
    background-color: #fff;
    padding: 15px;
    margin-bottom: 0;
    box-sizing: border-box;
    width: 100%;
}

.post-call-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.post-call-panel-header h3 {
    margin: 0;
    font-size: 1em;
}

.btn-copy {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.85em;
    cursor: pointer;
    border: 1px solid #0073bb;
    background: #fff;
    color: #0073bb;
    border-radius: 4px;
}

.btn-copy:hover:not(:disabled) {
    background: #e8f4fc;
}

.btn-copy:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.post-call-retry {
    padding: 10px 15px;
    margin-bottom: 0;
}

.btn-retry {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95em;
    cursor: pointer;
    border: 1px solid #0073bb;
    background: #fff;
    color: #0073bb;
    border-radius: 4px;
    font-weight: 600;
}

.btn-retry:hover:not(:disabled) {
    background: #e8f4fc;
}

.btn-retry:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Ensure any overflowing text wraps */
#callSummary,
#callTranscript {
    white-space: pre-wrap;
    word-break: break-word;
    color: #333;
    font-size: 0.9em;
}

/* ---------------------------------------------
   3) Chat customer info panel
---------------------------------------------- */
.chat-customer-info {
    background-color: #e8f4fc;
    border-left: 4px solid #0073bb;
}

.chat-customer-info h3 {
    margin-top: 0;
    color: #0073bb;
}

.chat-customer-info p {
    margin: 8px 0;
    word-break: break-word;
}

.chat-customer-info a {
    color: #0073bb;
    text-decoration: none;
}

.chat-customer-info a:hover {
    text-decoration: underline;
}

/* ---------------------------------------------
   4) Outbound‑dialer form layout tweaks
---------------------------------------------- */
.outbound-dialer {
    display: flex;
    flex-direction: column;
}

.outbound-dialer h3 {
    margin-top: 0;
}

.outbound-dialer label {
    font-weight: bold;
    margin-top: 12px;
    margin-bottom: 4px;
}

.outbound-dialer input,
.outbound-dialer select {
    padding: 8px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #aaa;
    border-radius: 4px;
}

.outbound-dialer button {
    align-self: flex-end;
    padding: 8px 16px;
    margin-top: 16px;
    font-size: 1em;
    cursor: pointer;
    border: none;
    background-color: #0073bb;
    color: #fff;
    border-radius: 4px;
}

.outbound-dialer button:hover {
    background-color: #005fa3;
}

/* ---------------------------------------------
   5) Recent calls list
---------------------------------------------- */
.recent-calls {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #ddd;
}

.recent-calls h4 {
    margin: 0 0 8px 0;
    font-size: 0.9em;
    color: #666;
}

.recent-calls ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-calls li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.recent-calls li:last-child {
    border-bottom: none;
}

.recent-phone {
    color: #0073bb;
    cursor: pointer;
    font-family: monospace;
    font-size: 0.95em;
}

.recent-phone:hover {
    text-decoration: underline;
}

.recent-time {
    font-size: 0.8em;
    color: #999;
}

/* ---------------------------------------------
   6) Highlight incoming queue name
---------------------------------------------- */
#incomingQueueName.new-call {
    background-color: #4CAF50;
    color: #fff;
    padding: 2px 6px;
    border-radius: 2px;
}
