/* GPT-5 Pro Chatbot Frontend Styles */

#gpt5-chatbot-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    z-index: 999999;
}

/* Floating Button */
.gpt5-chatbot-button {
    position: fixed;
    width: 60px;
    height: 60px;
    background: #007cba;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1000000;
    color: white;
}

.gpt5-chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.gpt5-chatbot-button.square {
    border-radius: 12px;
}

.gpt5-chatbot-button.bottom-right {
    bottom: 20px;
    right: 20px;
}

.gpt5-chatbot-button.bottom-left {
    bottom: 20px;
    left: 20px;
}

.gpt5-chatbot-button.bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.gpt5-chatbot-button.bottom-center:hover {
    transform: translateX(-50%) scale(1.1);
}

.gpt5-chatbot-button-text {
    display: none;
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
}

.gpt5-chatbot-button:hover .gpt5-chatbot-button-text {
    display: block;
}

/* Chat Window */
.gpt5-chatbot-window {
    position: fixed;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    z-index: 1000001;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.gpt5-chatbot-window.bottom-right {
    bottom: 90px;
    right: 20px;
}

.gpt5-chatbot-window.bottom-left {
    bottom: 90px;
    left: 20px;
}

.gpt5-chatbot-window.bottom-center {
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
}

/* Header */
.gpt5-chatbot-header {
    background: #007cba;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.gpt5-chatbot-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gpt5-chatbot-status {
    font-size: 11px;
    opacity: 0.8;
}

.gpt5-chatbot-controls {
    display: flex;
    gap: 4px;
}

.gpt5-chatbot-control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.gpt5-chatbot-control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Messages Area */
.gpt5-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
}

.gpt5-chatbot-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

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

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

.gpt5-chatbot-message-content {
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
}

.gpt5-chatbot-message-user .gpt5-chatbot-message-content {
    background: #007cba;
    color: white;
    border-bottom-right-radius: 6px;
}

.gpt5-chatbot-message-bot .gpt5-chatbot-message-content {
    background: white;
    color: #333;
    border: 1px solid #e1e5e9;
    border-bottom-left-radius: 6px;
}

.gpt5-chatbot-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    max-width: 80%;
    align-self: flex-start;
}

.gpt5-chatbot-typing-dots {
    display: flex;
    gap: 3px;
}

.gpt5-chatbot-typing-dot {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: gpt5-chatbot-typing 1.4s infinite ease-in-out;
}

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

@keyframes gpt5-chatbot-typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

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

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

#gpt5-chatbot-input {
    flex: 1;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    padding: 10px 16px;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    max-height: 100px;
    min-height: 40px;
}

#gpt5-chatbot-input:focus {
    border-color: #007cba;
}

#gpt5-chatbot-send {
    background: #007cba;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
}

#gpt5-chatbot-send:hover:not(:disabled) {
    background: #005a87;
    transform: scale(1.05);
}

#gpt5-chatbot-send:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.gpt5-chatbot-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
    color: #666;
}


.gpt5-chatbot-privacy-notice {
    opacity: 0.7;
}

/* Error Modal */
.gpt5-chatbot-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000002;
}

.gpt5-chatbot-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gpt5-chatbot-modal-header {
    background: #f8f9fa;
    padding: 16px 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.gpt5-chatbot-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

#gpt5-chatbot-error-list {
    margin-bottom: 20px;
}

.gpt5-chatbot-error-entry {
    padding: 12px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-left: 4px solid #dc3545;
}

.gpt5-chatbot-error-entry.api {
    border-left-color: #dc3545;
}

.gpt5-chatbot-error-entry.network {
    border-left-color: #fd7e14;
}

.gpt5-chatbot-error-entry.warning {
    border-left-color: #ffc107;
}

.gpt5-chatbot-error-entry.other {
    border-left-color: #6c757d;
}

.gpt5-chatbot-error-time {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.gpt5-chatbot-error-message {
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
    font-weight: 500;
}

.gpt5-chatbot-error-context {
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #e9ecef;
}

#gpt5-chatbot-error-summary {
    background: #f1f3f4;
    border: 1px solid #d1ecf1;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 12px;
    color: #0c5460;
}

.gpt5-chatbot-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.gpt5-chatbot-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .gpt5-chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        max-width: none;
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        transform: none !important;
    }
    
    .gpt5-chatbot-button {
        width: 56px;
        height: 56px;
    }
    
    .gpt5-chatbot-button.bottom-right {
        bottom: 16px;
        right: 16px;
    }
    
    .gpt5-chatbot-button.bottom-left {
        bottom: 16px;
        left: 16px;
    }
    
    .gpt5-chatbot-button.bottom-center {
        bottom: 16px;
    }
    
    .gpt5-chatbot-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .gpt5-chatbot-message {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .gpt5-chatbot-window {
        width: calc(100vw - 10px);
        height: calc(100vh - 80px);
        left: 5px !important;
        right: 5px !important;
        bottom: 5px !important;
    }
    
    .gpt5-chatbot-messages {
        padding: 12px;
    }
    
    .gpt5-chatbot-input-area {
        padding: 8px 12px;
    }
}

/* Animation for button appearance */
@keyframes gpt5-chatbot-fade-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gpt5-chatbot-button.fade-in {
    animation: gpt5-chatbot-fade-in 0.3s ease-out;
}

/* Animation for window appearance */
@keyframes gpt5-chatbot-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gpt5-chatbot-window.slide-up {
    animation: gpt5-chatbot-slide-up 0.3s ease-out;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gpt5-chatbot-button {
        border: 2px solid #000;
    }
    
    .gpt5-chatbot-window {
        border: 2px solid #000;
    }
    
    .gpt5-chatbot-message-content {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .gpt5-chatbot-button,
    .gpt5-chatbot-control-btn,
    #gpt5-chatbot-send,
    .gpt5-chatbot-btn {
        transition: none;
    }
    
    .gpt5-chatbot-typing-dot {
        animation: none;
    }
    
    .gpt5-chatbot-button.fade-in,
    .gpt5-chatbot-window.slide-up {
        animation: none;
    }
}

/* Contact Buttons integrated into Chat Window */
.gpt5-chatbot-contact-buttons {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e1e5e9;
    background: #f8f9fa;
    flex-wrap: nowrap;
    justify-content: center;
    overflow-x: auto;
}

.gpt5-contact-position-right-side {
    flex-direction: column;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    border-top: none;
    border-left: 1px solid #e1e5e9;
    padding: 8px;
    gap: 6px;
}

.gpt5-contact-position-left-side {
    flex-direction: column;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    border-top: none;
    border-right: 1px solid #e1e5e9;
    padding: 8px;
    gap: 6px;
}

.gpt5-contact-position-bottom {
    flex-direction: row;
    position: relative;
}

.gpt5-chatbot-contact-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 70px;
    justify-content: center;
}

.gpt5-chatbot-contact-btn:hover {
    background: #1ea952;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.gpt5-chatbot-contact-btn:active {
    transform: translateY(0);
}

.gpt5-chatbot-contact-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.gpt5-chatbot-contact-btn[data-action="email"] {
    background: #007cba;
}

.gpt5-chatbot-contact-btn[data-action="email"]:hover {
    background: #005a87;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.gpt5-chatbot-contact-btn[data-action="call"] {
    background: #dc3545;
}

.gpt5-chatbot-contact-btn[data-action="call"]:hover {
    background: #c82333;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}


.gpt5-chatbot-contact-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.gpt5-chatbot-contact-btn span {
    font-size: 11px;
    font-weight: 500;
}

/* Contact Form Modal styles (reuse existing modal styles) */
.gpt5-contact-consent-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.gpt5-contact-form-group {
    margin-bottom: 16px;
}

.gpt5-contact-form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #333;
}

.gpt5-contact-form-group input,
.gpt5-contact-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.gpt5-contact-form-group input:focus,
.gpt5-contact-form-group textarea:focus {
    outline: none;
    border-color: #25D366;
}

.gpt5-contact-form-group input.error,
.gpt5-contact-form-group textarea.error {
    border-color: #dc3545;
}

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

.gpt5-contact-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.gpt5-contact-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.gpt5-contact-btn-primary,
.gpt5-contact-btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.gpt5-contact-btn-primary {
    background: #25D366;
    color: white;
}

.gpt5-contact-btn-primary:hover:not(:disabled) {
    background: #1ea952;
}

.gpt5-contact-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

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

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

/* Position-specific styles for side positions */
.gpt5-contact-position-right-side .gpt5-chatbot-contact-btn,
.gpt5-contact-position-left-side .gpt5-chatbot-contact-btn {
    min-width: 50px;
    padding: 6px 8px;
    font-size: 10px;
}

.gpt5-contact-position-right-side .gpt5-chatbot-contact-btn span,
.gpt5-contact-position-left-side .gpt5-chatbot-contact-btn span {
    display: none;
}

.gpt5-contact-position-right-side .gpt5-chatbot-contact-btn svg,
.gpt5-contact-position-left-side .gpt5-chatbot-contact-btn svg {
    width: 18px;
    height: 18px;
}

/* Mobile responsive for integrated contact buttons */
@media (max-width: 768px) {
    .gpt5-chatbot-contact-buttons {
        padding: 10px 12px;
        gap: 6px;
    }
    
    .gpt5-chatbot-contact-btn {
        padding: 6px 8px;
        font-size: 11px;
        min-width: 60px;
    }
    
    .gpt5-chatbot-contact-btn span {
        font-size: 10px;
    }
    
    .gpt5-chatbot-contact-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .gpt5-chatbot-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .gpt5-contact-position-right-side,
    .gpt5-contact-position-left-side {
        position: relative;
        flex-direction: row;
        transform: none;
        top: auto;
        left: auto;
        right: auto;
        border: none;
        border-top: 1px solid #e1e5e9;
    }
}

@media (max-width: 480px) {
    .gpt5-chatbot-contact-buttons {
        flex-direction: row;
        gap: 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .gpt5-chatbot-contact-btn {
        min-width: 50px;
        padding: 4px 6px;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .gpt5-chatbot-contact-btn span {
        display: none;
    }
    
    .gpt5-chatbot-modal-body {
        padding: 15px;
    }
    
    .gpt5-contact-form-actions {
        flex-direction: column;
    }
    
    .gpt5-contact-btn-primary,
    .gpt5-contact-btn-secondary {
        width: 100%;
    }
}

/* High contrast mode support for integrated contact buttons */
@media (prefers-contrast: high) {
    .gpt5-chatbot-contact-buttons {
        border-top: 2px solid #000;
    }
    
    .gpt5-chatbot-contact-btn {
        border: 2px solid #000;
    }
    
    .gpt5-chatbot-modal-content {
        border: 2px solid #000;
    }
}

/* Reduced motion support for integrated contact buttons */
@media (prefers-reduced-motion: reduce) {
    .gpt5-chatbot-contact-btn,
    .gpt5-contact-btn-primary,
    .gpt5-contact-btn-secondary {
        transition: none;
    }
}
