/* Ad Description Writer States */
.ad-writer-state {
    display: none;
}

.ad-writer-state.active {
    display: block;
}

.ad-writer-placeholder {
    font-size: 14px;
    color: var(--color-text-faint);
    text-align: center;
    padding: 40px 20px;
}

/* Start State — existing listing prompt */
.ad-writer-start-card {
    text-align: center;
    padding: 40px 20px;
}

.ad-writer-start-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: 14px;
    color: #4f46e5;
    margin-bottom: 16px;
}

.ad-writer-start-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.ad-writer-start-text {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0 auto 20px auto;
    max-width: 380px;
}

.ad-writer-start-input-row {
    display: flex;
    gap: 8px;
    max-width: 420px;
    margin: 0 auto 16px auto;
}

.ad-writer-start-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.ad-writer-start-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.ad-writer-start-submit {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
}

.ad-writer-start-submit:hover {
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.ad-writer-start-skip {
    background: var(--color-bg);
    border: 1.5px solid #d1d5db;
    color: #4b5563;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    padding: 10px 24px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ad-writer-start-skip:hover {
    color: #1f2937;
    border-color: var(--color-text-faint);
    background: var(--color-bg-subtle);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Ad Writer Upload State */
.ad-writer-upload-card {
    text-align: center;
    padding: 30px 20px;
}

.ad-writer-upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    background: linear-gradient(180deg, #fafbfc 0%, #f3f4f6 100%);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text-faint);
    max-width: 420px;
    margin: 0 auto 16px auto;
}

.ad-writer-upload-dropzone:hover {
    border-color: var(--color-primary);
    background: linear-gradient(180deg, #f5f3ff 0%, #eef2ff 100%);
    color: #4f46e5;
}

.ad-writer-upload-dropzone.drag-over {
    border-color: var(--color-primary);
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4f46e5;
    transform: scale(1.01);
}

.ad-writer-upload-dropzone .dropzone-text {
    margin-top: 10px;
}

/* File List */
.ad-writer-file-list {
    max-width: 420px;
    margin: 0 auto 16px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.ad-writer-file-list:empty {
    display: none;
}

.ad-writer-file-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--color-primary-bg);
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    font-size: 12px;
    color: #4338ca;
    font-weight: 500;
}

.ad-writer-file-remove {
    background: none;
    border: none;
    color: #a5b4fc;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-weight: 700;
}

.ad-writer-file-remove:hover {
    color: #4f46e5;
}

/* Upload Actions */
.ad-writer-upload-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ad-writer-upload-continue {
    padding: 10px 28px;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.ad-writer-upload-continue:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.ad-writer-upload-continue:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Ad Writer Chat State */
.ad-writer-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
}

/* Ad Output Area */
.ad-writer-ad-output {
    background: var(--color-bg-subtle);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    animation: stepFadeIn 0.3s ease-out;
}

.ad-writer-ad-output.hidden {
    display: none;
}

.ad-writer-ad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ad-writer-ad-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.ad-writer-ad-actions {
    display: flex;
    gap: 8px;
}

.ad-writer-ad-copy,
.ad-writer-ad-done {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    border: 1px solid transparent;
}

.ad-writer-ad-copy {
    background: white;
    color: var(--color-text-secondary);
    border-color: var(--color-border-strong);
}

.ad-writer-ad-copy:hover {
    background: var(--color-bg-muted);
    border-color: var(--color-text-faint);
}

.ad-writer-ad-done {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
}

.ad-writer-ad-done:hover {
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.ad-writer-ad-textarea {
    width: 100%;
    min-height: 180px;
    padding: 12px 14px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text);
    resize: vertical;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.ad-writer-ad-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Chat Messages */
.ad-writer-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    max-height: 400px;
}

.ad-writer-msg {
    display: flex;
    gap: 10px;
    max-width: 88%;
    animation: stepFadeIn 0.2s ease-out;
}

.ad-writer-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ad-writer-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.ad-writer-msg-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.ad-writer-msg.assistant .ad-writer-msg-content {
    background: var(--color-bg-muted);
    color: var(--color-text);
    border-bottom-left-radius: 4px;
}

.ad-writer-msg.user .ad-writer-msg-content {
    background: var(--color-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.ad-writer-msg-content p {
    margin: 0 0 8px 0;
}

.ad-writer-msg-content p:last-child {
    margin-bottom: 0;
}

.ad-writer-msg-content strong {
    font-weight: 600;
}

/* Ad Writer Chat Input — now inherits from .tool-prompt-bar */
.ad-writer-input-area {
    margin-top: auto;
}
.ad-writer-input { /* styling inherited from .tool-prompt-bar textarea */ }
.ad-writer-send-btn { /* styling inherited from .tool-prompt-bar .prompt-send-btn */ }

/* Typing Indicator */
.ad-writer-typing {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}

.ad-writer-typing span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: adWriterBounce 1.4s infinite both;
}

.ad-writer-typing span:nth-child(2) { animation-delay: 0.2s; }
.ad-writer-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes adWriterBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .claude-main {
        border-radius: 0;
    }
    .claude-empty-state,
    .claude-input-container {
        margin-left: 0;
    }
    .chat-flip-toolbar {
        margin-bottom: 12px;
    }
    #claude-chats-list-view.active,
    #claude-projects-list-view.active {
        margin: 0;
        border-radius: 0;
    }
    .tools-grid {
        grid-template-columns: 1fr;
    }
    .main-tabs {
        transform: none; /* No offset when sidebar is hidden */
    }
}

