/* Chatbot Container Styles */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 750px;
    max-height: calc(100vh - 40px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    transform: translateY(calc(100% + 20px));
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.chatbot-container.open {
    transform: translateY(0);
    opacity: 1;
}

/* Floating Button */
.chatbot-float-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.chatbot-float-btn.hidden {
    display: none;
}

.chatbot-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #EF4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-toggle {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.chatbot-toggle:hover {
    opacity: 1;
}

/* Body */
.chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #F9FAFB;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Messages */
.message {
    display: flex;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

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

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
}

.message.bot .message-content {
    background: white;
    color: #1F2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message.user .message-content {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    color: white;
}

.message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9CA3AF;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
.chatbot-input-area {
    border-top: 1px solid #E5E7EB;
    background: white;
    padding: 16px;
}

.chatbot-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.menu-button {
    padding: 10px 16px;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    color: #1F2937;
    transition: all 0.2s ease;
    font-weight: 500;
    width: 100%;
}

.menu-button-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #1F2937;
    width: 20px;
    height: 20px;
}

.menu-button-icon svg {
    width: 100%;
    height: 100%;
}

.menu-button-text {
    flex: 1;
}

.menu-button:hover {
    border-color: #1F2937;
    background: #F9FAFB;
    transform: translateX(4px);
}

.menu-button:hover .menu-button-icon {
    color: #111827;
}

.menu-button:active {
    transform: translateX(2px);
}

.chatbot-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

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

.chatbot-send-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.chatbot-send-btn:hover {
    transform: scale(1.05);
}

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

/* Options/Buttons in Messages */
.message-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.option-button {
    padding: 10px 14px;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    color: #1F2937;
    transition: all 0.2s ease;
}

.option-button:hover {
    background: #E5E7EB;
    border-color: #1F2937;
}

.option-button-back {
    background: #FEF3C7 !important;
    border-color: #F59E0B !important;
    color: #92400E !important;
    font-weight: 600;
}

.option-button-back:hover {
    background: #FDE68A !important;
    border-color: #D97706 !important;
}

/* Action Buttons Styles */
.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.action-button {
    padding: 10px 18px;
    background: #3B82F6;
    border: 1px solid #2563EB;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: white;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 120px;
}

.action-button:hover {
    background: #2563EB;
    border-color: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.action-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.action-button.selected {
    background: #1D4ED8;
    border-color: #1E40AF;
}

.action-button.action-button-back {
    background: #F3F4F6;
    border-color: #E5E7EB;
    color: #1F2937;
}

.action-button.action-button-back:hover {
    background: #E5E7EB;
    border-color: #D1D5DB;
    color: #111827;
}

.action-button.action-button-back.selected {
    background: #D1D5DB;
    border-color: #9CA3AF;
}

/* Accessories Table Styles */
.accessories-table-container {
    margin-top: 12px;
    overflow-x: auto;
}

.accessories-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.accessories-table thead {
    background: #F3F4F6;
}

.accessories-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #1F2937;
    border-bottom: 2px solid #E5E7EB;
    font-size: 12px;
}

.accessories-table tbody tr {
    border-bottom: 1px solid #E5E7EB;
    transition: background-color 0.2s ease;
}

.accessories-table tbody tr:hover {
    background: #F9FAFB;
    cursor: pointer;
}

.accessories-table tbody tr.selected {
    background: #EFF6FF;
    border-left: 3px solid #3B82F6;
}

.accessories-table td {
    padding: 10px 8px;
    color: #1F2937;
}

.accessory-title {
    font-weight: 500;
    color: #111827;
}

.accessory-price {
    font-weight: 600;
    color: #059669;
    text-align: right;
    white-space: nowrap;
}

.accessories-table-back-button {
    margin-top: 12px;
    width: 100%;
}

.accessories-table-back-button .action-button {
    width: 100%;
    min-width: auto;
    padding: 10px 16px;
}

/* Calendar Styles */
.calendar-container {
    margin-top: 12px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 12px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.calendar-day:hover:not(.disabled):not(.selected) {
    background: #F3F4F6;
}

.calendar-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-day.selected {
    background: #1F2937;
    color: white;
    border-color: #1F2937;
}

.calendar-day.today {
    border-color: #1F2937;
    font-weight: bold;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.time-slot {
    padding: 10px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    transition: all 0.2s ease;
}

.time-slot:hover:not(.disabled):not(.selected) {
    border-color: #1F2937;
    background: #F9FAFB;
}

.time-slot.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.time-slot.selected {
    background: #1F2937;
    color: white;
    border-color: #1F2937;
}

/* Vehicle Card */
.vehicle-card {
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    background: white;
}

.vehicle-card-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #1F2937;
}

.vehicle-card-details {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 8px;
}

.vehicle-card-price {
    font-weight: 600;
    font-size: 14px;
    color: #1F2937;
}

.vehicle-card-link {
    display: inline-block;
    margin-top: 8px;
    color: #1F2937;
    text-decoration: underline;
    font-size: 12px;
}

/* Contact Form */
.contact-form {
    margin-top: 12px;
}

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

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: #1F2937;
}

.form-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-top: 8px;
}

.form-submit:hover {
    transform: scale(1.02);
}

.form-submit:active {
    transform: scale(0.98);
}

/* Click to Call */
.call-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #10B981;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease;
    margin-top: 8px;
}

.call-button svg {
    flex-shrink: 0;
}

.call-button:hover {
    background: #059669;
}

.call-button:active {
    transform: scale(0.98);
}

/* Footer */
.chatbot-footer {
    border-top: 1px solid #E5E7EB;
    background: white;
    padding: 10px 16px 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chatbot-footer-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.text-size-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}

.footer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #1F2937;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.footer-btn:hover {
    background: #E5E7EB;
    border-color: #1F2937;
}

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

.zoom-btn {
    min-width: 36px;
    padding: 8px;
}

.back-to-menu-btn {
    flex: 1;
    font-weight: 500;
}

.back-to-menu-btn span {
    font-size: 13px;
}

/* Footer Branding */
.chatbot-footer-branding {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 4px;
    margin-top: 2px;
    border-top: 1px solid #F3F4F6;
}

.snc-logo {
    max-width: 80px;
    max-height: 24px;
    height: auto;
    object-fit: contain;
}

.powered-by-text {
    margin: 0;
    font-size: 9px;
    color: #9CA3AF;
    font-weight: 400;
    text-align: center;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* Text Size Classes */
.chatbot-container.text-size-small {
    font-size: 12px;
}

.chatbot-container.text-size-small .message-content {
    font-size: 12px;
}

.chatbot-container.text-size-small .menu-button,
.chatbot-container.text-size-small .option-button {
    font-size: 12px;
    padding: 10px 12px;
}

.chatbot-container.text-size-medium {
    font-size: 14px;
}

.chatbot-container.text-size-medium .message-content {
    font-size: 14px;
}

.chatbot-container.text-size-large {
    font-size: 16px;
}

.chatbot-container.text-size-large .message-content {
    font-size: 16px;
}

.chatbot-container.text-size-large .menu-button,
.chatbot-container.text-size-large .option-button {
    font-size: 16px;
    padding: 14px 18px;
}

.chatbot-container.text-size-xlarge {
    font-size: 18px;
}

.chatbot-container.text-size-xlarge .message-content {
    font-size: 18px;
}

.chatbot-container.text-size-xlarge .menu-button,
.chatbot-container.text-size-xlarge .option-button {
    font-size: 18px;
    padding: 16px 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 20px);
        max-width: 100%;
    }
    
    .chatbot-footer-controls {
        flex-wrap: wrap;
    }
    
    .back-to-menu-btn {
        flex: 1 1 100%;
        margin-top: 8px;
    }
    
    .text-size-controls {
        order: -1;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chatbot-container.open {
        transform: translateY(0);
    }
    
    .chatbot-footer {
        padding: 10px 12px;
    }
    
    .footer-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .back-to-menu-btn span {
        font-size: 12px;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 1024px) {
    .chatbot-container {
        width: 420px;
    }
}

/* Large screens */
@media (min-width: 1025px) {
    .chatbot-container {
        width: 380px;
    }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    .footer-btn,
    .menu-button,
    .option-button {
        min-height: 44px; /* Minimum touch target size */
    }
    
    .chatbot-input,
    .chatbot-send-btn {
        min-height: 44px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .chatbot-container {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Scrollbar */
.chatbot-body::-webkit-scrollbar {
    width: 6px;
}

.chatbot-body::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-body::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.chatbot-body::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}
