/* css/frontend-styles.css */

/* Basic styling for messages */
#frontend_single_call_response.notice,
#frontend_bulk_call_response.notice,
#frontend_recordings_response.notice,
#frontend_transactions_response.notice {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

#frontend_single_call_response.notice-success,
#frontend_bulk_call_response.notice-success,
#frontend_recordings_response.notice-success,
#frontend_transactions_response.notice-success {
    background-color: #d4edda; /* Light green */
    color: #155724; /* Dark green */
    border: 1px solid #c3e6cb;
}

#frontend_single_call_response.notice-error,
#frontend_bulk_call_response.notice-error,
#frontend_recordings_response.notice-error,
#frontend_transactions_response.notice-error {
    background-color: #f8d7da; /* Light red */
    color: #721c24; /* Dark red */
    border: 1px solid #f5c6cb;
}

#frontend_single_call_response.notice-info,
#frontend_bulk_call_response.notice-info,
#frontend_recordings_response.notice-info,
#frontend_transactions_response.notice-info {
    background-color: #d1ecf1; /* Light blue */
    color: #0c5460; /* Dark blue */
    border: 1px solid #bee5eb;
}

/* Preformatted text for API responses */
#frontend_single_call_response pre,
#frontend_bulk_call_response pre {
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    font-size: 0.85rem;
    margin-top: 10px;
}

/* List styling for detailed bulk call results */
#frontend_bulk_call_response ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#frontend_bulk_call_response li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

/* --- New Styles for Transactions Card --- */

#integriti-ai-transactions-section {
    color: #1f2937; /* Default text color for the card content */
}

#integriti-ai-transactions-section h2 {
    color: #14b8a6; /* A nice teal color for the heading */
}

/* Styling for the transaction list */
#frontend_transactions_list ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

/* Transaction table styling */
.transaction-table {
    width: 100%;
    border-collapse: collapse;
}

.transaction-table th, .transaction-table td {
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
}

.transaction-table th {
    background-color: #e5e7eb;
    color: #374151;
    font-weight: 600;
    border-bottom: 2px solid #d1d5db;
}

.transaction-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease-in-out;
}

.transaction-table tbody tr:hover {
    background-color: #f3f4f6;
}

.transaction-amount-credit {
    color: #059669; /* Green */
    font-weight: 600;
}

.transaction-amount-debit {
    color: #dc2626; /* Red */
    font-weight: 600;
}

.transaction-table .transaction-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* Styling for filter inputs and buttons */
#integriti-ai-transactions-section input[type="date"] {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#integriti-ai-transactions-section input[type="date"]:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#frontend_filter_transactions_button,
#frontend_clear_filters_button {
    cursor: pointer;
}

#frontend_clear_filters_button {
    background-color: #6b7280; /* Gray color for the clear button */
    color: #fff;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease-in-out;
}

#frontend_clear_filters_button:hover {
    background-color: #4b5563; /* Darker gray on hover */
}

/* Added style to ensure hover text remains white for the balance button */
.integriti-ai-card:hover span, .integriti-ai-card:hover svg {
    color: white !important;
    stroke: white !important;
}

/* --- NEW STYLES for Call Recordings UI --- */

.integriti-recording-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease-in-out;
}

.integriti-recording-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    transform: translateY(-0.25rem);
}

.integriti-recording-card .flex {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.integriti-recording-card .icon-circle {
    width: 3.5rem;
    height: 3.5rem;
    background-color: #d1d5db;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.integriti-recording-card .icon-circle svg {
    color: #4b5563;
    width: 2rem;
    height: 2rem;
}

.integriti-recording-card .audio-player-container {
    flex-grow: 1;
}

.integriti-recording-card audio {
    width: 100%;
    outline: none;
}

.integriti-recording-card .view-transcript-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    background-color: #a855f7; /* purple-500 */
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
    cursor: pointer;
    margin-top: 1rem;
}

.integriti-recording-card .view-transcript-btn:hover {
    background-color: #9333ea; /* purple-600 */
    transform: scale(1.02);
}

.transcript-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.transcript-modal-content {
    background-color: #f7f7f7; /* Light gray chat background */
    padding: 2rem;
    border-radius: 0.75rem;
    max-width: 90%;
    min-height: 400px;
    width: 600px;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.transcript-modal-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1f2937;
    text-align: center;
}

.transcript-modal-content .close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    background: none;
    border: none;
    color: #9ca3af;
    transition: color 0.2s ease-in-out;
}

.transcript-modal-content .close-button:hover {
    color: #6b7280;
}

/* Transcript Loading Spinner */
.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #a855f7;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* New Chat-like Transcript Styling */
#transcript-content {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Increased space between messages */
    font-family: inherit;
    color: inherit;
    padding: 0;
    border: none;
    background-color: transparent;
    flex-grow: 1;
}

.chat-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1.5rem;
    max-width: 80%;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);
}

.chat-bubble-agent {
    background-color: #d1ecf1;
    color: #0c5460;
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
}

.chat-bubble-user {
    background-color: #e5e7eb;
    color: #374151;
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}

.chat-bubble strong {
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

/* --- NEW STYLES for Voices UI --- */
#integriti-ai-voices-section h2 {
    color: #c026d3; /* A nice fuchsia color for the heading */
}

.voice-card {
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease-in-out;
}

.voice-card:hover {
    background-color: #f3f4f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-0.125rem);
}

.voice-card.selected-voice-card {
    border-width: 2px;
    border-color: #a855f7;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    background-color: #f5f3ff;
}
