/* Enhanced Ask Aptia Chatbot Styles with 50% Increased Height and New Features */
.ask-3173-chatbot {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chatbot-toggle {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #00D084, #00B070);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 208, 132, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 10000;
    pointer-events: auto;
    /* Decagon shape using clip-path */
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 208, 132, 0.6);
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00D084, #00F094, #00D084);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    z-index: -1;
    animation: aptiaGlow 2s ease-in-out infinite alternate;
}

@keyframes aptiaGlow {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

.chatbot-avatar {
    width: 50px;
    height: 50px;
    background-image: url('/aptia-logo.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin: 10px;
    flex-shrink: 0;
    border: 2px solid var(--aptia-green);
    box-shadow: 0 2px 8px rgba(0, 208, 132, 0.2);
}

/* Enhanced chatbot window with 10% further increased height */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    left: 80px; /* Position next to the button (70px button + 10px gap) */
    width: 400px;
    height: 693px; /* Increased from 630px by 10% (630 * 1.1 = 693px) */
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid #708090;
    display: none !important;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
}

.chatbot-window.enhanced-height {
    height: 693px; /* Updated explicit class for further increased height */
}

.chatbot-window.open {
    display: flex !important;
    animation: slideUp 0.3s ease-out;
}

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

.chatbot-header {
    background: linear-gradient(135deg, #708090, #2f4f4f);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
}

.chatbot-title {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.chatbot-close:hover {
    background-color: rgba(220, 20, 60, 0.3);
}

/* NEW: Suggested Questions Section - Expanded with extra 10% height */
.suggested-questions {
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
    padding: 15px;
    max-height: 183px; /* Increased from 120px by adding extra 63px from 10% window height increase */
    overflow-y: auto;
}

.suggested-questions-title {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.suggested-questions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggested-question-btn {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    line-height: 1.3;
}

.suggested-question-btn:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    border-color: #708090;
    color: #2f4f4f;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.suggested-question-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c0c0c0, #708090);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 10px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #dc143c, #b91c3c);
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 70%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    font-size: 12px;
    position: relative;
}

.message.user .message-content {
    background: linear-gradient(135deg, #708090, #2f4f4f);
    color: white;
}

/* NEW: Rating Buttons */
.rating-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

.rating-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.rating-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    border-color: #708090;
}

.rating-btn.thumbs-up:hover {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: #28a745;
}

.rating-btn.thumbs-down:hover {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
}

.rating-btn.selected.thumbs-up {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
    opacity: 1;
}

.rating-btn.selected.thumbs-down {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
    opacity: 1;
}

.rating-btn:active {
    transform: scale(0.95);
}

.chatbot-input-area {
    padding: 20px 15px; /* Increased padding from 15px to 20px (33% increase) */
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 65px; /* Added minimum height for 30% increase */
}

.chatbot-input {
    flex: 1;
    border: 2px solid #708090;
    border-radius: 25px;
    padding: 16px 20px; /* Increased padding from 12px 16px to 16px 20px (33% increase) */
    font-size: 10px;
    outline: none;
    transition: border-color 0.2s;
    min-height: 20px; /* Added minimum height for input field */
}

.chatbot-input:focus {
    border-color: #dc143c;
}

.voice-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c0c0c0, #708090);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
}

.voice-button:hover {
    background: linear-gradient(135deg, #708090, #2f4f4f);
}

.voice-button.recording {
    background: linear-gradient(135deg, #dc143c, #b91c3c);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc143c, #b91c3c);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
}

.send-button:hover {
    background: linear-gradient(135deg, #b91c3c, #991b1b);
}

.typing-indicator {
    display: none;
    padding: 10px 16px;
    background: white;
    border-radius: 18px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

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

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #708090;
    animation: typingDot 1.4s infinite ease-in-out;
}

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

@keyframes typingDot {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Draggable functionality */
.chatbot-window.dragging {
    user-select: none;
    transition: none;
}

/* Enhanced Mobile responsiveness */
@media (max-width: 768px) {
    .chatbot-window {
        width: 90vw;
        height: 80vh; /* Increased from 70vh to 80vh for mobile */
        left: 5vw;
        bottom: 90px;
    }
    
    .chatbot-window.enhanced-height {
        height: 98vh; /* Increased mobile height but capped at 98vh to avoid overflow */
    }
    
    .ask-3173-chatbot {
        bottom: 15px;
        left: 15px;
    }
    
    .chatbot-toggle {
        width: 60px;
        height: 60px;
    }
    
    .chatbot-avatar {
        width: 40px;
        height: 40px;
        margin: 10px;
    }
    
    .suggested-questions {
        max-height: 152px; /* Proportionally increased from 100px to match desktop expansion */
    }
    
    .suggested-question-btn {
        font-size: 10px;
        padding: 6px 10px;
    }
}

/* Speaker Button Styles */
.speak-button {
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: #6c757d;
}

.speak-button:hover {
    background-color: rgba(108, 117, 125, 0.1);
    color: #495057;
    transform: scale(1.1);
}

.speak-button:active {
    transform: scale(0.95);
}

.speak-button[title*="Listen"] {
    opacity: 0.8;
}

.speak-button[title*="Listen"]:hover {
    opacity: 1;
}

/* Scrollbar styling for better appearance */
.chatbot-messages::-webkit-scrollbar,
.suggested-questions::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track,
.suggested-questions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb,
.suggested-questions::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover,
.suggested-questions::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


/* Inline speak button styling */
.inline-speak {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    margin-left: 5px;
    padding: 2px 5px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.inline-speak:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.inline-speak:active {
    background-color: rgba(0, 123, 255, 0.2);
}


/* Decagon Chatbot Avatar Styling */
.chatbot-avatar-decagon {
    width: 45px !important;
    height: 45px !important;
    object-fit: contain !important;
    margin: 12.5px !important;
    border-radius: 6px !important;
    border: none !important;
    background: transparent !important;
}

/* Make send button Aptia green */
.send-button {
    background: linear-gradient(135deg, var(--aptia-green), var(--aptia-green-dark)) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
}

.send-button:hover {
    background: linear-gradient(135deg, var(--aptia-green-dark), #00A060) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 208, 132, 0.4) !important;
}

/* Fix chatbot header avatar in open window */
.chatbot-title img {
    object-fit: contain !important;
    background: white !important;
    padding: 2px !important;
}

/* Aptia Footer - Fixed Layout with Bold White Title and Equal Spacing */
.aptia-footer-fixed {
    background: white !important;
    border-top: 3px solid var(--aptia-green) !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

.footer-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 15px 20px !important;
    margin: 0 !important;
    min-height: 50px !important;
}

.quick-links-title {
    color: white !important;
    background: var(--aptia-green) !important;
    font-weight: bold !important;
    font-size: 16px !important;
    padding: 8px 15px !important;
    border-radius: 4px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.quick-links-nav {
    display: flex !important;
    justify-content: space-evenly !important;
    align-items: center !important;
    flex: 1 !important;
    margin: 0 !important;
    padding: 0 20px !important;
}

.quick-links-nav a {
    color: var(--aptia-green) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 8px 12px !important;
    border-radius: 20px !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
}

.quick-links-nav a:hover {
    color: white !important;
    background: var(--aptia-green) !important;
    border-color: var(--aptia-green) !important;
    transform: translateY(-2px) !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .footer-row {
        flex-direction: column !important;
        padding: 10px !important;
    }
    
    .quick-links-title {
        margin-bottom: 10px !important;
    }
    
    .quick-links-nav {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 0 !important;
    }
    
    .quick-links-nav a {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
}
/* Updated chatbot.css with Aptia branding */
:root {
    --aptia-green: #00D084;
    --aptia-green-dark: #00B070;
    --aptia-teal: #1B4B5A;
    --aptia-navy: #0F2A35;
    
    /* Aptia Chatbot Colors */
    --chatbot-text-light: var(--aptia-green);
    --chatbot-bg-light: #f8fffe; 
    --chatbot-border-light: var(--aptia-green);
    --user-msg-bg-light: var(--aptia-green); 
    --bot-msg-bg-light: rgba(255, 255, 255, 0.9);
    --header-bg-light: var(--aptia-green);
    --input-bg-light: rgba(255, 255, 255, 0.9);
    --input-container-bg-light: rgba(0, 208, 132, 0.05);
    --stats-bg-light: var(--aptia-green);

    /* Dark Mode Colors */
    --chatbot-text-dark: #E0E0E0;
    --chatbot-bg-dark: var(--aptia-navy);
    --chatbot-border-dark: var(--aptia-green);
    --user-msg-bg-dark: var(--aptia-green);
    --bot-msg-bg-dark: rgba(0, 0, 0, 0.3);
    --header-bg-dark: var(--aptia-teal);
    --input-bg-dark: rgba(0, 0, 0, 0.2);
    --input-container-bg-dark: rgba(0, 0, 0, 0.2);
    --stats-bg-dark: var(--aptia-green);
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

/* Chatbot Button */
.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: white;
    border: 3px solid var(--aptia-green);
    box-shadow: 0 4px 15px rgba(0, 208, 132, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.chatbot-button img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.chatbot-button:hover, .chatbot-button.active {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 208, 132, 0.4);
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 450px;
    background-color: white;
    border: 2px solid var(--aptia-green);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 208, 132, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1049;
}

.chatbot-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--aptia-green) 0%, var(--aptia-green-dark) 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

#chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

#chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Chatbot Messages */
.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f8fffe;
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
}

.message.user {
    margin-left: auto;
    text-align: right;
}

.message.bot {
    margin-right: auto;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user .message-content {
    background: linear-gradient(135deg, var(--aptia-green) 0%, var(--aptia-green-dark) 100%);
    color: white;
}

.bot .message-content {
    background-color: white;
    color: var(--aptia-navy);
    border: 1px solid rgba(0, 208, 132, 0.2);
}

/* Chatbot Input */
.chatbot-input {
    display: flex;
    padding: 15px;
    background: linear-gradient(135deg, rgba(0, 208, 132, 0.05) 0%, rgba(27, 75, 90, 0.05) 100%);
    border-top: 1px solid rgba(0, 208, 132, 0.2);
}

#chatbot-input-field {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(0, 208, 132, 0.3);
    border-radius: 25px;
    margin-right: 10px;
    background-color: white;
    transition: border-color 0.2s ease;
}

#chatbot-input-field:focus {
    outline: none;
    border-color: var(--aptia-green);
    box-shadow: 0 0 0 3px rgba(0, 208, 132, 0.1);
}

#chatbot-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--aptia-green) 0%, var(--aptia-green-dark) 100%);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 208, 132, 0.3);
}

#chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 208, 132, 0.4);
}

/* System Statistics Background */
.system-stats, .stats-container, .statistics-panel {
    background: linear-gradient(135deg, var(--aptia-green) 0%, var(--aptia-green-dark) 100%) !important;
    color: white !important;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 208, 132, 0.2);
}

.system-stats h3, .stats-container h3, .statistics-panel h3 {
    color: white !important;
    margin-bottom: 15px;
}

.system-stats .stat-item, .stats-container .stat-item, .statistics-panel .stat-item {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 10px;
}

.system-stats .stat-value, .stats-container .stat-value, .statistics-panel .stat-value {
    color: white !important;
    font-weight: bold;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .chatbot-window {
        width: 90%;
        right: 5%;
        left: 5%;
        bottom: 80px;
        height: 400px;
    }
    
    .chatbot-button {
        width: 55px;
        height: 55px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .chatbot-input {
        padding: 12px;
    }
}

/* Avatar styling for chatbot */
.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-image: url('/aptia-logo-chatbot.jpg');
    background-size: cover;
    background-position: center;
    border: 2px solid var(--aptia-green);
    margin-right: 10px;
}

/* Update any existing avatar references */
.bot-avatar, .chatbot-icon {
    background-image: url('/aptia-logo-chatbot.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
}

/* Aptia Footer - Fixed Layout with Bold White Title and Equal Spacing */
.aptia-footer-fixed {
    background: white !important;
    border-top: 3px solid var(--aptia-green) !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

.footer-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 15px 20px !important;
    margin: 0 !important;
    min-height: 50px !important;
}

.quick-links-title {
    color: white !important;
    background: var(--aptia-green) !important;
    font-weight: bold !important;
    font-size: 16px !important;
    padding: 8px 15px !important;
    border-radius: 4px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.quick-links-nav {
    display: flex !important;
    justify-content: space-evenly !important;
    align-items: center !important;
    flex: 1 !important;
    margin: 0 !important;
    padding: 0 20px !important;
}

.quick-links-nav a {
    color: var(--aptia-green) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 8px 12px !important;
    border-radius: 20px !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
}

.quick-links-nav a:hover {
    color: white !important;
    background: var(--aptia-green) !important;
    border-color: var(--aptia-green) !important;
    transform: translateY(-2px) !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .footer-row {
        flex-direction: column !important;
        padding: 10px !important;
    }
    
    .quick-links-title {
        margin-bottom: 10px !important;
    }
    
    .quick-links-nav {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 0 !important;
    }
    
    .quick-links-nav a {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
}
