/* ============================================
   AI SIDEBAR STYLES - iOS 26 DESIGN SYSTEM
   Fluid Glassmorphism • Adaptive Colors • Spring Animations
   ============================================ */

/* NOTE: Main positioning moved to dashboard.css - uses Flexbox Push-Mode
   This file now only contains panel content styling */

/* Sidebar Panel (now direct child of .ai-sidebar) */
.ai-sidebar-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
}

/* Header - gleiche Höhe wie Webseiten-Header */
.ai-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 24px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
    box-sizing: border-box;
}

.ai-sidebar-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007AFF;
}

.ai-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

.ai-sidebar-title h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1d1d1f;
}

.ai-sidebar-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
}

.ai-sidebar-close svg {
    width: 18px;
    height: 18px;
    stroke: #1d1d1f;
}

.ai-sidebar-close:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: scale(1.08);
    border-color: rgba(0, 0, 0, 0.12);
}

/* Content Area */
.ai-sidebar-content {
    flex: 1;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

/* ============================================
   START SCREEN
   ============================================ */

.ai-start-screen {
    padding: 24px;
}

/* Building Info Card */
.ai-building-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    border-radius: 16px;
    color: white;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.ai-building-icon {
    font-size: 48px;
    line-height: 1;
}

.ai-building-details {
    flex: 1;
}

.ai-building-details h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.ai-building-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    opacity: 0.95;
}

.ai-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-meta-icon {
    font-size: 14px;
}

/* Divider */
.ai-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
    color: #999;
    font-size: 13px;
    font-weight: 500;
}

.ai-divider::before,
.ai-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: #e0e0e0;
}

.ai-divider::before { left: 0; }
.ai-divider::after { right: 0; }

.ai-divider span {
    background: #f8f9fa;
    padding: 0 12px;
    position: relative;
}

/* Action Buttons */
.ai-start-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.ai-action-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.ai-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 184, 217, 0.1), transparent);
    transition: left 0.5s;
}

.ai-action-btn:hover::before {
    left: 100%;
}

.ai-action-btn:hover {
    border-color: #007AFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.2);
}

.ai-action-btn.featured {
    border-color: #007AFF;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.05) 0%, #fff 100%);
}

.ai-action-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.ai-action-content {
    flex: 1;
}

.ai-action-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 15px;
}

.ai-action-desc {
    font-size: 13px;
    color: #666;
}

.ai-action-badge {
    background: #30D158;
    color: white;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.ai-action-arrow {
    color: #007AFF;
    font-size: 20px;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.25s;
    flex-shrink: 0;
}

.ai-action-btn:hover .ai-action-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Quick Category Pills */
.ai-quick-categories {
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
    margin: 0 -24px -24px;
    padding: 20px 24px 24px;
}

.ai-category-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    font-weight: 500;
}

.ai-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-pill {
    padding: 10px 16px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.ai-pill:hover {
    background: linear-gradient(135deg, #00b8d9 0%, #0077b6 100%);
    color: white;
    border-color: #00b8d9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 184, 217, 0.25);
}

/* ============================================
   LOADING & MESSAGE STATES
   ============================================ */

.ai-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
}

.ai-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ai-loading-text {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.ai-message-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
}

.ai-message-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ai-message-text {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

/* ============================================
   FLOATING BUTTON STATES
   ============================================ */

.ai-floating-btn {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
}

/* Notification Badge */
.ai-floating-btn.has-notification::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Hidden State (wenn Sidebar offen) */
.ai-floating-btn.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {

    .ai-building-card {
        flex-direction: column;
        text-align: center;
    }

    .ai-building-icon {
        font-size: 64px;
    }

    .ai-building-meta {
        justify-content: center;
    }

    .ai-action-btn {
        gap: 12px;
        padding: 16px;
    }

    .ai-action-icon {
        font-size: 28px;
    }

    .ai-category-pills {
        justify-content: center;
    }

    /* Schnellere Transitions auf Mobile */
    .ai-sidebar-panel {
        transition: transform 0.25s ease-out;
    }

    .ai-action-btn {
        transition: all 0.2s ease;
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    .ai-sidebar-panel,
    .ai-floating-btn,
    .ai-action-btn {
        transition: none;
    }

    .ai-action-btn::before {
        display: none;
    }
}

/* ============================================
   CHAT INTERFACE STYLES
   ============================================ */
/* HINWEIS: Chat-Styles sind in ai-chat.css mit höherer Specificity definiert */

/* ============================================
   BUILDING INFO BADGE (persistent unter Header)
   ============================================ */
.ai-building-info-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.75rem;
    color: #666;
    flex-shrink: 0;
}

.ai-building-info-badge .badge-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007AFF;
}

.ai-building-info-badge .badge-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
}

.ai-building-info-badge .badge-text {
    font-weight: 600;
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-building-info-badge .badge-separator {
    color: #d0d0d0;
    margin: 0 4px;
}

.ai-building-info-badge .badge-id {
    color: #999;
    font-weight: 500;
    white-space: nowrap;
}

/* ============================================
   PREMIUM START SCREEN (ki-assistent.html Style)
   ============================================ */

/* Container - zentriert & kein Scroll */
.ai-start-screen-premium {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    overflow: hidden;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

.welcome-content-sidebar {
    max-width: 420px;
    width: 100%;
    text-align: center;
}

/* Premium Badge mit Glow-Animation */
.premium-badge-sidebar {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    background: rgba(0, 184, 217, 0.08);
    border: 1px solid rgba(0, 184, 217, 0.2);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #0077b6;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.premium-badge-sidebar svg {
    color: #0077b6;
}

.badge-glow-sidebar {
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #00b8d9, #0077b6);
    border-radius: 20px;
    opacity: 0.3;
    filter: blur(8px);
    z-index: -1;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(1.05);
    }
}

/* Hero Title */
.hero-title-sidebar {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #333;
}

.gradient-text-sidebar {
    background: linear-gradient(135deg, #00b8d9, #0077b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Hero Subtitle */
.hero-subtitle-sidebar {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Feature Pills - Horizontal Layout */
.feature-pills-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.feature-pill-sidebar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.feature-pill-sidebar:hover {
    border-color: rgba(0, 122, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.15);
    background: white;
}

/* Recommended Pill (special styling) */
.feature-pill-recommended {
    border-color: rgba(0, 122, 255, 0.2);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.04) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.feature-pill-recommended:hover {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08) 0%, white 100%);
}

/* Pill Icon */
.pill-icon-sidebar {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08), rgba(88, 86, 214, 0.08));
    border-radius: 12px;
    color: #007AFF;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill-icon-sidebar svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
}

.feature-pill-sidebar:hover .pill-icon-sidebar {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white;
    transform: scale(1.05);
}

/* Pill Content */
.pill-content-sidebar {
    flex: 1;
    min-width: 0;
}

.pill-content-sidebar h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.01em;
}

.pill-content-sidebar p {
    font-size: 13px;
    color: #86868b;
    line-height: 1.4;
    margin: 0;
}

/* Pill Badge (Empfohlen) */
.pill-badge-sidebar {
    position: absolute;
    top: -8px;
    right: 12px;
    padding: 4px 10px;
    background: #30D158;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 12px rgba(48, 209, 88, 0.4);
}

/* Quick Categories - Card Design wie Feature Pills */
.quick-categories-sidebar {
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.categories-label-sidebar {
    font-size: 0.7rem;
    font-weight: 600;
    color: #999;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-pills-sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

/* Category Card - Gleiches Design wie Feature Pills, nur kleiner */
.category-pill-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-align: left;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.category-pill-card:hover {
    border-color: rgba(0, 122, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.12);
    background: white;
}

/* Category Icon - Kleinere Version */
.category-pill-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08), rgba(88, 86, 214, 0.08));
    border-radius: 10px;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #007AFF;
}

.category-pill-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
}

.category-pill-card:hover .category-pill-icon {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white;
    transform: scale(1.05);
}

/* Category Label */
.category-pill-label {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* ============================================
   CHAT HEADER - iOS 26 Fluid Glassmorphism
   Unterschiedliche Styles für Quick-Analyse vs. Freie Beratung
   ============================================ */

.ai-chat-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    position: relative;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.06), transparent);
}

/* Quick-Analyse Header - Blue Gradient */
.ai-chat-header-quick {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.12) 0%, rgba(94, 92, 230, 0.08) 100%);
}

/* Freie Beratung Header - Purple Gradient */
.ai-chat-header-free {
    background: linear-gradient(135deg, rgba(94, 92, 230, 0.12) 0%, rgba(175, 82, 222, 0.08) 100%);
}

.ai-chat-header-content {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

/* Icon Container */
.ai-chat-icon-container {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-chat-icon-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 0.5px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.ai-chat-icon-quick {
    background: linear-gradient(135deg, #007AFF 0%, #5E5CE6 100%);
    box-shadow:
        0 8px 24px -8px rgba(0, 122, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ai-chat-icon-free {
    background: linear-gradient(135deg, #5E5CE6 0%, #AF52DE 100%);
    box-shadow:
        0 8px 24px -8px rgba(94, 92, 230, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ai-chat-icon-container svg {
    width: 24px;
    height: 24px;
    stroke: white;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Header Text */
.ai-chat-header-text {
    flex: 1;
    min-width: 0;
}

.ai-chat-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #1d1d1f;
    line-height: 1.2;
}

.ai-chat-subtitle {
    margin: 2px 0 0 0;
    font-size: 13px;
    color: #86868b;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Back Button - iOS 26 Spring Animation (RECHTS im Header) */
.ai-chat-back-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.ai-chat-back-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: scale(1.08) translateX(2px);
    border-color: rgba(0, 0, 0, 0.12);
}

.ai-chat-back-btn svg {
    width: 20px;
    height: 20px;
    stroke: #1d1d1f;
}

/* Mobile Anpassungen */
@media (max-width: 480px) {
    .hero-title-sidebar {
        font-size: 1.5rem;
    }

    .feature-pills-sidebar {
        gap: 0.6rem;
    }

    .feature-pill-sidebar {
        padding: 0.85rem 1rem;
        gap: 0.75rem;
    }

    .pill-icon-sidebar {
        width: 36px;
        height: 36px;
    }

    .pill-content-sidebar h3 {
        font-size: 0.85rem;
    }

    .pill-content-sidebar p {
        font-size: 0.7rem;
    }

    /* Category Cards - Stack auf Mobile */
    .category-pills-sidebar {
        grid-template-columns: 1fr;
    }

    .category-pill-card {
        padding: 0.7rem 0.85rem;
    }

    .category-pill-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .category-pill-label {
        font-size: 0.75rem;
    }
}
