/* Frontend Components Styles */

:root {
    --semicolon-primary: #0073aa;
    --semicolon-success: #28a745;
    --semicolon-danger: #dc3545;
    --semicolon-warning: #ffc107;
    --semicolon-info: #17a2b8;
    --semicolon-light: #f8f9fa;
    --semicolon-dark: #343a40;
    --semicolon-border: #dee2e6;
}

/* Agent Search Component */
.semicolon-helps-agent-search {
    background: var(--semicolon-light);
    padding: 30px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.semicolon-helps-agent-search h2 {
    margin-top: 0;
    color: var(--semicolon-dark);
}

.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.search-filter-group {
    display: flex;
    flex-direction: column;
}

.search-filter-group label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--semicolon-dark);
    font-size: 14px;
}

.search-filter-group select,
.search-filter-group input {
    padding: 10px;
    border: 1px solid var(--semicolon-border);
    border-radius: 4px;
    font-size: 14px;
}

.search-filter-group select:focus,
.search-filter-group input:focus {
    outline: none;
    border-color: var(--semicolon-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.search-loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid var(--semicolon-light);
    border-top: 4px solid var(--semicolon-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Agent Cards */
.semicolon-helps-agents-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.semicolon-helps-agent-card {
    background: white;
    border: 1px solid var(--semicolon-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.semicolon-helps-agent-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.agent-card-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
}

.agent-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-card-content {
    padding: 20px;
}

.agent-card-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--semicolon-dark);
}

.agent-card-subtitle {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--semicolon-primary);
    font-weight: 500;
}

.agent-card-description {
    margin: 0 0 15px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-card-meta {
    margin: 15px 0;
    padding: 12px 0;
    border-top: 1px solid var(--semicolon-border);
    border-bottom: 1px solid var(--semicolon-border);
    font-size: 13px;
}

.agent-card-meta-item {
    margin: 5px 0;
}

.agent-card-meta-label {
    font-weight: 600;
    color: var(--semicolon-dark);
}

.agent-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.agent-tag {
    background-color: var(--semicolon-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.agent-card-availability {
    margin: 15px 0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.agent-card-availability.available {
    background-color: #d4edda;
    color: #155724;
}

.agent-card-availability.busy {
    background-color: #fff3cd;
    color: #856404;
}

.agent-card-availability.not-available {
    background-color: #f8d7da;
    color: #721c24;
}

.agent-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.agent-card-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.agent-request-btn {
    background-color: var(--semicolon-success);
    color: white;
}

.agent-request-btn:hover:not(:disabled) {
    background-color: #218838;
}

.agent-request-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.agent-view-btn {
    background-color: var(--semicolon-primary);
    color: white;
}

.agent-view-btn:hover {
    background-color: #005a87;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ccc;
}

/* Session Request Modal */
.semicolon-helps-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.semicolon-helps-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--semicolon-border);
}

.modal-header h2 {
    margin: 0;
    color: var(--semicolon-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: var(--semicolon-dark);
}

.modal-body {
    margin-bottom: 20px;
}

.session-details {
    margin: 0;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--semicolon-dark);
    border-bottom: 2px solid var(--semicolon-light);
    padding-bottom: 8px;
}

.detail-section p {
    margin: 8px 0;
    font-size: 14px;
    color: #333;
}

.detail-section strong {
    color: var(--semicolon-dark);
    font-weight: 600;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--semicolon-dark);
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--semicolon-border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--semicolon-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--semicolon-primary);
    color: white;
}

.btn-primary:hover {
    background-color: #005a87;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Call Interface */
.semicolon-helps-call-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--semicolon-dark);
    border-radius: 8px;
    overflow: hidden;
}

.call-header {
    background: var(--semicolon-primary);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.call-title {
    font-size: 18px;
    font-weight: 600;
}

.call-timer {
    font-size: 16px;
    font-weight: 600;
}

.call-frame {
    flex: 1;
    border: none;
    background: black;
}

.call-controls {
    background: #333;
    padding: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.call-control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-control-btn.mute-btn {
    background-color: var(--semicolon-primary);
    color: white;
}

.call-control-btn.mute-btn:hover {
    background-color: #005a87;
}

.call-control-btn.end-btn {
    background-color: var(--semicolon-danger);
    color: white;
    width: auto;
    padding: 10px 20px;
    border-radius: 4px;
}

.call-control-btn.end-btn:hover {
    background-color: #c82333;
}

/* Pending Requests Notifications */
.semicolon-helps-pending-requests {
    background: white;
    border: 1px solid var(--semicolon-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.pending-request-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--semicolon-light);
    border-radius: 4px;
    margin-bottom: 10px;
}

.pending-request-item:last-child {
    margin-bottom: 0;
}

.pending-request-info {
    flex: 1;
}

.pending-request-user {
    font-weight: 600;
    color: var(--semicolon-dark);
    margin-bottom: 5px;
}

.pending-request-time {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.pending-request-type {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.pending-request-actions {
    display: flex;
    gap: 10px;
}

.pending-request-actions button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}

.accept-btn {
    background-color: var(--semicolon-success);
    color: white;
}

.accept-btn:hover {
    background-color: #218838;
}

.reject-btn {
    background-color: var(--semicolon-danger);
    color: white;
}

.reject-btn:hover {
    background-color: #c82333;
}

.view-btn {
    background-color: var(--semicolon-primary);
    color: white;
}

.view-btn:hover {
    background-color: #005a87;
}

/* Notifications */
.semicolon-helps-notification {
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 4px;
    border-left: 4px solid;
}

.notification-success {
    background-color: #d4edda;
    border-color: var(--semicolon-success);
    color: #155724;
}

.notification-error {
    background-color: #f8d7da;
    border-color: var(--semicolon-danger);
    color: #721c24;
}

.notification-info {
    background-color: #d1ecf1;
    border-color: var(--semicolon-info);
    color: #0c5460;
}

.notification-warning {
    background-color: #fff3cd;
    border-color: var(--semicolon-warning);
    color: #856404;
}

/* Checkbox Grid Styles */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.checkbox-item:hover {
    opacity: 0.8;
}

.scrollable-checkboxes {
    border: 1px solid var(--semicolon-border);
    border-radius: 4px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
}

.scrollable-checkboxes::-webkit-scrollbar {
    width: 6px;
}

.scrollable-checkboxes::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.scrollable-checkboxes::-webkit-scrollbar-thumb {
    background: var(--semicolon-primary);
    border-radius: 4px;
}

.scrollable-checkboxes::-webkit-scrollbar-thumb:hover {
    background: #005a87;
}

.search-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--semicolon-border);
    border-radius: 4px;
    font-size: 14px;
}

.search-select:focus {
    outline: none;
    border-color: var(--semicolon-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .semicolon-helps-agents-list {
        grid-template-columns: 1fr;
    }

    .search-filters {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
    }

    .call-controls {
        flex-wrap: wrap;
    }

    .pending-request-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .pending-request-actions {
        width: 100%;
        margin-top: 10px;
    }

    .pending-request-actions button {
        flex: 1;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .scrollable-checkboxes {
        max-height: 250px;
    }
}

/* Connection Type Selection */
.connection-type-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.connection-type-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.connection-type-radio:hover {
    background-color: #f5f5f5;
    border-color: #bbb;
}

.connection-type-radio input[type="radio"] {
    cursor: pointer;
    margin: 0;
}

.connection-type-radio input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--semicolon-primary, #0073aa);
}

.connection-type-radio span {
    flex: 1;
    font-size: 14px;
}

/* Text Chat Interface */
.semicolon-helps-chat-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.chat-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--semicolon-primary, #0073aa) 0%, var(--semicolon-primary-dark, #005a87) 100%);
    color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    display: flex;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.own {
    justify-content: flex-end;
}

.chat-message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.chat-message.other .chat-message-bubble {
    background-color: #f0f0f0;
    color: #333;
}

.chat-message.own .chat-message-bubble {
    background-color: var(--semicolon-primary, #0073aa);
    color: white;
}

.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--semicolon-primary, #0073aa);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.chat-send-btn {
    padding: 10px 20px;
    background-color: var(--semicolon-primary, #0073aa);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
    align-self: flex-end;
}

.chat-send-btn:hover {
    background-color: var(--semicolon-primary-dark, #005a87);
}

.chat-send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}