/* AI Dialog Styles */
.header-bar-icons {
    position: relative;
}

#ai-dialog {
    position: absolute;
    top: calc(100% + 16px);
    right: 80px;
    z-index: 1000;
}

/* Alpine.js 过渡动画类 */
.ai-dialog-enter {
    transition: all 0.3s ease-out;
}

.ai-dialog-enter-start {
    opacity: 0;
    transform: translateY(-20px);
}

.ai-dialog-enter-end {
    opacity: 1;
    transform: translateY(0);
}

.ai-dialog-leave {
    transition: all 0.2s ease-in;
}

.ai-dialog-leave-start {
    opacity: 1;
    transform: translateY(0);
}

.ai-dialog-leave-end {
    opacity: 0;
    transform: translateY(-20px);
}

/* Tab 切换过渡动画 */
.ai-dialog-body > div {
    transition: opacity 0.2s ease-in-out;
}

[x-cloak] {
    display: none !important;
}

.ai-dialog-content {
    background: #ececec;
    border: 2px solid #FFF;
    border-radius: 24px;
    padding: 24px;
    width: 340px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    position: relative;
}

.ai-dialog-content::before {
    content: "";
    position: absolute;
    top: -12px;
    right: 88px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #FFF;
}

.ai-dialog-header {
    display: flex;
    align-items: center;
    gap: 36px;
    margin-bottom: 24px;
}

.ai-icon {
    font-size: 32px;
}

.ai-tabs {
    display: flex;
    background: #C3CDDD;
    border-radius: 32px;
    padding: 2px;
    gap: 0;
    width: fit-content;
}

.ai-tab {
    padding: 10px 28px;
    border-radius: 32px;
    border: none;
    background: transparent;
    color: #FFF;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.ai-tab:hover:not(.ai-tab-active) {
    color: #606060;
}

.ai-tab:first-child {
    border-radius: 32px 0 0 32px;
}

.ai-tab:last-child {
    border-radius: 0 32px 32px 0;
}

.ai-tab-active {
    background: #FFF;
    color: #6F7D93;
    font-weight: 400;
}

.ai-dialog-body {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    gap: 0;
}

.ai-dialog-body > div {
    display: flex;
    flex-direction: column;
    gap: 20px;
    grid-column: 1;
    grid-row: 1;
    transition: opacity 0.15s ease-in-out;
}

.ai-dialog-body > div[x-cloak] {
    display: none;
}

/* 隐藏状态 - 配合 Alpine.js x-show */
.ai-dialog-body > div[style*="display: none"] {
    opacity: 0;
    pointer-events: none;
}

.ai-setting {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 16px;
}

.ai-setting:last-child {
    margin-bottom: 0;
}

.ai-setting .ai-tags {
    flex: 1;
}

.ai-label {
    font-size: 16px;
    color: #666;
    font-weight: 400;
    min-width: 40px;
}

.ai-slider-container {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    position: relative;
    padding: 20px 0;
    height: 48px;
}

.ai-slider {
    flex: 1;
    height: 10px;
    border-radius: 10px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    z-index: 1;
}

.ai-slider::-webkit-slider-runnable-track {
    height: 10px;
    border-radius: 10px;
    background: #d8d8d8;
}

.ai-slider[style*="--slider-progress"]::-webkit-slider-runnable-track {
    background: linear-gradient(to right, 
        #51E5B2 0%, 
        #51E5B2 calc(var(--slider-progress) * 1%), 
        #C3CDDD calc(var(--slider-progress) * 1%), 
        #C3CDDD 100%);
}

.ai-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    margin-top: -20px;
    position: relative;
}

.ai-slider::-moz-range-track {
    height: 10px;
    border-radius: 10px;
    background: #d8d8d8;
}

.ai-slider[style*="--slider-progress"]::-moz-range-track {
    background: linear-gradient(to right, 
        #5bd9a0 0%, 
        #5bd9a0 calc(var(--slider-progress) * 1%), 
        #d8d8d8 calc(var(--slider-progress) * 1%), 
        #d8d8d8 100%);
}

.ai-slider::-moz-range-thumb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border: none;
}

.ai-slider-value {
    padding: 19px 20px;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    pointer-events: none;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.15s ease;
    z-index: 100;
    font-family: 'Roboto Mono', monospace;
}

.ai-custom-btn {
    padding: 8px 18px;
    border-radius: 16px;
    border: 1px solid #d8d8d8;
    background: #fff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 12px;
    display: none;
}

.ai-custom-btn:hover {
    background: #f5f5f5;
}

.ai-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ai-tag {
    padding: 8px 16px;
    border-radius: 20px;
    background: #fff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.ai-tag:hover {
    background: #f5f5f5;
}

.ai-tag-active {
    background: #fff;
    color: #333;
    border-color: #5bd1a1;
    font-weight: 500;
}

.ai-generate-btn {
    padding: 12px 24px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #51E5B2 0%, #7bc4ad 100%);
    color: #333;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.ai-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 196, 173, 0.4);
}

.ai-preview {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
}

.ai-preview-label {
    font-size: 13px;
    color: #999;
    text-align: center;
    margin-bottom: 12px;
}

.ai-preview-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 15px;
    color: #333;
}

.ai-preview-content div {
    padding: 4px 0;
}

.ai-preview-content p {
    padding: 4px 0;
    text-align: justify;
}

.ai-preview-content::-webkit-scrollbar {
    width: 6px;
}

.ai-preview-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ai-preview-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.ai-preview-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.ai-time-setting {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.ai-time-icon {
    font-size: 24px;
}

.ai-time-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.ai-time-options {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.ai-time-option {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: #666;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Roboto Mono', monospace;
    border: 3px solid transparent;
}

.ai-time-option:hover {
    background: #f5f5f5;
}

.ai-time-option-active {
    background: #fff;
    color: #333;
    border: 3px solid #5bd1a1;
    font-weight: 600;
}

.ai-reset-btn {
    padding: 12px 24px;
    border-radius: 16px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-reset-btn:hover {
    background: #f5f5f5;
}
