/**
 * ═══════════════════════════════════════════════════════════════
 * AI Concierge - Styles
 * Developed by Toni Sciacca - mail@tonisciacca.com
 * ═══════════════════════════════════════════════════════════════
 */

:root {
    --ai-primary: #FF385C;
    --ai-primary-dark: #E31C5F;
    --ai-primary-rgb: 255, 56, 92;
    --ai-accent: #FF385C;
    --ai-danger: #ef4444;
    --ai-warning: #FF385C;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 56, 92, 0.5); }
    50% { box-shadow: 0 0 0 12px rgba(255, 56, 92, 0); }
}

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

/* TRIGGER */
.ai-trigger {
    position: fixed; bottom: 24px; right: 24px;
    width: 60px; height: 60px;
    background: var(--ai-primary);
    border: none; border-radius: 50%; color: white; cursor: pointer;
    z-index: 9998; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 56, 92, 0.4); transition: all 0.3s ease;
}
.ai-trigger:hover { transform: scale(1.1); }
.ai-trigger i { width: 28px; height: 28px; }
.ai-trigger.hidden { transform: scale(0); opacity: 0; pointer-events: none; }

/* PANEL */
.ai-panel {
    position: fixed; top: 16px; right: 16px; bottom: 16px; width: 420px;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px);
    border-radius: 20px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    z-index: 9999; display: flex; flex-direction: column;
    transform: translateX(calc(100% + 32px)); transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.ai-panel.active { transform: translateX(0); }

/* FULLSCREEN - mit Abstand wie normaler Panel */
.ai-panel.fullscreen {
    top: 16px;
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
    border-radius: 20px;
    flex-direction: row;
}
.ai-panel.fullscreen .ai-chat-side { width: 400px; min-width: 400px; border-left: 1px solid rgba(0,0,0,0.08); order: 2; }
.ai-panel.fullscreen .ai-map-side { display: flex; flex: 1; order: 1; }

/* CHAT SIDE */
.ai-chat-side { display: flex; flex-direction: column; height: 100%; width: 100%; }

/* MAP SIDE */
.ai-map-side { display: none; flex-direction: column; background: #f8fafc; }
.ai-map-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: white; border-bottom: 1px solid rgba(0,0,0,0.08); }
.ai-map-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.ai-map-title i { color: var(--ai-primary); }
.ai-map-exit { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: #f1f5f9; border: none; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.ai-map-exit:hover { background: var(--ai-danger); color: white; }
.ai-map-content { display: flex; flex: 1; }
.ai-map-container { flex: 1; position: relative; }

/* DAYS PANEL */
.ai-days-panel { width: 320px; background: white; border-left: 1px solid rgba(0,0,0,0.08); display: flex; flex-direction: column; overflow: hidden; }
.ai-days-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.ai-days-header h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin: 0; }
.ai-days-header i { width: 18px; height: 18px; color: var(--ai-primary); }
.ai-days-count { font-size: 12px; color: #64748b; background: #f1f5f9; padding: 4px 10px; border-radius: 12px; }
.ai-days-list { flex: 1; overflow-y: auto; padding: 12px; }

/* DAY CARD */
.ai-day-card {
    display: flex; align-items: center; gap: 12px; padding: 14px; background: white;
    border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 10px;
    cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden;
}
.ai-day-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--day-color, var(--ai-primary)); }
.ai-day-card:hover { border-color: var(--day-color, var(--ai-primary)); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); transform: translateX(4px); }
.ai-day-card.active { border-color: var(--day-color, var(--ai-primary)); background: linear-gradient(90deg, rgba(255, 56, 92, 0.05) 0%, white 100%); box-shadow: 0 4px 16px rgba(255, 56, 92, 0.15); }
.ai-day-number { width: 36px; height: 36px; background: var(--day-color, var(--ai-primary)); color: white; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.ai-day-info { flex: 1; min-width: 0; }
.ai-day-title { font-weight: 600; font-size: 14px; color: #1e293b; margin-bottom: 2px; }
.ai-day-meta { font-size: 12px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-day-stats { display: flex; gap: 12px; margin-top: 6px; font-size: 11px; color: #64748b; }
.ai-day-stats span { display: flex; align-items: center; gap: 4px; }
.ai-day-stats i { width: 12px; height: 12px; }
.ai-day-arrow { color: #cbd5e1; transition: all 0.2s; }
.ai-day-card:hover .ai-day-arrow, .ai-day-card.active .ai-day-arrow { color: var(--day-color, var(--ai-primary)); transform: translateX(4px); }

/* HEADER */
.ai-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--ai-primary); color: white; }
.ai-avatar { width: 44px; height: 44px; background: rgba(255, 255, 255, 0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; }
.ai-avatar i { width: 24px; height: 24px; }
.ai-pulse { position: absolute; bottom: -2px; right: -2px; width: 12px; height: 12px; background: #10b981; border: 2px solid white; border-radius: 50%; }
.ai-header-info { flex: 1; }
.ai-name { font-weight: 600; font-size: 15px; display: block; }
.ai-status { font-size: 12px; opacity: 0.85; }
.ai-close {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.ai-close:hover {
    background: #fafafa;
    border-color: #aaa;
}
.ai-close i,
.ai-close svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}
.ai-close:hover i,
.ai-close:hover svg {
    transform: rotate(90deg);
}

/* PILLS */
.ai-pills-section { padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.ai-pills-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.ai-pills-clear { width: 24px; height: 24px; background: none; border: none; color: #64748b; cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.ai-pills-clear:hover { background: #fee2e2; color: var(--ai-danger); }
.ai-pills-clear i { width: 14px; height: 14px; }
.ai-pills { display: flex; flex-wrap: wrap; gap: 8px; min-height: 32px; }
.ai-pills-empty { font-size: 13px; color: #64748b; font-style: italic; }
.ai-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 500; animation: fadeIn 0.3s ease; }
.ai-pill-remove { cursor: pointer; opacity: 0.6; font-size: 16px; line-height: 1; }
.ai-pill-remove:hover { opacity: 1; }
.ai-pill.stadt { background: #dcfce7; color: #166534; }
.ai-pill.land { background: #dbeafe; color: #1e40af; }
.ai-pill.region { background: #f3e8ff; color: #7c3aed; }
.ai-pill.dauer { background: #e0e7ff; color: #3730a3; }
.ai-pill.personen { background: #fce7f3; color: #be185d; }
.ai-pill.unterkunft { background: #cffafe; color: #0e7490; }
.ai-pill.reiseart { background: #ffedd5; color: #c2410c; }

/* CHAT */
.ai-chat { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ai-message { display: flex; animation: fadeIn 0.3s ease; }
.ai-message.user { justify-content: flex-end; }
.ai-msg-bubble { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.ai-message.user .ai-msg-bubble { background: var(--ai-primary); color: white; border-bottom-right-radius: 4px; }
.ai-message.bot .ai-msg-bubble { background: #f1f5f9; color: #1e293b; border-bottom-left-radius: 4px; }

/* SUGGESTIONS */
.ai-suggestions { padding: 12px 16px; border-top: 1px solid rgba(0,0,0,0.08); max-height: 280px; overflow-y: auto; }
.ai-suggestions-header { font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 10px; text-transform: uppercase; }
.ai-suggestions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ai-suggestion-card { background: white; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; cursor: pointer; transition: all 0.2s; }
.ai-suggestion-card:hover { border-color: var(--ai-primary); box-shadow: 0 4px 16px rgba(255, 56, 92, 0.15); transform: translateY(-2px); }
.ai-suggestion-img { position: relative; height: 80px; background-size: cover; background-position: center; }
.ai-match-badge { position: absolute; top: 6px; right: 6px; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; color: white; }
.ai-match-badge.high { background: linear-gradient(135deg, var(--ai-accent) 0%, #059669 100%); }
.ai-match-badge.medium { background: linear-gradient(135deg, var(--ai-warning) 0%, #d97706 100%); }
.ai-match-badge.low { background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); }
.ai-suggestion-info { padding: 10px; }
.ai-suggestion-title { font-size: 13px; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-suggestion-meta { font-size: 11px; color: #64748b; margin-top: 2px; }

/* BUILD BUTTON */
.ai-build-section { padding: 12px 16px; }
.ai-build-btn {
    width: 100%; padding: 14px 28px; background: var(--ai-primary); color: white;
    border: none; border-radius: 50px; font-size: 15px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: all 0.2s;
}
.ai-build-btn:hover:not(:disabled) { background: var(--ai-primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 56, 92, 0.35); }
.ai-build-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ai-build-btn i { width: 20px; height: 20px; }

/* INPUT */
.ai-input-area { padding: 12px 16px 16px; border-top: 1px solid rgba(0,0,0,0.08); }
.ai-input-row { display: flex; gap: 8px; align-items: center; }
.ai-input-row input { flex: 1; padding: 12px 16px; border: 1px solid #e2e8f0; border-radius: 50px; font-size: 14px; background: #f8fafc; }
.ai-input-row input:focus { outline: none; border-color: var(--ai-primary); background: white; box-shadow: 0 0 0 3px rgba(255, 56, 92, 0.1); }
.ai-btn-voice, .ai-btn-send { width: 44px; height: 44px; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s; }
.ai-btn-voice { background: #f1f5f9; color: #64748b; }
.ai-btn-voice:hover { background: #e2e8f0; }
.ai-btn-voice.recording { background: var(--ai-danger); color: white; }
.ai-btn-send { background: var(--ai-primary); color: white; }
.ai-btn-send:hover { background: var(--ai-primary-dark); transform: scale(1.05); }
.ai-btn-voice i, .ai-btn-send i { width: 20px; height: 20px; }
.ai-quick-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.ai-frequent-section { margin-top: 10px; }
.ai-frequent-label {
    font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.2px; color: #c8c8cc; margin-bottom: 6px;
}
.ai-freq-pill {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 3px 10px; background: white;
    border: 1px solid #e2e8f0; border-radius: 50px;
    font-size: 0.65rem; font-weight: 500; color: #64748b;
    cursor: pointer; transition: all 0.18s; font-family: inherit;
    line-height: 1.2;
}
.ai-freq-pill .ai-fp-ico {
    width: 14px; height: 14px; flex-shrink: 0; margin-right: 5px;
}
.ai-freq-pill:hover {
    border-color: var(--ai-primary, #FF385C); color: var(--ai-primary, #FF385C);
    background: rgba(255, 56, 92, 0.05); transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 56, 92, 0.12);
}
.ai-freq-pill[data-cat="stadt"] i { color: #FF385C; }
.ai-freq-pill[data-cat="reiseart"] i { color: #8B5CF6; }
.ai-freq-pill[data-cat="dauer"] i { color: #3B82F6; }
.ai-freq-pill[data-cat="personen"] i { color: #22C55E; }
.ai-freq-pill[data-cat="land"] i { color: #F59E0B; }
.ai-freq-used {
    background: rgba(255, 56, 92, 0.08); border-color: var(--ai-primary, #FF385C);
    color: var(--ai-primary, #FF385C); opacity: 0.6; pointer-events: none;
}

/* MAP MARKERS */
.ai-day-marker { background: transparent !important; border: none !important; }
.ai-day-marker > div { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); border: 3px solid white; }
.ai-poi-marker { background: transparent !important; border: none !important; }
.ai-poi-marker > div { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 600; font-size: 11px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); border: 2px solid white; }
.ai-poi-popup { min-width: 180px; }
.ai-poi-popup strong { display: block; margin-bottom: 4px; }
.ai-poi-popup p { font-size: 12px; color: #64748b; margin: 4px 0; }

/* TRIP CARD STYLES */
.trip-card .card-badge.trip-badge { background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary) 100%); }
.card-desc { font-size: 12px; color: #64748b; margin-top: 8px; line-height: 1.4; }
.empty-state { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: #666; }
.empty-state i { width: 48px; height: 48px; margin-bottom: 16px; display: block; margin-left: auto; margin-right: auto; color: #94a3b8; }
.empty-state h3 { margin-bottom: 8px; color: #333; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .ai-panel { width: 100%; top: 0; right: 0; bottom: 0; border-radius: 0; }
    .ai-panel.fullscreen .ai-chat-side { display: none; }
    .ai-panel.fullscreen .ai-days-panel { width: 100%; position: absolute; bottom: 0; left: 0; right: 0; max-height: 40%; border-radius: 20px 20px 0 0; border-left: none; border-top: 1px solid rgba(0,0,0,0.08); }
    .ai-suggestions-grid { grid-template-columns: 1fr; }
}
