/* Shanganagh Concierge Widget Styles */

#mki-concierge-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#mki-concierge-widget.position-bottom-right {
    bottom: 20px;
    right: 20px;
}

#mki-concierge-widget.position-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Chat Button */
.mki-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--mki-primary, #2C5F2D);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    position: relative;
}

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

.mki-chat-button svg {
    width: 28px;
    height: 28px;
}

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

/* Chat Window */
.mki-chat-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.position-bottom-right .mki-chat-window {
    right: 0;
}

.position-bottom-left .mki-chat-window {
    left: 0;
}

/* Header */
.mki-chat-header {
    background: var(--mki-primary, #2C5F2D);
    color: var(--mki-header-text, white);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: white;
    padding: 4px;
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
    color: inherit;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.close-button {
    background: transparent;
    border: none;
    color: var(--mki-header-text, white);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Messages Container */
.mki-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.mki-messages::-webkit-scrollbar {
    width: 6px;
}

.mki-messages::-webkit-scrollbar-track {
    background: transparent;
}

.mki-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

/* Messages */
.message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

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

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

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

.message.user .message-content {
    background: var(--mki-user-bg, #2C5F2D);
    color: var(--mki-user-text, white);
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: var(--mki-assistant-bg, white);
    color: var(--mki-assistant-text, #1F2937);
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin: 0 0 8px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Sponsor Cards */
.sponsor-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.sponsor-card {
    background: white;
    border: 1px solid var(--mki-accent, #C9A961);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.sponsor-card:hover {
    border-color: var(--mki-primary, #2C5F2D);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sponsor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.sponsor-card-name {
    font-weight: 600;
    color: var(--mki-primary, #2C5F2D);
    font-size: 14px;
}

.sponsor-card-category {
    font-size: 11px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sponsor-card-description {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.4;
}

/* Input Area */
.mki-input-area {
    border-top: 1px solid #e2e8f0;
    background: white;
}

.mki-footer {
    padding: 8px 16px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    background: #f8f9fa;
}

.mki-footer small {
    font-size: 11px;
    color: #718096;
    line-height: 1.4;
}

.mki-footer a {
    color: var(--mki-primary, #2C5F2D);
    text-decoration: none;
}

.mki-footer a:hover {
    text-decoration: underline;
}

.input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 16px;
}

#mki-message-input {
    flex: 1;
    border: 1px solid #cbd5e0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    outline: none;
    transition: border-color 0.2s;
}

#mki-message-input:focus {
    border-color: var(--mki-primary, #2C5F2D);
}

.send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--mki-primary, #2C5F2D);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-button:hover:not(:disabled) {
    background: var(--mki-accent, #C9A961);
    transform: scale(1.05);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mki-primary, #2C5F2D);
    animation: typing 1.4s ease-in-out 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% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .mki-chat-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        left: 0 !important;
        right: 0 !important;
        border-radius: 0;
    }
    
    #mki-concierge-widget.position-bottom-right,
    #mki-concierge-widget.position-bottom-left {
        bottom: 20px;
        right: 20px;
        left: auto;
    }
}

/* Loading State */
.message.loading .message-content {
    background: #f1f1f1;
    color: #666;
    font-style: italic;
}

/* Error State */
.message.error .message-content {
    background: #fee;
    border-color: #fcc;
    color: #c33;
}

/* DART Times Card */
.dart-card {
    background: white;
    border: 2px solid var(--mki-primary, #2C5F2D);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    max-width: 90%;
}

.dart-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.dart-icon {
    font-size: 28px;
}

.dart-route {
    flex: 1;
}

.dart-route strong {
    font-size: 16px;
    color: var(--mki-primary, #2C5F2D);
}

.journey-time {
    font-size: 13px;
    color: #718096;
}

.dart-times {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dart-time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.dart-time-row .time {
    font-weight: 600;
    font-size: 15px;
    color: var(--mki-primary, #2C5F2D);
}

.dart-time-row .due-in {
    font-size: 14px;
    color: #4a5568;
}

.dart-time-row .status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #d4edda;
    color: #155724;
}

.dart-time-row .status.delayed {
    background: #f8d7da;
    color: #721c24;
}

.dart-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.dart-footer a {
    color: var(--mki-primary, #2C5F2D);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.dart-footer a:hover {
    text-decoration: underline;
}

.dart-card.error {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    #mki-concierge-widget.position-bottom-right {
        bottom: 0;
        right: 0;
        left: 0;
    }
    
    #mki-concierge-widget.position-bottom-left {
        bottom: 0;
        left: 0;
        right: 0;
    }
    
    .mki-chat-button {
        position: fixed;
        bottom: 15px;
        right: 15px;
        z-index: 999999;
    }
    
    .mki-chat-window {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    
    .mki-chat-header {
        border-radius: 0 !important;
    }
    
    .mki-messages {
        height: calc(100vh - 160px) !important;
    }
    
    .mki-input-area {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    
    /* Make sponsor cards stack on mobile */
    .sponsor-cards {
        flex-direction: column;
    }
    
    .sponsor-card {
        max-width: 100% !important;
    }
    
    /* DART card mobile optimization */
    .dart-card {
        max-width: 100%;
    }
    
    .dart-time-row {
        flex-wrap: wrap;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .mki-chat-button {
        width: 56px;
        height: 56px;
        bottom: 12px;
        right: 12px;
    }
    
    .mki-chat-button svg {
        width: 24px;
        height: 24px;
    }
    
    .mki-chat-header {
        padding: 12px 16px;
    }
    
    .header-logo {
        width: 36px;
        height: 36px;
    }
    
    .header-text h3 {
        font-size: 16px;
    }
    
    .status-indicator {
        font-size: 12px;
    }
    
    .message-content {
        font-size: 15px;
    }
    
    .input-container {
        padding: 12px;
    }
    
    #mki-message-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}


/* Message labels */
.message-meta{font-size:11px;opacity:.7;margin:0 0 6px 2px;}
.message.user .message-meta{text-align:right;margin:0 2px 6px 0;}

/* ------------------------------
   In-chat cards (weather, sports, site search, table enquiry)
------------------------------ */
.mki-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
    margin: 10px 0 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.mki-card-title {
    font-weight: 700;
    font-size: 13px;
    margin: 0 0 8px;
    color: #0f172a;
}

.mki-card-sub {
    font-size: 13px;
    color: #334155;
}

.mki-card-foot {
    margin-top: 10px;
    font-size: 11px;
    color: #64748b;
}

.mki-weather-temp {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    margin: 2px 0 6px;
    color: #0f172a;
}

.mki-weather-desc {
    font-size: 13px;
    color: #334155;
    margin-bottom: 2px;
}

.mki-weather-meta {
    font-size: 12px;
    color: #64748b;
}

.mki-sports-list {
    margin: 0;
    padding: 0 0 0 16px;
}

.mki-sports-list li {
    margin: 6px 0;
    font-size: 13px;
    color: #0f172a;
}

.mki-sports-league {
    color: #64748b;
}
