body {
 min-height: 100vh;
 background: linear-gradient(135deg, #000000 0%, #000c27 100%);
 display: flex;
 justify-content: center;
 padding: 0;
 }


.avatar-large {
 width: 120px;
 height: 120px;
 margin: 0 auto;
}

.avatar-large-img {
 width: 100%;
 height: 100%;
 border-radius: 50%;
 object-fit: cover;
 border: 4px solid var(--bs-primary);
}

.profession-badge-lg {
 font-size: 1rem;
 padding: 0.5em 1em;
}

.character-header {
 padding: 3rem;
 border-radius: 10px;
 background: rgba(var(--bs-primary-rgb), 0.1);
}

 .welcome-card {
 padding: 0rem;
 }
 
 .character-card {
 cursor: pointer;
 transition: all 0.3s;
 border: 1px solid rgba(0, 0, 0, 0.28);
 height: 100%;

 box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.56);
 }
 
 .character-card:hover {
 border: 1px solid rgba(0, 0, 0, 0.28);
 box-shadow: inset 0px 0px 28px rgba(29, 28, 28, 0.71);
 }
 
 .character-card.selected {
 border-color: var(--bs-primary);
 background-color: rgba(102, 126, 234, 0.1);
 }
 .character-card .card-body {
 padding: 1rem;
 display: flex;
 align-items: center;
 gap: 1rem;
 }
 .character-info-right {
 flex: 1;
 text-align: left;
 }
 .character-avatar-left {
 flex-shrink: 0;
 }
 .character-avatar-left img {
 width: 60px;
 height: 60px;
 border-radius: 50%;
 object-fit: cover;
 border: 2px solid var(--bs-border-color);
 }
 .character-card h6 {
 margin: 0 0 0.25rem 0;
 font-size: 1rem;
 font-weight: 600;
 }
 .character-card .profession-badge {
 font-size: 0.75rem;
 padding: 0.25rem 0.5rem;
 }
 .character-card .card-text {
 font-size: 0.8rem;
 margin: 0.5rem 0 0 0;
 line-height: 1.3;
 }
 .gender-male { color: #4A90E2; }
 .gender-female { color: #E94B8B; }
 .profession-badge {
 background: linear-gradient(135deg, #707070 0%, #8c8c8c 100%);
 }

#voiceInputBtn.recording {
    background: rgba(220, 53, 69, 0.2);
    animation: pulseRecording 1.5s infinite;
}

 #chatContainer {
 height: calc(100vh - 100px);
 display: flex;
 flex-direction: column;
 }
 #chatMessages {
 flex: 1;
 overflow-y: auto;
 padding: 1rem;
 background: linear-gradient(to bottom, rgba(102, 126, 234, 0.05), transparent);
 }
 .message {
 margin-bottom: 1rem;
 animation: fadeIn 0.3s;
 }
 @keyframes fadeIn {
 from { opacity: 0; transform: translateY(10px); }
 to { opacity: 1; transform: translateY(0); }
 }
 .message-user {
 text-align: right;
 }
 .message-bubble {
 display: inline-block;
 max-width: 75%;
 padding: 0.75rem 1rem;
 border-radius: 1rem;
 word-wrap: break-word;
 }
 .message-user .message-bubble {
 background: linear-gradient(135deg, rgba(157,182,173,0.97) 0%, rgba(99,140,125,0.78) 100%);
 border-bottom-right-radius: 0.25rem;
 }
 .message-bot .message-bubble {
 background-color: var(--bs-secondary-bg);
 border-bottom-left-radius: 0.25rem;
 }
 .message-time {
 font-size: 0.75rem;
 opacity: 0.6;
 margin-top: 0.25rem;
 }
 #inputArea {
 padding: 1rem;
 background-color: var(--bs-body-bg);
 border-top: 1px solid var(--bs-border-color);
 }
 
 .character-info {
 background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
 padding: 0.5rem 1rem;
 border-bottom: 1px solid var(--bs-border-color);
 }
 .gender-icon-male { color: #4A90E2; }
 .gender-icon-female { color: #E94B8B; } 
 


 .chat-header {
 background: rgba(26, 26, 26, 0.95);
 backdrop-filter: blur(10px);
 border-bottom: 1px solid var(--border-color);
 padding: 1rem;
 position: sticky;
 top: 0;
 z-index: 1000;
 flex-shrink: 0;
 }

 .character-info {
 display: flex;
 align-items: center;
 gap: 1rem;
 }

 .character-avatar {
 width: 45px;
 height: 45px;
 border-radius: 50%;
 object-fit: cover;
 border: 2px solid var(--primary-color);
 box-shadow: 0 0 15px rgba(67, 97, 238, 0.3);
 }

 .character-details h5 {
 font-weight: 600;
 margin-bottom: 0.1rem;
 font-size: 1.1rem;
 }

 .character-details small {
 font-size: 0.85rem;
 opacity: 0.8;
 }


 .chat-container {
 display: flex;
 flex-direction: column;
 height: 100vh;
 overflow: hidden;
 max-width: 100%;
 }

 .chat-messages-container {
 flex: 1;
 overflow: hidden;
 position: relative;
 }

 .chat-messages {
 height: 100%;
 overflow-y: auto;
 padding: 1.5rem 1rem;
 scroll-behavior: smooth;
 }


 .message {
 margin-bottom: 1.5rem;
 animation: messageAppear 0.3s ease-out;
 max-width: 85%;
 display: flex;
 flex-direction: column;
 }

 .message-user {
 align-self: flex-end;
 align-items: flex-end;
 }

 .message-bot {
 align-self: flex-start;
 align-items: flex-start;
 }

 .message-bubble {
 padding: 0.9rem 1.2rem;
 border-radius: 18px;
 max-width: 100%;
 word-wrap: break-word;
 position: relative;
 line-height: 1.5;
 font-size: 1rem;
 box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
 }

 .message-bot .message-bubble {
 background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
 border: 1px solid #333;
 border-bottom-left-radius: 5px;
 color: #e0e0e0;
 }

 .message-user .message-bubble {
 background: linear-gradient(135deg, var(--primary-color) 0%, #3a56e4 100%);
 border: none;
 border-bottom-right-radius: 5px;
 color: white;
 }

 .message-time {
 font-size: 0.75rem;
 color: var(--text-muted);
 margin-top: 0.3rem;
 padding: 0 0.3rem;
 }

 .character-info {
 background: rgba(0, 0, 0, 0.60);
 padding: 0.5rem 1rem;
 border-bottom: 1px solid var(--bs-border-color);
 }
 .gender-icon-male { color: #4A90E2; }
 .gender-icon-female { color: #E94B8B; }


 .typing-indicator {
 display: none;
 padding: 1rem 1.2rem;
 background: rgba(0, 0, 0, 0);
 border-radius: 18px;
 border: 1px solid #333;
bottom: 200px;
 align-self: flex-start;
 max-width: 120px;
 animation: pulse 2s infinite;
 position: absolute;
 }

 .typing-dots {
 display: flex;
 gap: 5px;
 }

 .typing-dots span {
 width: 8px;
 height: 8px;
 background: var(--primary-color);
 border-radius: 50%;
 animation: typing 1.4s infinite ease-in-out;
 }

 .typing-dots span:nth-child(1) { animation-delay: -0.32s; }
 .typing-dots span:nth-child(2) { animation-delay: -0.16s; }


 .audio-controls {
 background: rgba(26, 26, 26, 0.9);
 backdrop-filter: blur(10px);
 border-top: 1px solid var(--border-color);
 border-bottom: 1px solid var(--border-color);
 padding: 0.8rem 1rem;
 display: none;
 flex-shrink: 0;
 }

 .audio-controls.show {
 display: block;
 animation: slideDown 0.3s ease-out;
 }

 .audio-progress {
 flex: 1;
 margin: 0 1rem;
 }

 .progress {
 height: 4px;
 background: #333;
 border-radius: 2px;
 overflow: hidden;
 }

 .progress-bar {
 background: var(--primary-color);
 transition: width 0.1s linear;
 }


 .input-area {
 background: rgba(26, 26, 26, 0.95);
 backdrop-filter: blur(10px);
 border-top: 1px solid var(--border-color);
 padding: 1rem;
 flex-shrink: 0;
 }

 .message-input-wrapper {
 display: flex;
 gap: 0.75rem;
 align-items: center;
 }

 #messageInput {
 flex: 1;
 background: #2a2a2a;
 border: 1px solid #333;
 color: white;
 padding: 0.9rem 1.2rem;
 border-radius: 12px;
 font-size: 1rem;
 transition: all 0.2s;
 }

 #messageInput:focus {
 background: #2d2d2d;
 border-color: var(--primary-color);
 box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
 outline: none;
 }

 #messageInput::placeholder {
 color: #666;
 }

 #sendBtn {
 background:-webkit-linear-gradient(#11821b 0%, #ffffff 100%);
 border: none;
 border-radius: 50%;
 display: flex;
 align-items: center;
 justify-content: center;
 transition: all 0.2s;
 }

 #sendBtn:hover {
 background: #3a56e4;
 transform: translateY(-1px);
 box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
 }

 #sendBtn:active {
 transform: translateY(0);
 }

 #sendBtn i {
 font-size: 1.2rem;
 }


 .audio-toggle-wrapper {
 display: flex;
 align-items: center;
 gap: 0.5rem;
 }

 .form-check-input {
 width: 3em;
 height: 1.5em;
 margin-top: 0;
 cursor: pointer;
 }

 .form-check-input:checked {
 background-color: var(--primary-color);
 border-color: var(--primary-color);
 }

 .audio-toggle-label {
 font-size: 0.9rem;
 color: var(--text-muted);
 cursor: pointer;
 }


 #clearChat {
 background: transparent;
 border: 1px solid #555;
 color: #aaa;
 transition: all 0.2s;
 }

 #clearChat:hover {
 background: rgba(220, 53, 69, 0.1);
 border-color: #dc3545;
 color: #dc3545;
 }


 .chat-messages::-webkit-scrollbar {
 width: 8px;
 }

 .chat-messages::-webkit-scrollbar-track {
 background: transparent;
 }

 .chat-messages::-webkit-scrollbar-thumb {
 background: #444;
 border-radius: 4px;
 }

 .chat-messages::-webkit-scrollbar-thumb:hover {
 background: #555;
 }


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

 @keyframes typing {
 0%, 60%, 100% { transform: translateY(0); }
 30% { transform: translateY(-6px); }
 }

 @keyframes pulse {
 0%, 100% { opacity: 1; }
 50% { opacity: 0.7; }
 }

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

 @keyframes typewriter {
 from {
 width: 0;
 }
 to {
 width: 100%;
 }
 }

 @keyframes blink {
 0%, 100% {
 opacity: 1;
 }
 50% {
 opacity: 0;
 }
 }


 .empty-state {
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 height: 100%;
 color: var(--text-muted);
 text-align: center;
 padding: 2rem;
 }

 .empty-state i {
 font-size: 3rem;
 margin-bottom: 1rem;
 opacity: 0.5;
 }


 @media (max-width: 768px) {
 .chat-messages {
 padding: 1rem 0.75rem;
 }

 .message {
 max-width: 90%;
 }

 .message-bubble {
 padding: 0.8rem 1rem;
 font-size: 0.95rem;
 }

 .character-avatar {
 width: 40px;
 height: 40px;
 }

 .character-details h5 {
 font-size: 1rem;
 }

 .input-area {
 padding: 0.75rem;
 }

 #messageInput {
 padding: 0.8rem 1rem;
 font-size: 0.95rem;
 }

 #sendBtn {
 }
 }

 @media (max-width: 576px) {
 .message {
 max-width: 95%;
 }

 .character-info {
 gap: 0.75rem;
 }

 .character-avatar {
 width: 38px;
 height: 38px;
 }

 .message-input-wrapper {
 gap: 0.5rem;
 }
 }


 .audio-status {
 font-size: 0.8rem;
 color: var(--text-muted);
 margin-top: 0.2rem;
 min-height: 1.2rem;
 }


 #testAudioBtn {
 background: transparent;
 border: 1px solid #555;
 color: #aaa;
 transition: all 0.2s;
 }

 #testAudioBtn:hover {
 background: rgba(32, 201, 151, 0.1);
 border-color: #20c997;
 color: #20c997;
 }

 // In Styles:
#voiceInputBtn {
 background: transparent;
 border: 1px solid #555;
 color: #aaa;
 transition: all 0.2s;
}

#voiceInputBtn:hover {
 background: rgba(32, 201, 151, 0.1);
 border-color: #20c997;
 color: #20c997;
}

#voiceInputBtn.recording {
 background: rgba(220, 53, 69, 0.2);
 border-color: #dc3545;
 color: #dc3545;
 animation: pulseRecording 1.5s infinite;
}

@keyframes pulseRecording {
 0%, 100% { opacity: 1; }
 50% { opacity: 0.7; }
}
.avatar-wrapper {
 display: inline-block;
 position: relative;
}

.avatar-img img {
 object-fit: cover;
 border: 3px solid #fff;
 box-shadow: 0 4px 6px rgba(0,0,0,0.1);
 transition: transform 0.3s ease;
}

.avatar-img img:hover {
 transform: scale(1.05);
}


.avatar-sm img {
 width: 50px !important;
 height: 50px !important;
}

.avatar-md img {
 width: 100px !important;
 height: 100px !important;
}

.avatar-lg img {
 width: 150px !important;
 height: 150px !important;
}


.avatar-online::after {
 content: '';
 position: absolute;
 bottom: 5px;
 right: 5px;
 width: 15px;
 height: 15px;
 background-color: #28a745;
 border: 2px solid #fff;
 border-radius: 50%;
}


.avatar-container {
 display: inline-block;
 position: relative;
}

.avatar-circle {
 width: 100px;
 height: 100px;
 border-radius: 50%;
 overflow: hidden;
 border: 3px solid #fff;
 box-shadow: 0 4px 8px rgba(0,0,0,0.1);
 transition: transform 0.3s ease;
}

.avatar-circle:hover {
 transform: scale(1.05);
}

.avatar-image {
 width: 100%;
 height: 100%;
 object-fit: cover;
 object-position: center;
}


.avatar-sm .avatar-circle {
 width: 50px;
 height: 50px;
 border-width: 2px;
}

.avatar-md .avatar-circle {
 width: 100px;
 height: 100px;
 border-width: 3px;
}

.avatar-lg .avatar-circle {
 width: 150px;
 height: 150px;
 border-width: 4px;
}


.avatar-online .avatar-circle::after {
 content: '';
 position: absolute;
 bottom: 5px;
 right: 5px;
 width: 15px;
 height: 15px;
 background-color: #28a745;
 border: 2px solid #fff;
 border-radius: 50%;
 z-index: 10;
}


.avatar-primary .avatar-circle {
 border-color: #0d6efd;
}

.avatar-success .avatar-circle {
 border-color: #198754;
}

.avatar-warning .avatar-circle {
 border-color: #ffc107;
}

.card-body {
 display: flex;
 align-items: center;
 gap: 1rem;
}

.character-avatar {
 width: 50px !important;
 height: 50px !important;
}

.character-name {
 font-size: 0.85rem !important;
 line-height: 1.2;
}

.profession-badge-sm {
 font-size: 0.65rem !important;
 padding: 2px 6px !important;
}


 .chat-type-card {
 cursor: pointer;
 transition: all 0.3s;
 border: 2px solid transparent;
 height: 100px;
 margin-bottom: 10px;
 }

 .chat-type-card:hover {
 border-color: var(--bs-primary);
 transform: translateY(-2px);
 box-shadow: 0 4px 12px rgba(67, 97, 238, 0.15);
 }

 .chat-type-card.selected {
 border-color: var(--bs-primary);
 background-color: rgba(67, 97, 238, 0.08);
 }

 .chat-type-card .card-body {
 padding: 15px;
 display: flex;
 align-items: center;
 height: 100%;
 }

 .chat-type-icon {
 font-size: 2.2rem;
 margin-right: 15px;
 color: var(--bs-primary);
 flex: 0 0 auto;
 }

 .chat-type-content {
 flex: 1;
 }

 .chat-type-card .card-title {
 font-size: 1.1rem;
 margin-bottom: 0.3rem;
 }

 .chat-type-card .text-muted {
 font-size: 0.85rem;
 margin-bottom: 0;
 line-height: 1.2;
 }


 .chat-features {
 display: flex;
 flex-wrap: wrap;
 gap: 5px;
 margin-top: 5px;
 }

 .feature-badge {
 font-size: 0.7rem;
 padding: 2px 6px;
 background-color: var(--bs-dark);
 border: 1px solid var(--bs-border-color);
 }


 @media (max-width: 768px) {
 .chat-type-card {
 height: 90px;
 }

 .chat-type-card .card-body {
 padding: 12px;
 }

 .chat-type-icon {
 font-size: 1.8rem;
 margin-right: 12px;
 }

 .chat-type-card .card-title {
 font-size: 1rem;
 }

 .chat-type-card .text-muted {
 font-size: 0.8rem;
 }

 .feature-badge {
 display: none;
 }
 }


