/* ===== AI HERO ===== */
.ai-hero {
    position: relative; min-height: 50vh;
    display: flex; align-items: center; justify-content: center;
    padding: 140px 0 60px; overflow: hidden;
}
.ai-hero-bg { position: absolute; inset: 0; }
.ai-glow {
    position: absolute; top: -150px; left: 50%; transform: translateX(-50%);
    width: 600px; height: 400px;
    background: radial-gradient(circle, rgba(197,160,89,0.15) 0%, rgba(168,85,247,0.05) 40%, transparent 70%);
    filter: blur(60px);
}
.ai-particles {
    position: absolute; inset: 0; overflow: hidden;
}
.ai-particle {
    position: absolute; border-radius: 50%;
    background: var(--accent); opacity: 0.15;
    animation: particleFloat linear infinite;
}
@keyframes particleFloat {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.15; }
    90% { opacity: 0.15; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}
.ai-hero-content { text-align: center; position: relative; z-index: 1; }
.ai-hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 16px; border-radius: 999px;
    background: linear-gradient(135deg, rgba(197,160,89,0.12), rgba(168,85,247,0.12));
    color: var(--accent); font-size: 13px; font-weight: 600;
    letter-spacing: 0.05em; border: 1px solid rgba(197,160,89,0.2);
    margin-bottom: 24px;
}
.ai-badge-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    animation: pulse 2s ease-in-out infinite;
}
.ai-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(48px, 8vw, 80px);
    font-weight: 700; line-height: 1.1; margin-bottom: 16px;
}
.ai-hero p {
    font-size: 17px; color: var(--text-secondary);
    max-width: 580px; margin: 0 auto; line-height: 1.7;
}

/* ===== AI TOOLS GRID ===== */
.ai-tools-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}
.ai-tool-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
    transition: border-color 0.3s ease;
}
.ai-tool-card:hover { border-color: rgba(197,160,89,0.2); }
.ai-tool-header {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 20px;
}
.ai-tool-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: var(--accent-glow); display: flex;
    align-items: center; justify-content: center;
    color: var(--accent); flex-shrink: 0;
}
.ai-tool-icon.chat-icon { background: rgba(168,85,247,0.12); color: #a855f7; }
.ai-tool-icon.combiner-icon { background: rgba(59,130,246,0.12); color: #3b82f6; }
.ai-tool-icon.style-icon { background: rgba(236,72,153,0.12); color: #ec4899; }
.ai-tool-header h3 {
    font-family: var(--font-heading); font-size: 18px;
    font-weight: 600; margin-bottom: 2px;
}
.ai-tool-header p { font-size: 13px; color: var(--text-muted); }

/* ===== TEXT TO 3D ===== */
.ai-tool-main { grid-column: 1; }
.ai-prompt-area { margin-bottom: 20px; }
.ai-prompt-wrapper {
    position: relative; display: flex; gap: 10px;
}
.ai-prompt-input {
    flex: 1; padding: 14px 16px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    color: var(--text-primary); font-size: 14px; resize: none;
    outline: none; font-family: var(--font-body);
    transition: border-color 0.2s;
}
.ai-prompt-input:focus { border-color: var(--accent); }
.ai-prompt-input::placeholder { color: var(--text-muted); }
.ai-generate-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 20px; background: linear-gradient(135deg, var(--accent), #d4b06a);
    color: #000; border: none; border-radius: var(--radius-md);
    font-weight: 700; font-size: 14px; cursor: pointer;
    transition: all 0.3s ease; white-space: nowrap;
}
.ai-generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(197,160,89,0.4);
}
.ai-generate-btn:active { transform: translateY(0); }
.ai-suggestions {
    display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;
}
.ai-suggestion-tag {
    padding: 6px 12px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 999px;
    font-size: 12px; color: var(--text-secondary);
    cursor: pointer; transition: all 0.2s ease;
}
.ai-suggestion-tag:hover {
    border-color: var(--accent); color: var(--accent);
    background: var(--accent-glow);
}

/* ===== AI PREVIEW ===== */
.ai-preview {
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-md); overflow: hidden;
    min-height: 350px; position: relative;
}
.ai-preview-empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 350px; color: var(--text-muted);
}
.ai-preview-empty p { font-size: 13px; margin-top: 12px; }
#aiCanvas { width: 100%; height: 350px; display: block; }
.ai-loading {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(9,9,11,0.85); backdrop-filter: blur(4px);
    z-index: 2;
}
.ai-spinner {
    width: 40px; height: 40px; border: 3px solid var(--border);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.8s linear infinite; margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-loading p { font-size: 14px; font-weight: 500; }
.ai-loading span { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.ai-actions {
    display: flex; gap: 10px; margin-top: 16px;
}

/* ===== CHAT ===== */
.ai-chat-card {
    grid-column: 2; grid-row: 1 / 3;
    display: flex; flex-direction: column;
    max-height: 700px;
}
.chat-messages {
    flex: 1; overflow-y: auto; padding: 16px 0;
    display: flex; flex-direction: column; gap: 16px;
    max-height: 480px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.chat-msg { display: flex; gap: 10px; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.ai-avatar { background: linear-gradient(135deg, var(--accent), #a855f7); color: #000; }
.user-avatar { background: var(--bg-secondary); color: var(--text-secondary); }
.chat-bubble {
    max-width: 80%; padding: 12px 16px;
    border-radius: var(--radius-md); font-size: 13px;
    line-height: 1.6;
}
.chat-msg.ai .chat-bubble {
    background: var(--bg-secondary); border: 1px solid var(--border);
    color: var(--text-primary);
}
.chat-msg.user .chat-bubble {
    background: var(--accent-glow); border: 1px solid rgba(197,160,89,0.2);
    color: var(--text-primary);
}
.chat-typing {
    display: flex; gap: 4px; padding: 4px 0;
}
.chat-typing span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); }
}
.chat-input-area {
    display: flex; gap: 8px; padding-top: 12px;
    border-top: 1px solid var(--border);
}
.chat-input {
    flex: 1; padding: 10px 14px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    color: var(--text-primary); font-size: 13px; outline: none;
}
.chat-input:focus { border-color: var(--accent); }
.chat-send {
    width: 38px; height: 38px; border-radius: var(--radius-md);
    background: var(--accent); color: #000;
    display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer; transition: all 0.2s;
}
.chat-send:hover { background: var(--accent-hover); }

/* ===== COMBINER ===== */
.ai-combiner-card { grid-column: 1; }
.combiner-shapes {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
}
.combiner-check {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 12px; color: var(--text-secondary);
    cursor: pointer; transition: all 0.2s;
}
.combiner-check:has(input:checked) {
    border-color: var(--accent); color: var(--accent);
    background: var(--accent-glow);
}
.combiner-check input { display: none; }
.combiner-select {
    width: 100%; padding: 10px 12px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    color: var(--text-primary); font-size: 13px; outline: none;
    margin-bottom: 14px;
}
.combiner-select:focus { border-color: var(--accent); }
.combiner-preview {
    margin-top: 16px; background: var(--bg-primary);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    min-height: 200px; overflow: hidden;
}
#combinerCanvas { width: 100%; height: 200px; display: block; }

/* ===== STYLE TRANSFER ===== */
.ai-style-card { grid-column: 1; }
.style-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.style-option {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; padding: 14px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    cursor: pointer; transition: all 0.2s;
}
.style-option:hover { border-color: var(--accent); }
.style-option.active {
    border-color: var(--accent); background: var(--accent-glow);
    color: var(--accent);
}
.style-preview {
    width: 48px; height: 48px; border-radius: 8px;
}
.style-option span { font-size: 11px; font-weight: 500; }
.lowpoly-preview { background: linear-gradient(135deg, #3b82f6 25%, #60a5fa 25%, #60a5fa 50%, #3b82f6 50%, #3b82f6 75%, #60a5fa 75%); background-size: 8px 8px; }
.smooth-preview { background: linear-gradient(135deg, #22c55e, #4ade80); border-radius: 50%; }
.voxel-preview { background: #f97316; image-rendering: pixelated; box-shadow: inset -4px -4px 0 rgba(0,0,0,0.2), inset 4px 4px 0 rgba(255,255,255,0.1); }
.organic-preview { background: linear-gradient(135deg, #ec4899, #f472b6, #ec4899); border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
.geometric-preview { background: #a855f7; clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%); }
.crystal-preview { background: linear-gradient(135deg, #06b6d4, #22d3ee, #06b6d4); clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); }
.style-preview-area {
    margin-top: 16px; background: var(--bg-primary);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    overflow: hidden;
}
#styleCanvas { width: 100%; height: 250px; display: block; }
.style-actions {
    display: flex; gap: 8px; padding: 12px;
    border-top: 1px solid var(--border);
}

/* ===== AI CAPABILITIES ===== */
.ai-caps-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.ai-cap-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px;
    transition: all 0.3s ease;
}
.ai-cap-card:hover {
    border-color: rgba(197,160,89,0.2); transform: translateY(-2px);
}
.ai-cap-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: var(--accent-glow); display: flex;
    align-items: center; justify-content: center;
    font-size: 22px; margin-bottom: 16px;
}
.ai-cap-card h4 {
    font-family: var(--font-heading); font-size: 16px;
    font-weight: 600; margin-bottom: 8px;
}
.ai-cap-card p {
    font-size: 13px; color: var(--text-secondary); line-height: 1.6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .ai-tools-grid {
        grid-template-columns: 1fr;
    }
    .ai-chat-card {
        grid-column: 1; grid-row: auto;
        max-height: 400px;
    }
    .chat-messages { max-height: 280px; }
}
@media (max-width: 640px) {
    .ai-hero { min-height: 35vh; padding: 120px 0 40px; }
    .ai-hero h1 { font-size: 40px; }
    .ai-prompt-wrapper { flex-direction: column; }
    .ai-generate-btn { justify-content: center; }
    .style-grid { grid-template-columns: repeat(2, 1fr); }
    .ai-actions { flex-wrap: wrap; }
    .ai-caps-grid { grid-template-columns: 1fr; }
}
