/* Existing styles */
.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 20px;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.user-message {
    background-color: #007AFF;
    color: white;
    margin-left: auto;
    border-top-right-radius: 5px;
}

.agent-message {
    background-color: #E9E9EB;
    color: black;
    margin-right: auto;
    border-top-left-radius: 5px;
}

.message-time {
    font-size: 0.75rem;
    color: #8E8E93;
    margin-top: 4px;
}

#error-message {
    display: none;
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0.5rem;
}

/* Tab Navigation Styles */
.tab-button {
    @apply px-4 py-2 text-gray-500 hover:text-gray-700 font-medium;
    position: relative;
}

.tab-button.active {
    @apply text-blue-600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: currentColor;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* List Item Styles */
.conversation-item, .agent-item {
    transition: all 0.2s ease;
}

.conversation-item:hover, .agent-item:hover {
    background-color: #f3f4f6;
}

.selected-conversation, .selected-agent {
    background-color: #e5edff;
    border-left: 3px solid #007AFF;
}

.audio-player {
    background: #f3f4f6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.audio-player audio {
    width: 100%;
}

.loading-spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #007AFF;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.analysis-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.clickable-link {
    color: #2563eb;
    text-decoration: none;
    transition: all 0.2s;
}

.clickable-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

.clickable-item {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 5px;
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .menu-toggle {
        display: block !important;
    }

    .conversation-list-container,
    .agent-list-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: white;
        z-index: 50;
        overflow-y: auto; /* Ensure scroll on smaller screens */
    }

    .conversation-list-container.hidden-mobile,
    .agent-list-container.hidden-mobile {
        display: none;
    }

    .conversation-details-container,
    .agent-details-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: white;
        z-index: 50;
        display: none;
        padding: 0;
        overflow-y: auto; /* Allow vertical scrolling for content */
    }

    .conversation-details-container.show,
    .agent-details-container.show {
        display: block;
    }

    .back-button {
        display: flex !important;
    }

    #conversationDetails,
    #agentDetails {
        height: calc(100vh - 60px) !important;
        padding: 1rem;
        overflow-y: auto; /* Let details scroll in smaller screens */
    }

    .mobile-header {
        height: 60px;
        display: flex !important;
        align-items: center;
        padding: 0 1rem;
        background: #f9fafb;
        border-bottom: 1px solid #e5e7eb;
    }
}

/* Hide mobile elements on desktop */
.menu-toggle, .back-button, .mobile-header {
    display: none;
}