:root {
    --ai-primary: #6c5ce7;
    --ai-primary-dark: #5a4bd1;
    --ai-secondary: #a29bfe;
    --ai-success: #00b894;
    --ai-danger: #d63031;
    --ai-warning: #fdcb6e;
    --ai-dark: #2d3436;
    --ai-light: #f5f6fa;
    --ai-white: #ffffff;
    --ai-gray: #dfe6e9;
    --ai-border-radius: 16px;
    --ai-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --ai-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.ai-dream-container {
    max-width: 800px;
    margin: 2rem auto;
    background: var(--ai-white);
    border-radius: var(--ai-border-radius);
    box-shadow: var(--ai-shadow);
    overflow: hidden;
    direction: rtl;
    font-family: inherit;
}

.ai-dream-header {
    background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
    padding: 2rem;
    text-align: center;
    color: white;
}

.ai-dream-header h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.ai-dream-header p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
}

.ai-dream-content {
    padding: 2rem;
}

.ai-type-switch {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: var(--ai-light);
    padding: 0.5rem;
    border-radius: 50px;
}

.ai-pill {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--ai-dark);
}

.ai-pill.active {
    background: var(--ai-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.ai-dream-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--ai-gray);
    border-radius: 12px;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.ai-dream-input:focus {
    outline: none;
    border-color: var(--ai-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.ai-dream-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--ai-primary), var(--ai-primary-dark));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.ai-dream-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.ai-dream-btn:disabled {
    opacity: 0.6;
    transform: none;
}

.ai-credit-card {
    background: linear-gradient(135deg, #2d3436 0%, #1e1e2e 100%);
    border-radius: 16px;
    padding: 0;
    margin: 1rem 0;
    color: white;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    flex-wrap: wrap;
}

.ai-credit-block {
    flex: 1;
    min-width: 120px;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-credit-free  { background: rgba(0,184,148,0.15); }
.ai-credit-paid  { background: rgba(108,92,231,0.20); }
.ai-credit-login { background: rgba(253,203,110,0.12); flex: 2; justify-content: center; }

.ai-credit-divider {
    width: 1px;
    background: rgba(255,255,255,0.1);
    align-self: stretch;
}

.ai-credit-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}

.ai-credit-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.ai-credit-label {
    font-size: 0.72rem;
    opacity: 0.75;
    white-space: nowrap;
}

.ai-credit-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.ai-credit-sep { opacity: 0.5; font-size: 1rem; }

.ai-credit-sub {
    font-size: 0.68rem;
    opacity: 0.6;
    white-space: nowrap;
}

.ai-credit-login-link {
    color: #fdcb6e;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}
.ai-credit-login-link:hover { text-decoration: underline; }

.ai-credit-amount { font-size: 1.5rem; font-weight: bold; }

.ai-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.ai-loader-spinner {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
}

.ai-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--ai-gray);
    border-top-color: var(--ai-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.ai-dream-result {
    margin-top: 2rem;
    display: none;
    animation: fadeIn 0.5s ease;
}

.ai-dream-section {
    background: var(--ai-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-right: 4px solid var(--ai-primary);
}

.ai-dream-section h4 {
    margin: 0 0 1rem;
    color: var(--ai-primary);
    font-size: 1.2rem;
}

.ai-dream-section p {
    line-height: 1.8;
    color: var(--ai-dark);
}

/* استایل برای بخش Upsell نسخه رایگان */
.ai-dream-upsell {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    animation: fadeIn 0.5s ease;
}

.ai-dream-upsell h4 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    font-weight: 700;
}

.ai-dream-upsell p {
    margin: 10px 0;
    line-height: 1.8;
    opacity: 0.95;
}

.ai-dream-upsell button {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.1em;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.ai-dream-upsell button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

.ai-feedback-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--ai-light);
    border-radius: 12px;
    display: none;
}

.feedback-buttons {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.feedback-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--ai-gray);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.feedback-btn.active-yes {
    background: var(--ai-success);
    border-color: var(--ai-success);
    color: white;
}

.feedback-btn.active-no {
    background: var(--ai-danger);
    border-color: var(--ai-danger);
    color: white;
}

.ai-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    background: var(--ai-dark);
    color: white;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.ai-toast.success { background: var(--ai-success); }
.ai-toast.error { background: var(--ai-danger); }
.ai-toast.warning { background: var(--ai-warning); }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
    .ai-dream-container {
        margin: 1rem;
    }
    
    .ai-dream-content {
        padding: 1rem;
    }
    
    .ai-type-switch {
        flex-direction: column;
        gap: 0.5rem;
        background: none;
        padding: 0;
    }
    
    .ai-pill {
        background: var(--ai-light);
    }
    
    .ai-dream-upsell h4 {
        font-size: 1.1em;
    }
    
    .ai-dream-upsell button {
        font-size: 1em;
        padding: 10px 20px;
    }
}
