/* ================= RESET ================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Arial, sans-serif;
}

body {
    /* background: #f7f8fa; */
    color: #222;
    line-height: 1.4;
}

button{cursor: pointer;}

/* ================= LOADER ================= */

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-overlay.hidden {
    display: none;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f1f1f1;
    border-top: 4px solid #f48120;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.inline-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f1f1f1;
    border-top: 3px solid #f48120;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

/* ================= APP WRAPPER ================= */

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ================= HEADER ================= */

#app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

#app-header h1 {
    font-size: 24px;
    font-weight: 600;
}

#create-activity-btn {
    display: inline-flex;
    gap: 5px; align-items: center;
}

/* ================= ACTIVITY LIST ================= */

#activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ================= ACTIVITY ROW ================= */

.activity-row {
    background: #f1f1f1;
    border-radius: 8px;
    overflow: hidden;
}
.activity-row.expanded {
    background: #fbeee3;
}

/* ---- SUMMARY ---- */

.activity-summary {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: start;
    gap: 16px;
    padding: 16px;
    cursor: pointer;
}

.activity-summary:hover {
    background: #fbeee3;
}

.activity-arrow {
    font-size: 14px;
    user-select: none;
    line-height: 1;
    margin-top: 2px;
}
.activity-arrow {
    width: 25px;
    height: 25px;
    background: #f48120;
    border-radius: 100%;
    align-items: center;
    display: flex;
    justify-content: center;
    padding: 5px;
}

.activity-arrow img {max-width: 100%;width: 20px;}

.activity-arrow img {
    filter: brightness(0) invert(1);
}


.activity-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.activity-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-subtitle {
    font-size: 14px;
    color: #6b7280;
}

.activity-stats {
    font-size: 13px;
    color: #374151;
}

/* ---- ACTION BUTTONS ---- */

.activity-actions {
    display: flex;
    gap: 8px;
}

.activity-actions button {
    padding: 6px 15px;
    font-size: 15px;
    border-radius: 4px;
    border: 1px solid #f48120;
    background: #f48120;
    cursor: pointer;
}

.activity-actions button {
    border-radius: 30px;
    height: 30px;
    line-height: 1;
    color: #fff;
}
.activity-actions .run-btn {
    background: #fff;
    border: 1px solid #f48120;
    color: #f48120;
}

.activity-menu,
.contact-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
}

.menu-trigger {
    padding: 4px 10px;
    font-size: 14px;
    line-height: 1;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #fff;
}

.menu-trigger:hover {
    background: #f3f4f6;
}

.menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 140px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 20;
    padding: 4px;
}

.menu-list button {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.menu-list button:hover {
    background: #f3f4f6;
}

.activity-menu {
    position: relative;
}

.activity-menu .menu-trigger {
    padding: 6px 10px;
    font-size: 14px;
    line-height: 1;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #fff;
}

.activity-menu .menu-trigger:hover {
    background: #f3f4f6;
}

.activity-menu .menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 140px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 20;
    padding: 4px;
}

.activity-menu .menu-list button {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.activity-menu .menu-list button:hover {
    background: #f3f4f6;
}

/* ================= EXPANDED ACTIVITY ================= */

.activity-expanded {
    display: none;
    border-top: 1px solid #e5e7eb;
    padding: 16px;
    background: #f7f7f7;
        max-height: 420px;
        overflow: hidden;
}

.activity-row.expanded .activity-expanded {
    display: block;
}

/* ================= TABLE ================= */
.activity-table-inner {
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
}
.activity-table tr:last-child td {
    border-bottom: 0;
}
.activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    /* display: block; */
    max-height: 360px;
    overflow-y: auto;
        background: #fff;
}

.activity-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
}

.activity-table th,
.activity-table td {
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    white-space: nowrap;
}

.activity-table th {
    background: #f8fafc;
    font-weight: 600;
}

.contact-action-cell {
    text-align: center;
    vertical-align: middle;
}

/* ================= BUTTONS ================= */

.btn {
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-small {
    padding: 4px 8px;
    font-size: 11px;
}

.btn-primary {
    background: #f48120;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: rgb(245, 110, 0);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

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

/* ================= MODALS ================= */

.hidden {
    display: none !important;
}

/* ================= TRANSCRIPT MODAL ================= */

#transcript-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

#transcript-modal.hidden {
    display: none;
}

/* ================= CONTACT DETAILS MODAL ================= */

#contact-details-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 210;
}

#contact-details-modal.hidden {
    display: none;
}

.details-content {
    background: #ffffff;
    width: min(520px, 92vw);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
    width: 1000px; overflow: hidden;
}

.details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9e9dc;
}

.details-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.details-header button {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

#contact-details-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
     flex-direction: row;
    flex-wrap: wrap;
    padding: 20px;
}

.details-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}


.details-row {
    width: calc(33.333% - 6px);
    padding: 7px 10px;
    background: #f1f1f1;
    border-radius: 8px;
    display: block;
}

.details-row span {
    display: block;
}

.details-row span:first-child {
    font-weight: 600;
    margin-bottom: 2px;
    color: #000000;
}





/* modal card */
#transcript-content {
    background: #ffffff;
    width: 520px;
    max-width: 92%;
    max-height: 70vh;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* IMPORTANT */
}

/* ---------- HEADER ---------- */

#transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

#transcript-header::before {
    content: "Live Transcription";
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

/* close button */
#close-transcript-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #374151;
    padding: 4px;
}

#close-transcript-btn:hover {
    color: #111827;
}

/* ---------- BODY ---------- */

#transcript-body {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
}

/* transcript lines */
.transcript-line {
    font-size: 13px;
    line-height: 1.45;
    padding: 8px 10px;
    border-radius: 6px;
    word-wrap: break-word;
    max-width: 80%;
}

/* roles */
.transcript-line.role-assistant {
    background: #fbfbfb;
}
.transcript-line.role-agent {
    background: #eff6ff;
    color: #1e3a8a;
    align-self: flex-start;
}

.transcript-line.role-user,
.transcript-line.role-human {
    background: #ecfeff;
    color: #155e75;
    align-self: flex-end;
}

.transcript-line.role-system {
    background: #f3f4f6;
    color: #374151;
    font-style: italic;
    align-self: center;
}

/* role label */
.transcript-line strong {
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 2px;
    text-transform: capitalize;
}


/* ------------ */
.primary-btn {
    border: 0;
    background: #f48120;
    color: #fff;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 6px;
    height: 45px;
    min-width: 120px;
    cursor: pointer;
    text-decoration: none;
}

.secondary-btn{
     border: 1px solid #f48120;
    background: transparent;
    color: #f48120;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 6px;
    height: 45px;
    min-width: 120px;
}


/* Chrome, Edge, Safari */
#contact-details-body::-webkit-scrollbar {
  width: 5px;
}

#contact-details-body::-webkit-scrollbar-track {
  background: #f1f1f1;
}

#contact-details-body::-webkit-scrollbar-thumb {
  background: #a8a8a8;
  border-radius: 6px;
}

#contact-details-body::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.chip-success {
    background: #3eae3e;
    color: #fff;
    padding: 2px 7px 3px;
    border-radius: 6px;
    display: inline-block;
    font-size: 12px;
}
.chip-danger {
    background: #f34646;
    color: #fff;
    padding: 2px 7px 3px;
    border-radius: 6px;
    display: inline-block;
    font-size: 12px;
}
.btn-no-style{border: 0 !important; padding: 0 !important; background: transparent !important;}
.activity-actions button img{width:30px; height:30px;}