/* Custom styles for FleetBot */
.hero-section {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    min-height: 70vh;
    display: flex;
    align-items: center;
    padding: 4rem 0;
}

.cta-section {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    padding: 4rem 0;
}

.stat-item {
    padding: 2rem;
}

.topic-card {
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.topic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.topic-card i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.topic-card span {
    display: block;
    font-weight: 500;
}

/* Chat Interface Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 76px);
    max-width: 800px;
    margin: 0 auto;
    border-left: 1px solid var(--bs-border-color);
    border-right: 1px solid var(--bs-border-color);
}

.chat-header {
    background: var(--bs-dark);
    color: var(--bs-light);
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bs-body-bg);
}

.message {
    display: flex;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease-in;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: var(--bs-primary);
    color: white;
}

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

.user-message .message-avatar {
    background: var(--bs-secondary);
    color: white;
    margin-left: 1rem;
    margin-right: 0;
}

.message-content {
    flex: 1;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    padding: 1rem;
    position: relative;
}

.user-message .message-content {
    background: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
}

.message-sources {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color);
}

.source-item {
    background: var(--bs-light);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--bs-primary);
}

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

.source-title {
    font-weight: 600;
    color: var(--bs-primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.source-excerpt {
    font-size: 0.8rem;
    color: var(--bs-secondary);
    margin-top: 0.25rem;
}

.chat-input {
    padding: 1rem;
    background: var(--bs-card-bg);
    border-top: 1px solid var(--bs-border-color);
}

/* Voice Input Button */
#voiceBtn {
    border-left: none;
    border-right: none;
    transition: all 0.3s ease;
}

#voiceBtn.btn-danger {
    animation: pulse 1.5s infinite;
}

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

.typing-indicator {
    display: flex;
    align-items: center;
    color: var(--bs-secondary);
    font-style: italic;
    margin-bottom: 1rem;
}

.typing-dots {
    display: inline-flex;
    margin-left: 0.5rem;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bs-secondary);
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

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

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

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

/* Formatted response styling */
.formatted-list {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.formatted-list li {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.section-header {
    font-weight: 600;
    color: var(--bs-body-color);
    margin: 1rem 0 0.5rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.section-header-no-border {
    font-weight: 600;
    color: var(--bs-body-color);
    margin: 1rem 0 0.5rem 0;
    padding-bottom: 0.25rem;
    border-bottom: none !important;
}

.compact-numbered-item {
    margin: 1rem 0 0.5rem 0;
    line-height: 1.4;
}

.compact-numbered-item strong {
    font-weight: 600;
    color: var(--bs-body-color);
    display: block;
    margin-bottom: 0;
}

.compact-description {
    margin-top: 0.1rem;
    margin-left: 0;
    line-height: 1.4;
    color: var(--bs-body-color);
}

.regular-text {
    margin: 0.5rem 0;
    line-height: 1.4;
}

/* Completely remove all horizontal lines from message content */
.message-content * {
    border-bottom: none !important;
    border-top: none !important;
}

.message-content ol li,
.message-content ul li,
.message-content p,
.message-content div,
.message-content span,
.message-content strong,
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    border-bottom: none !important;
    border-top: none !important;
    padding-bottom: 0 !important;
    padding-top: 0 !important;
}

.message-content ol li {
    margin-bottom: 0.5rem;
    border-bottom: none !important;
}

.message-content ul li {
    margin-bottom: 0.25rem;
    border-bottom: none !important;
}

.message-content div {
    line-height: 1.5;
}

.message-content strong {
    color: var(--bs-body-color);
    font-weight: 600;
}

/* Bot message content should be all white text */
.bot-message .message-content {
    color: var(--bs-body-color);
}

.bot-message .message-content strong {
    color: var(--bs-body-color);
}

.bot-message .section-header {
    color: var(--bs-body-color);
}

.message-content ul {
    margin: 0.5rem 0;
}

.message-content li {
    margin-bottom: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 60px);
        border-left: none;
        border-right: none;
        max-width: 100%;
    }
    
    .chat-header {
        padding: 0.75rem;
        flex-wrap: wrap;
    }
    
    .chat-header .d-flex:first-child {
        flex: 1;
        min-width: 0;
    }
    
    .chat-header h5 {
        font-size: 1rem;
    }
    
    .chat-header small {
        font-size: 0.75rem;
    }
    
    .chat-messages {
        padding: 0.75rem;
    }
    
    .message {
        margin-bottom: 1rem;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        margin-right: 0.75rem;
    }
    
    .user-message .message-avatar {
        margin-left: 0.75rem;
        margin-right: 0;
    }
    
    .message-content {
        padding: 0.75rem;
        font-size: 0.9rem;
        border-radius: 0.75rem;
    }
    
    .chat-input {
        padding: 0.75rem;
    }
    
    .chat-input .input-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .hero-section {
        padding: 2rem 0;
        text-align: center;
        min-height: 60vh;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .btn {
        margin: 0.25rem;
        width: 100%;
        max-width: 280px;
    }
    
    /* Navigation improvements for mobile */
    .navbar .d-flex.gap-4 {
        gap: 1rem !important;
        flex-wrap: wrap;
    }
    
    .navbar .nav-link {
        font-size: 0.9rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Modal improvements for mobile */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    /* Follow-up questions mobile optimization */
    .follow-up-questions {
        margin-top: 0.75rem;
        padding: 0.5rem;
    }
    
    .follow-up-question-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        margin: 0.3rem 0;
    }
    
    /* Source items mobile optimization */
    .source-item {
        padding: 0.5rem;
        margin-bottom: 0.4rem;
    }
    
    .source-title {
        font-size: 0.85rem;
    }
    
    .source-excerpt {
        font-size: 0.75rem;
    }
    
    /* Message actions mobile optimization */
    .message-actions {
        opacity: 1; /* Always visible on mobile */
        gap: 0.2rem;
    }
    
    .message-actions .btn {
        font-size: 0.7rem;
        padding: 0.15rem 0.3rem;
    }
}

/* Extra small devices optimization */
@media (max-width: 480px) {
    .chat-header .d-flex.gap-2 {
        display: none !important; /* Hide action buttons on very small screens */
    }
    
    .navbar .d-flex.gap-4 a:not(.btn) {
        display: none; /* Hide nav links except login button on very small screens */
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .message-content {
        font-size: 0.85rem;
    }
    
    .chat-input .btn {
        padding: 0.5rem 0.75rem;
    }
}

/* Voice Input Styles */
.voice-status {
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background: var(--bs-light);
    border: 1px solid var(--bs-border-color);
}

/* Message Actions Styles */
.message-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.3rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.message:hover .message-actions {
    opacity: 1;
}

.message-actions .btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}

/* Follow-up questions styling */
.follow-up-questions {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 0.5rem;
    border-left: 3px solid #0d6efd;
}

.follow-up-questions strong {
    color: #0d6efd;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.follow-up-question-btn {
    display: block;
    width: 100%;
    margin: 0.4rem 0;
    padding: 0.6rem 1rem;
    background-color: rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.3);
    border-radius: 0.4rem;
    color: #fff;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.follow-up-question-btn:hover {
    background-color: rgba(13, 110, 253, 0.2);
    border-color: rgba(13, 110, 253, 0.5);
    transform: translateY(-1px);
}

.follow-up-question-btn:active {
    transform: translateY(0);
}
