/**
 * Victorian Paragliding Chatbot - CSS Styles
 */

/* Icons (using CSS sprites or replace with your icon font) */
.vpc-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Basic icon classes - replace with actual icons */
.vpc-icon-chat::before { content: "💬"; }
.vpc-icon-minus::before { content: "−"; }
.vpc-icon-times::before { content: "✕"; }
.vpc-icon-paper-plane::before { content: "➤"; }
.vpc-icon-thumbs-up::before { content: "👍"; }
.vpc-icon-thumbs-down::before { content: "👎"; }
.vpc-icon-cloud::before { content: "☁"; }
.vpc-icon-map-marker::before { content: "📍"; }
.vpc-icon-calendar::before { content: "📅"; }
.vpc-icon-exclamation-triangle::before { content: "⚠"; }

/* Main widget container */
.vpc-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

/* SkyHigh AI header title */
.vpc-chat-header h3 {
    font-size: 16px !important;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

/* Chat bubble and status indicator */
.vpc-chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e88e5, #1976d2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999999;
}

.vpc-chat-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 136, 229, 0.4);
}

.vpc-chat-bubble.vpc-offline {
    background: linear-gradient(135deg, #757575, #616161);
    cursor: not-allowed;
    opacity: 0.7;
}

.vpc-chat-bubble.vpc-offline:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(117, 117, 117, 0.3);
}

.vpc-chat-icon {
    color: white;
    font-size: 24px;
}

/* Status indicator dot */
.vpc-status-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4caf50;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

.vpc-status-indicator.offline {
    background: #f44336;
    animation: none;
}

.vpc-status-indicator.checking {
    background: #ff9800;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Toggle button */
.vpc-chat-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e88e5, #1976d2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    font-size: 24px;
}

.vpc-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 136, 229, 0.4);
}

.vpc-chat-toggle.vpc-active {
    background: linear-gradient(135deg, #43a047, #388e3c);
    transform: rotate(180deg);
}

/* Notification badge */
.vpc-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f44336;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chat window */
.vpc-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.vpc-chat-window.vpc-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.vpc-chat-header {
    background: linear-gradient(135deg, #1e88e5, #1976d2);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vpc-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.vpc-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vpc-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    animation: vpc-pulse 2s infinite;
}

@keyframes vpc-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.vpc-header-actions {
    display: flex;
    gap: 8px;
}

.vpc-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vpc-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.vpc-btn-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
}

/* Chat body */
.vpc-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vpc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

.vpc-messages::-webkit-scrollbar {
    width: 6px;
}

.vpc-messages::-webkit-scrollbar-track {
    background: #f1f3f4;
}

.vpc-messages::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 3px;
}

.vpc-messages::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}

/* Messages */
.vpc-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vpc-message-user {
    align-items: flex-end;
}

.vpc-message-bot,
.vpc-message-system {
    align-items: flex-start;
}

.vpc-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.vpc-message-user .vpc-message-content {
    background: #1e88e5;
    color: white;
    border-bottom-right-radius: 6px;
}

.vpc-message-bot .vpc-message-content {
    background: #f1f3f4;
    color: #202124;
    border-bottom-left-radius: 6px;
}

.vpc-message-system .vpc-message-content {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    font-style: italic;
}

.vpc-message-content p {
    margin: 0 0 8px 0;
}

.vpc-message-content p:last-child {
    margin-bottom: 0;
}

.vpc-message-content a {
    color: inherit;
    text-decoration: underline;
}

.vpc-message-user .vpc-message-content a {
    color: #bbdefb;
}

.vpc-message-time {
    font-size: 11px;
    color: #5f6368;
    padding: 0 16px;
}

.vpc-message-user .vpc-message-time {
    text-align: right;
}

/* Message actions */
.vpc-message-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    padding: 0 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.vpc-message:hover .vpc-message-actions {
    opacity: 1;
}

.vpc-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    color: #5f6368;
    font-size: 14px;
    transition: all 0.2s;
}

.vpc-action-btn:hover {
    background: #f1f3f4;
    color: #202124;
}

.vpc-action-btn.vpc-selected {
    background: #e8f0fe;
    color: #1e88e5;
}

/* Typing indicator */
.vpc-typing-indicator {
    padding: 16px 20px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #5f6368;
    font-size: 13px;
}

.vpc-typing-dots {
    display: flex;
    gap: 3px;
}

.vpc-typing-dots span {
    width: 6px;
    height: 6px;
    background: #5f6368;
    border-radius: 50%;
    animation: vpc-typing 1.4s infinite ease-in-out;
}

.vpc-typing-dots span:nth-child(1) { animation-delay: 0s; }
.vpc-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.vpc-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes vpc-typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Chat footer */
.vpc-chat-footer {
    border-top: 1px solid #e8eaed;
    background: white;
}

/* Quick actions */
.vpc-quick-actions {
    padding: 12px 16px 8px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.vpc-quick-actions::-webkit-scrollbar {
    display: none;
}

.vpc-quick-btn {
    background: #f8f9fa;
    border: 1px solid #dadce0;
    color: #3c4043;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.vpc-quick-btn:hover {
    background: #e8eaed;
    border-color: #bdc1c6;
}

.vpc-quick-btn:active {
    background: #e3f2fd;
    border-color: #1e88e5;
    color: #1e88e5;
}

/* Input area */
.vpc-input-area {
    padding: 16px;
}

.vpc-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #f8f9fa;
    border: 1px solid #dadce0;
    border-radius: 24px;
    padding: 4px 4px 4px 16px;
    transition: all 0.2s;
}

.vpc-input-wrapper:focus-within {
    border-color: #1e88e5;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.1);
}

#vpc-message-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.4;
    padding: 8px 0;
    min-height: 20px;
    max-height: 120px;
    font-family: inherit;
}

#vpc-message-input::placeholder {
    color: #5f6368;
}

.vpc-send-btn {
    background: #1e88e5;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 16px;
}

.vpc-send-btn:not(:disabled):hover {
    background: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.vpc-send-btn:disabled {
    background: #dadce0;
    color: #9aa0a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.vpc-input-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #5f6368;
}

.vpc-char-count.vpc-warning {
    color: #ea4335;
}

.vpc-location-status {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vpc-link-btn {
    background: none;
    border: none;
    color: #1e88e5;
    cursor: pointer;
    text-decoration: underline;
    font-size: inherit;
    padding: 0;
    margin-left: 4px;
}

.vpc-link-btn:hover {
    color: #1976d2;
}

/* Welcome message */
.vpc-welcome-message {
    margin-bottom: 20px;
}

.vpc-welcome-message .vpc-message-content {
    background: linear-gradient(135deg, #e3f2fd, #f1f8ff);
    border: 1px solid #bbdefb;
    color: #0d47a1;
}

/* Responsive design */
@media (max-width: 480px) {
    .vpc-chat-widget {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
    
    .vpc-chat-window {
        width: auto;
        height: 70vh;
        bottom: 80px;
        right: 0;
        left: 0;
    }
    
    .vpc-chat-toggle {
        position: fixed;
        bottom: 16px;
        right: 16px;
        left: auto;
        width: 56px;
        height: 56px;
    }
    
    .vpc-message-content {
        max-width: 85%;
    }
    
    .vpc-quick-actions {
        flex-wrap: wrap;
    }
    
    .vpc-quick-btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }
}

@media (max-width: 360px) {
    .vpc-chat-header {
        padding: 12px 16px;
    }
    
    .vpc-messages {
        padding: 16px;
    }
    
    .vpc-input-area {
        padding: 12px;
    }
    
    .vpc-header-info h3 {
        font-size: 14px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .vpc-chat-window {
        background: #2d2d30;
        color: #e8eaed;
    }
    
    .vpc-chat-footer {
        border-top-color: #3c4043;
    }
    
    .vpc-message-bot .vpc-message-content {
        background: #3c4043;
        color: #e8eaed;
    }
    
    .vpc-message-system .vpc-message-content {
        background: #3c4043;
        color: #fdd663;
        border-color: #5f6368;
    }
    
    .vpc-input-wrapper {
        background: #3c4043;
        border-color: #5f6368;
    }
    
    #vpc-message-input {
        color: #e8eaed;
    }
    
    #vpc-message-input::placeholder {
        color: #9aa0a6;
    }
    
    .vpc-quick-btn {
        background: #3c4043;
        border-color: #5f6368;
        color: #e8eaed;
    }
    
    .vpc-quick-btn:hover {
        background: #5f6368;
    }
    
    .vpc-messages::-webkit-scrollbar-track {
        background: #3c4043;
    }
    
    .vpc-messages::-webkit-scrollbar-thumb {
        background: #5f6368;
    }
}

/* Animation for smooth appearance */
.vpc-chat-widget * {
    box-sizing: border-box;
}

/* Print styles */
@media print {
    .vpc-chat-widget {
        display: none !important;
    }
}
