/* ============================================================
   Claude-Style Chat Input — Vanilla CSS for Odoo 19
   Converted from React/TSX + Tailwind reference component
   ============================================================ */

/* --- Design Tokens (scoped to chat section) --- */
.claude-chat-section {
    --cc-bg-0: #FAF9F5;
    --cc-bg-100: #FFFFFF;
    --cc-bg-200: #F0EEE6;
    --cc-bg-300: #DDDDDD;
    --cc-text-100: #1F1E1D;
    --cc-text-200: #3D3D3A;
    --cc-text-300: #73726C;
    --cc-text-400: #888888;
    --cc-text-500: #999999;
    --cc-accent: #D97757;
    --cc-accent-hover: #C6613F;

    position: relative;
    padding: 6rem 0;
    min-height: 80vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--cc-bg-0);
    font-family: "Inter", "Onest", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.claude-chat-section>.container {
    width: 100%;
    z-index: 10;
}

/* Dark mode via parent class */
.gm-hero~.claude-chat-section,
[data-bs-theme="dark"] .claude-chat-section {
    --cc-bg-0: #212121;
    --cc-bg-100: #262624;
    --cc-bg-200: #30302E;
    --cc-bg-300: #454540;
    --cc-text-100: #ECECEC;
    --cc-text-200: #E1E1E0;
    --cc-text-300: #B4B4B4;
    --cc-text-400: #8A8A88;
    --cc-text-500: #6B6B65;
    --cc-accent: #D2996E;
    --cc-accent-hover: #E5AA7F;
}

/* --- Section Background --- */
.claude-chat-mesh-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(at 0% 0%, rgba(217, 119, 87, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 0%, rgba(62, 146, 204, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(217, 119, 87, 0.08) 0px, transparent 50%);
    z-index: 0;
}

.claude-ani-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    opacity: 0.12;
    animation: claudeFloat 25s infinite ease-in-out;
    pointer-events: none;
}

.claude-orb-1 {
    top: -20%;
    right: -10%;
    background: var(--cc-accent);
}

.claude-orb-2 {
    bottom: -20%;
    left: -10%;
    background: #3e92cc;
    animation-delay: -7s;
}

@keyframes claudeFloat {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    33% {
        transform: translate(50px, -80px) rotate(8deg) scale(1.1);
    }

    66% {
        transform: translate(-40px, 40px) rotate(-8deg) scale(0.9);
    }

    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
}

/* --- Header --- */
.claude-chat-section .chat-header-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    background: var(--cc-bg-200);
    color: var(--cc-text-300);
    border: 1px solid var(--cc-bg-300);
    margin-bottom: 1rem;
}

.claude-chat-section .chat-header-badge i {
    margin-right: 8px;
    color: var(--cc-accent);
}

.claude-chat-section .chat-heading {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--cc-text-100);
    margin-bottom: 1rem;
    line-height: 1.15;
    font-family: "Source Serif 4", Georgia, serif;
}

.claude-chat-section .chat-subtitle {
    font-size: 1.1rem;
    color: var(--cc-text-300);
    max-width: 640px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

/* --- Main Chat Box (card container) --- */
.chat-input-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.claude-chat-box {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    z-index: 10;
    border-radius: 16px;
    cursor: text;
    border: 1px solid var(--cc-bg-300);
    background: var(--cc-bg-100);
    box-shadow:
        0 0 15px rgba(0, 0, 0, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.claude-chat-box:hover {
    box-shadow:
        0 0 20px rgba(0, 0, 0, 0.10),
        0 2px 8px rgba(0, 0, 0, 0.06);
}

.claude-chat-box:focus-within {
    box-shadow:
        0 0 0 2px rgba(217, 119, 87, 0.10),
        0 4px 16px rgba(0, 0, 0, 0.10);
    border-color: rgba(217, 119, 87, 0.25);
}

.claude-chat-box-inner {
    display: flex;
    flex-direction: column;
    padding: 12px 12px 8px;
    gap: 8px;
}

/* --- Textarea --- */
.claude-textarea-wrap {
    position: relative;
    max-height: 384px;
    width: 100%;
    overflow-y: auto;
    min-height: 2.5rem;
    padding-left: 4px;
}

.claude-textarea {
    width: 100%;
    background: transparent !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    color: var(--cc-text-100);
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    overflow: hidden;
    padding: 0;
    min-height: 1.5em;
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
}

.claude-textarea::placeholder {
    color: var(--cc-text-400);
}

.claude-textarea:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* --- Action Bar --- */
.claude-action-bar {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 4px;
}

.claude-tools-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.claude-tools-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Action Buttons (attach, thinking) --- */
.claude-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--cc-text-400);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    padding: 0;
    font-size: 16px;
}

.claude-tool-btn:hover {
    color: var(--cc-text-200);
    background: var(--cc-bg-200);
}

.claude-tool-btn:active {
    transform: scale(0.95);
}

.claude-tool-btn.active {
    color: var(--cc-accent);
    background: rgba(217, 119, 87, 0.10);
}

/* --- Model Selector --- */
.claude-model-selector {
    position: relative;
    flex-shrink: 0;
}

.claude-model-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 32px;
    padding: 0 8px 0 10px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--cc-text-300);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.claude-model-btn:hover,
.claude-model-btn.open {
    background: var(--cc-bg-200);
    color: var(--cc-text-100);
}

.claude-model-btn .chevron {
    font-size: 11px;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.claude-model-btn.open .chevron {
    transform: rotate(180deg);
}

/* Dropdown */
.claude-model-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: var(--cc-bg-100);
    border: 1px solid var(--cc-bg-300);
    border-radius: 16px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    z-index: 50;
    padding: 6px;
    animation: ccFadeIn 0.15s ease-out;
}

.claude-model-dropdown.open {
    display: flex;
    flex-direction: column;
}

.claude-model-option {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.12s ease;
    font-family: inherit;
}

.claude-model-option:hover {
    background: var(--cc-bg-200);
}

.claude-model-option .model-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--cc-text-100);
}

.claude-model-option .model-desc {
    font-size: 11px;
    color: var(--cc-text-300);
    margin-top: 2px;
}

.claude-model-option .model-check {
    color: #2563eb;
    font-size: 14px;
    margin-top: 3px;
    flex-shrink: 0;
    display: none;
}

.claude-model-option.selected .model-check {
    display: inline;
}

.claude-model-divider {
    height: 1px;
    background: var(--cc-bg-300);
    margin: 4px 8px;
}

/* --- Send Button --- */
.claude-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 12px;
    border: none;
    cursor: default;
    transition: all 0.15s ease;
    flex-shrink: 0;
    padding: 0;
    font-size: 14px;
    background: rgba(217, 119, 87, 0.3);
    color: rgba(255, 255, 255, 0.6);
}

.claude-send-btn.has-content {
    cursor: pointer;
    background: var(--cc-accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(217, 119, 87, 0.25);
}

.claude-send-btn.has-content:hover {
    background: var(--cc-accent-hover);
    box-shadow: 0 4px 12px rgba(217, 119, 87, 0.35);
}

.claude-send-btn.has-content:active {
    transform: scale(0.95);
}

/* --- Suggested Chips --- */
.claude-suggested-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 2rem auto 0;
    width: 100%;
    max-width: 100%;
    opacity: 0;
    animation: ccFadeIn 0.8s ease-out 0.5s forwards;
}

.claude-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    color: var(--cc-text-300);
    background: transparent;
    border: 1px solid var(--cc-bg-300);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
}

.claude-chip:hover {
    background: var(--cc-bg-200);
    color: var(--cc-text-200);
    transform: translateY(-1px);
}

.claude-chip:active {
    transform: scale(0.98);
}

.claude-chip i {
    font-size: 14px;
    opacity: 0.7;
}

/* --- File Preview Cards (future-ready) --- */
.claude-file-previews {
    display: none;
    /* Hidden until files attached */
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    padding-left: 4px;
}

.claude-file-previews.has-files {
    display: flex;
}

.claude-file-card {
    position: relative;
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--cc-bg-300);
    background: var(--cc-bg-200);
    animation: ccFadeIn 0.3s ease-out;
}

.claude-file-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.claude-file-card .file-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.claude-file-card:hover .file-remove {
    opacity: 1;
}

/* --- Disclaimer --- */
.claude-disclaimer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--cc-text-500);
}

/* --- Animations --- */
@keyframes ccFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ccSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .claude-chat-section {
        padding: 4rem 0;
        min-height: auto;
    }

    .claude-chat-section .chat-heading {
        font-size: 1.75rem;
    }

    .claude-chat-section .chat-subtitle {
        font-size: 1rem;
    }

    .claude-suggested-area {
        gap: 6px;
    }

    .claude-chip {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .claude-model-btn span {
        display: none;
    }
}