.ai-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 107, 0.4);
}

.ai-toggle i {
    animation: pulse 2s infinite;
}

.ai-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    width: 90vw;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-panel.hidden {
    display: none;
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.ai-header h3 {
    margin: 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-close {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.ai-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.ai-content {
    padding: 1.5rem;
}

.ai-input-section {
    margin-bottom: 1.5rem;
}

.ai-action-section {
    margin-bottom: 2rem;
    text-align: center;
}

.ai-input-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.ai-input-section textarea {
    width: 100%;
    min-height: 100px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 1rem;
}

.ai-input-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.ai-analyze-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-transform: none;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.ai-analyze-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.ai-analyze-btn:hover::before {
    left: 100%;
}

.ai-analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.ai-analyze-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.ai-analyze-btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ai-analyze-btn i {
    font-size: 1.2rem;
    animation: none;
}

.ai-analyze-btn .fa-spinner {
    animation: spin 1s linear infinite;
}

.ai-analyze-btn span {
    font-weight: 600;
}



.ai-results {
    margin: 1.5rem 0;
}

.ai-recommendation h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recommendation-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.recommendation-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.recommendation-card.custom {
    border-left: 4px solid var(--primary-color);
}

.recommendation-card.preset {
    border-left: 4px solid var(--secondary-color);
}

.recommendation-card h5 {
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.settings-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.settings-preview span {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--text-color);
}

.recommendation-card .reason {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.recommendation-card .apply-btn {
    width: 100%;
    padding: 0.8rem;
    font-size: 0.9rem;
}

.ai-presets-section {
    margin-top: 2rem;
}

.ai-presets-section h4 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.preset-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    text-align: center;
}

.preset-card:hover {
    transform: translateY(-2px);
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.preset-card h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.preset-timing {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.preset-card p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.3;
}

.ai-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    color: #f87171;
}

.ai-error i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.ai-success {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: rgba(34, 197, 94, 0.9);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
    z-index: 1001;
    animation: slideInRight 0.3s ease;
}

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

@media (max-width: 768px) {
    .ai-panel {
        width: 95vw;
        max-height: 85vh;
    }

    .recommendation-cards {
        grid-template-columns: 1fr;
    }

    .ai-presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ai-toggle {
        bottom: 1rem;
        right: 1rem;
        padding: 0.8rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .ai-content {
        padding: 1rem;
    }

    .ai-header {
        padding: 1rem;
    }

    .recommendation-card {
        padding: 1rem;
    }

    .ai-presets-grid {
        grid-template-columns: 1fr;
    }

    .preset-card {
        padding: 0.8rem;
    }
} 